SD
配置:
Storage {
Name =dbsd //
这里要与director配置文件的storage的name一样
SDAddress=10.10.2.226 //
这里是SD的IP
SDPort = 9103
WorkingDirectory = "/var/bacula/working"
Pid Directory = "/var/run"
Maximum Concurrent Jobs = 20 //job
的最大连接数
}
Director {
Name =linux-0fdr-dir //
这里要与directory的name相同
Password = "5jipKA7pekDel6BUjgIwD3LkPPBgxcecbLpLfl9puj0c " //
这里与directory中storage的password相同
}
Director { //
这个是做监控的配置
Name = linux-0fdr-dir
Password = "MJ8SyFywMm+4ntJf2EupggRWIWE6LozmLfIKC8J9nYt7"
Monitor = yes
Device {
Name =dbdev //
这里要与directory中storage的device一样
Media Type = File //
这里要与diretory中storage的Media Type相同
Archive Device =/home/bakcup/ //
备份的路径
LabelMedia = yes;
Random Access = Yes;
AutomaticMount = yes;
RemovableMedia = no;
AlwaysOpen = no;
}
Messages {
Name = Standard
director = linux-0fdr-dir = all
}
console
端的配置:
Director {
Name = linux-0fdr-dir //
这里要与directory的name相 同
DIRport = 9101
address = 10.10.2.226 //console
端的IP
Password = "MJ8SyFywMm+4ntJf2EupggRWIWE6LozmLfIKC8J9nYt7"
//
这个密码要与directory的password一样
}
4.启动bacula的进程
在server端,只启动directory和storage的进程,启动命令如下:
#./bacula-ctl-dir start
#./bacula-ctl-sd start
启动之后,要给bacula
添加存储介质,
linux-0fdr:/etc/bacula # ./bconsole
Connecting to Director 10.10.2.226:9101
1000 OK: linux-0fdr-dir Version: 2.4.3 (10 October 2008)
Enter a period to cancel a command.
*label
Automatically selected Catalog: dbcatalog
Using Catalog "dbcatalog"
Automatically selected Storage: dbsd
Enter new Volume name: woyun //
这里随便给他起个卷名
Automatically selected Pool: dbpool
Connecting to Storage daemon dbsd at 10.10.2.226:9103 ...
Sending label command for Volume "test" Slot 0 ...
3000 OK label. VolBytes=188 DVD=0 Volume="test" Device="dbdev" (/home/bakcup/)
Catalog record for Volume "test", Slot 0 successfully created.
Requesting to mount dbdev ...
3906 File device "dbdev" (/home/bakcup/) is always mounted.
You have messages.
注意:上面黄色底红色字的为要输入的内容.
二. bacula在client服务器上的安装和配置
1.安装bacula
#tar zxvf bacula-2.4.3.tar.gz
# cd bacula-2.4.3
#./configure --enable-client-only
#make&&make install
默认安装在/etc/bacula/目录下
2.bacula的配置
#more bacula-fd.conf
#####################################################################
FD
配置:
Director
Name = linux-0fdr-dir //
这里要与directory的name相同
Password = "Nd+Yuqe+Kd5wBc1S9uMTEGTNqNIe1cupnfuOdwboej6Z"//
这里与directory中client的password相同
}
Director { //
这个是做监控的配置
Name = linux-0fdr-mon
Password = "MJ8SyFywMm+4ntJf2EupggRWIWE6LozmLfIKC8J9nYt7"
Monitor = yes
}
FileDaemon {
Name = dbfd //
这里要与diretory的 job里的client相同
FDport = 9102
FDAddress=10.10.2.162 //
被备份服务器的IP
WorkingDirectory = /var/bacula/working
Pid Directory = /var/run
Maximum Concurrent Jobs = 20
}
3.启动bacula的fd进程
#bacula-ctl-fd start
三.备份以及还原过程.
经过艰辛万苦终于走到了这一步,不容易啊,好现在备份下10.10.2.162的/home/bacula这个目录,操作如下:
#./bacula
Connecting to Director 10.10.2.226:9101
1000 OK: linux-0fdr-dir Version: 2.4.3 (10 October 2008)
Enter a period to cancel a command.
*run
Automatically selected Catalog: dbcatalog
Using Catalog "dbcatalog"
A job name must be specified.
The defined Job resources are:
1: dbjob
2: restrory
Select Job resource (1-2): 1
Run Backup job
JobName: dbjob
Level: Full
Client: dbfd
FileSet: dbfs
Pool: dbpool (From Job resource)
Storage: dbsd (From Job resource)
When: 2009-08-25 15:23:14
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=54
*list jobs
54 | dbjob | 2009-08-25 15:23:18 | B | F | 0 | 0 | R | //这里会出现一个列表,我当前只复制
最新的一个JOBID,这里注意红色的R表示已
经在运行了,要是E或者C就是有问题了,要
是T就表示复制完成了.
*
status
Status available for:
1: Director
2: Storage
3: Client
4: All
Select daemon type for status (1-4):
3
Automatically selected Client: dbfd
Connecting to Client dbfd at 10.10.2.162:9102
………………………………………………………
//
这里省略一部分输出信息
54 Full 1,628 9.773 M OK 25- 8?009 15:27 dbjob
//
看到这里已经显示OK了,表示备份成功