当前位置:首页文章首页 IT学院 IT技术

利用bacula完成数据的备份恢复

作者:  来源:  发布时间:2012-2-16 8:52:38  点击:

  Name = dbpool
  Pool Type = Backup
  Recycle = yes                       # 重复使用
  AutoPrune = yes                     # 自动清除过去备份
  Volume Retention = 365 days         # 备份文件保存时间
  Maximum Volume Jobs =1              # 每次执行备份任务创建一个备份文件。
  Maximum Volume Bytes = 50G          # 限制备份文件文件最大值
  Maximum Volumes = 100               # 最多保存多少个备份文件
  Recycle Current Volume = yes        # 使用最近过期的文件存储新备份
  Label Format = "db-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}-id${JobId}"  #设定备份文件命名格式
}
 
#Pool {
#  Name = Scratch
#  Pool Type = Backup
#}
 
Console {                         #限定console利用tray-monitor获取diretor的状态信息
  Name = 2012-02-15-mon
  Password = "1tcj5GjpmPFP6M46JgjYzhiDsdC3br/4fDzKuH9kQRlz"
  CommandACL = status, .status
}
 
3. bacula的SD配置(bacula-sd.conf)
[root@baculaserver etc]# vim bacula-sd.conf
Storage {                             # 定义存储,本例2012-02-15-sd
  Name = 2012-02-15-sd
  SDPort = 9103                       # 服务端口   
  WorkingDirectory = "/usr/local/bacula/var/bacula/working"
  Pid Directory = "/var/run"
  Maximum Concurrent Jobs = 20
}
 
Director {                        #定义一个控制StorageDaemon的控制台Director
  Name = 2012-02-15-dir           #该值必须与bacula-dir.conf中Director逻辑段内定义相同
  Password = "w6YqAfWkU7NMxRJ8s/8y5kUffGpysot4vt9HVQjE9bQy"   #必须与bacula-dir.conf中Storage逻辑端定义password相同
}
 
Director {                      #定义一个监控端的Director
  Name = 2012-02-15-mon         #必须与bacula-dir.conf中Console逻辑段内定义相同
  Password = "1tcj5GjpmPFP6M46JgjYzhiDsdC3br/4fDzKuH9kQRlz"   #必须与bacula-dir.conf中Console逻辑段内定义password相同
  Monitor = yes
}
 
Device {
  Name = dbdev                         #定义device,名称与Director端配置文件bacula-dir.conf中的Storage逻辑端Device相同
  Media Type = File                    #存储介质类型,file表示文件系统存储
  Archive Device = /home/webbak        #指定存储介质,可以使cd、dvd、tap等,这里是将备份文件保存在/home/webak目录下
  LabelMedia = yes;                    #通过Label建立卷文件
  Random Access = Yes;                 #是否采用随机访问存储介质,
  AutomaticMount = yes;                # 存储设备打开是,是否自动使用他
  RemovableMedia = no;                 #是否支持移动设备,如tap,cd等
  AlwaysOpen = no;                     #是否确保tap设备总是可用
}
 
Messages {                            #为存储端SD定义一个日志或消息出来机制
  Name = Standard
  director = 2012-02-15-dir = all
}
                                                        
4. bacula的FD端配置(bacula-fd.conf)
[root@balucaclient etc]# vim bacula-fd.conf
Director {
  Name = 2012-02-15-dir         #定义一个允许连接FD的控制端,必须与bacula-dir.conf中Director逻辑端名称相同
  Password = "d1+RTcYIpa7YYB2/SrhRp/BAB7lBSF/Rl7wgrkSb52A2"  #必须与bacula-dir.conf中Client逻辑端密码相同
}
 
#
# Restricted Director, used by tray-monitor to get the
#   status of the file daemon
#
Director {
  Name = 2012-02-15-mon      #定义一个允许连接FD的监控端Console
  Password = "1tcj5GjpmPFP6M46JgjYzhiDsdC3br/4fDzKuH9kQRlz"   #必须与bacula-dir.conf中Console逻辑段内定义password相同
  Monitor = yes
}
 
#
# "Global" File daemon configuration specifications
#
FileDaemon {                          # 定义一个FD端
  Name = 2012-02-15-fd
  FDport = 9102                       # 监控端口
  WorkingDirectory = /usr/local/bacula/var/bacula/working
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20
}
 
# Send all messages except skipped files back to Director
Messages {
  Name = Standard
  director = balucaclient-dir = all, !skipped, !restored
}
 
四、 bacula服务的启动 
1. 在服务器端启动bacula的Director Daemon和Storage Daemon
1.1 启动方式一
[root@baculaserver etc]#/usr/local/bacula/etc/bacula {start|stop|restart|status}
 
1.2 启动方式二:分别管理各个配置端的方式,依次启动或关闭每个服务
[root@baculaserver etc]#/usr/local/bacula/etc/bacula-dir {start|stop|restart|status}
[root@baculaserver etc]#/usr/local/bacula/etc/bacula-sd {start|stop|restart|status}
[root@baculaserver etc]#/usr/local/bacula/etc/bacula-fd {start|stop|restart|status}  
#由于fd端在baculaclient上,在此无需自动bacula-fd服务
[root@baculaserver etc]# netstat -tnpl | grep 910
tcp   0      0 0.0.0.0:9101                0.0.0.0:*                   LISTEN      1507/bacula-dir  
tcp   0      0 0.0.0.0:9102                0.0.0.0:*                   LISTEN      1333/bacula-fd   
tcp    0      0 0.0.0.0:9103                0.0.0.0:*                   LISTEN      1323/bacula-sd 
#在启动bacula的所有服务前,必须启动MySQL数据库,否则连接bacula的控制端是会报错。

Tags:

备份恢复
首页 上一页 [1] [2] [3] [4] [5]  下一页 尾页

相关文章

文章评论

软件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z