Backup Server Bacula (Group Share)

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 10

Author: Muhammad Zeeshan Bhatti Article Name: BACULA BACKUP SERVER Email: Zeeshan.bhatti@hotmail.

com Contact: 92+333 717 9019

Bacula Backup Server Setup on CentOS 5.3 (1) [192.168.1.8] - Bacula Server ( Director Daemon & Storage Daemon runs ) (2) [192.168.1.9] - Bacula Client ( For Backup. File Daemon runs ) And also Bacula server uses MySQL, so you need to run MySQL server on it. Install packages that are needed to build RPM of Bacula. [root@smsgw ~]#yum -y install ncurses-devel libxml2-devel zlib-devel openssl-devel pangodevel atk-devel libtermcap-devel gtk2-devel libgnomeui-devel ORBit2-devel libart_lgpl-devel libbonobo-devel libbonoboui-devel GConf2-devel freetype-devel mysql-devel [root@smsgw ~]#wget http://nchc.dl.sourceforge.net/sourceforge/bacula/bacula-3.0.1-1.src.rpm [root@smsgw ~]#rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql5 1" --define "nobuild_gconsole 0" bacula-3.0.1-1.src.rpm [root@smsgw ~]#cd /usr/src/redhat/RPMS/i386 [root@smsgw ~]#rpm -Uvh bacula-mtx-3.0.1-1.i386.rpm Preparing... ############################ [100%] 1:bacula-mtx ############################ [100%] [root@smsgw i386 ~]#rpm -Uvh bacula-mysql-3.0.1-1.i386.rpm Preparing... ############################ [100%] The group bacula has been added to /etc/group. See the manual chapter "Running Bacula" for details. The user bacula has been added to /etc/passwd. See the manual chapter "Running Bacula" for details. 1:bacula-mysql ############################ [100%] Hmm, doesn't look like you have an existing database. Granting privileges for MySQL user bacula... ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Error creating privileges. Creating MySQL bacula database... ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Creation of bacula database failed. Creating bacula tables... ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Creation of Bacula MySQL tables failed. When installing Bacula-mysql on Bacula server, installer tries to create Bacula user and database on MySQL, but those are failed becasue MySQL's root user's password is not empty, so it's neccessary to create database for Bacula on MySQL manually. Create Database for Bacula into MySQL. [root@smsgw i386 ~]#vi /usr/lib/bacula/grant_mysql_privileges if $bindir/mysql $* -u root -p <<END-OF-DATA [root@smsgw i386 ~]#vi /usr/lib/bacula/create_mysql_database if $bindir/mysql $* -p <<END-OF-DATA [root@smsgw i386 ~]#vi /usr/lib64/bacula/make_mysql_tables if $bindir/mysql $* -p <<END-OF-DATA [root@smsgw i386 ~]#/usr/lib/bacula/grant_mysql_privileges Enter password:****** Privileges for bacula granted on bacula. [root@smsgw i386 ~]#/usr/lib/bacula/create_mysql_database Enter password:****** Creation of bacula database succeeded. [root@smsgw i386 ~]#/usr/lib/bacula/make_mysql_tables Enter password:****** Creation of Bacula MySQL tables succeeded. [root@smsgw i386 ~]#mysql -u root -p # login MySQL Enter password:****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 50

Server version: 5.0.45 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. # set bacula's password mysql>set password for bacula=password('******'); Query OK, 0 rows affected (0.00 sec) mysql>set password for bacula@localhost=password('******'); Query OK, 0 rows affected (0.00 sec) # verify settings mysql>select user,host,password from mysql.user;

mysql> show databases;

mysql> use bacula; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed

mysql>show tables;

mysql>exit Bye Configure Director daemon and Storage daemon on bacula server. Configure Director daemon. # replace because comments are so many [root@smsgw i386 ~]#mv /etc/bacula/bacula-dir.conf /etc/bacula/bacula-dir.conf.bk [root@smsgw i386 ~]#grep '^[^#]' /etc/bacula/bacula-dir.conf.bk > /etc/bacula/bacula-dir.conf [root@smsgw i386 ~]#chmod 600 /etc/bacula/bacula-dir.conf [root@smsgw i386 ~]#vi /etc/bacula/bacula-dir.conf Director { Name = dlp-dir

DIRport = 9101 QueryFile = "/usr/lib64/bacula/query.sql" WorkingDirectory = "/var/lib/bacula" PidDirectory = "/var/run" Maximum Concurrent Jobs = 1 # line 8: specify password Password = "******" Messages = Daemon } Job { Name = "RestoreFiles" Type = Restore Client=dlp-fd FileSet="Full Set" Storage = File Pool = Default Messages = Standard # line 53: specify directory that has restore files Where = /var/restores } FileSet { Name = "Full Set" Include { Options { signature = MD5 # line 60: add Compression = GZIP } # line 62: specify objective directory for backup on client File = /home } Client { Name = dlp-fd

# line 92: specify IP address of client Address = 192.168.1.8 FDPort = 9102 Catalog = MyCatalog # line 95: specify password Password = "******" File Retention = 30 days Job Retention = 6 months AutoPrune = yes } Storage { Name = File # line 102: Bacula server's IP address Address = 192.168.0.8 SDPort = 9103 # line 104: specify password Password = "******" Device = FileStorage Media Type = File } Catalog { Name = MyCatalog # line 110: bacula's password on MySQL dbname = "bacula"; dbuser = "bacula"; dbpassword = " ******" } Pool { Name = Default Pool Type = Backup Recycle = yes AutoPrune = yes # line 134: specify terms of keeping volumes

Volume Retention = 180 days } [root@smsgw i386 ~]#/etc/rc.d/init.d/bacula-dir start Starting Bacula Director services: [ OK ]

[root@smsgw i386 ~]#chkconfig level 235 bacula-dir on

[2] Configure Storage daemon # replace because comments are many [root@smsgw i386 ~]#mv /etc/bacula/bacula-sd.conf /etc/bacula/bacula-sd.conf.bk [root@smsgw i386 ~]#grep '^[^#]' /etc/bacula/bacula-sd.conf.bk > /etc/bacula/bacula-sd.conf [root@smsgw i386 ~]#chmod 600 /etc/bacula/bacula-sd.conf [root@smsgw i386 ~]#vi /etc/bacula/bacula-sd.conf Director { Name = dlp-dir # line 10: specify password Password = "******" } Director { Name = dlp-mon # line 14: specify password Password = "******" Monitor = yes } Device { Name = FileStorage Media Type = File # line 20: specify file that is used as a storage for backup Archive Device = /var/backup/backup LabelMedia = yes;

Random Access = Yes; AutomaticMount = yes; RemovableMedia = no; AlwaysOpen = no; } [root@smsgw i386 ~]#mkdir /var/backup [root@smsgw i386 ~]#touch /var/backup/backup [root@smsgw i386 ~]#chown -R bacula. /var/backup [root@smsgw i386 ~]#chmod 660 /var/backup/backup [root@smsgw i386 ~]#/etc/rc.d/init.d/bacula-sd start Starting Bacula Storage services: [ OK ]

[root@smsgw i386 ~]#chkconfig level 235 bacula-sd on [3] Configure bconsole [root@smsgw i386 ~]#vi /etc/bacula/bconsole.conf Director { Name = dlp-dir DIRport = 9101 # line 8: specify Director daemon's IP address address = 127.0.0.1 # line 9: specify password Password = "******"

******************************************************************************

New VM Machine Installation CentOS Configuration of Client Side for Backup Configure File daemon on client that is backup object.

login as: root [email protected]'s password: Last login: Tue Feb 1 19:17:57 2011 [root@bacula ~]# yum -y install mysql Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.01link.hk * updates: centos.01link.hk * addons: centos.aol.in * extras: centos.aol.in Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package mysql.i386 0:5.0.77-4.el5_5.4 set to be updated --> Processing Dependency: mysql = 5.0.45-7.el5 for package: mysql-server --> Running transaction check ---> Package mysql-server.i386 0:5.0.77-4.el5_5.4 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================== ============================== Package Arch Version Repository Size ================================================== ============================== Updating: mysql i386 5.0.77-4.el5_5.4 updates 4.8 M mysql-server i386 5.0.77-4.el5_5.4 updates 9.8 M Transaction Summary ================================================== ============================== Install 0 Package(s) Update 2 Package(s) Remove 0 Package(s) Total download size: 15 M Downloading Packages:

(1/2): mysql-5.0.77-4.el5_5.4.i386.rpm | 4.8 MB 00:10 (2/2): mysql-server-5.0.77-4.el5_5.4.i386.rpm | 9.8 MB 00:22 ----------------------------------------------------------------------------------------------------------------------------Total 448 kB/s | 15 MB 00:33 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897 Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <[email protected]>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : mysql [1/4] Updating : mysql-server [2/4] Cleanup : mysql-server [3/4] Cleanup : mysql [4/4] Updated: mysql.i386 0:5.0.77-4.el5_5.4 mysql-server.i386 0:5.0.77-4.el5_5.4 Complete! [root@bacula ~]# [root@bacula ~]# [root@bacula ~]#

You might also like