You are on page 1of 9

================================================ ------ Bacula Installation By

Kamran Ayub -----================================================ Step-1): Give


hostname to backup server: ---------------------------------------# vi
/etc/sysconfig/network e.g backups.abc.net.pk

# vi /etc/hosts e.g x.x.x.x backups.abc.net.pk backups

Step-2): Update Backup server name in required DNS servers:


----------------------------------------------------------e.g ns.abc.net.pk
ns1.abc.net.pk Step-3): Install depended packages:
----------------------------------# # # # yum yum yum yum install install install
install gcc gcc-c++ mysql-devel mysql-server iptables

Step-4): Download Bacula package: --------------------------------# mkdir /packages


# cd /packages # wget
http://citylan.dl.sourceforge.net/project/bacula/bacula/5.0.3/bacula -5.0.3.tar.gz
# tar -zvxf bacula-5.0.3.tar.gz # cd bacula-5.0.3 Step-5): Configure and install
Bacula Server: --------------------------------------------# ./configure --with-
mysql OUTPUT ----------------------------------------Configuration on Tue Sep 7
11:31:15 PKT 2010: Host: Bacula version: Source code location: Install binaries:
Install libraries: Install config files: Scripts directory: Archive directory:
Working directory: PID directory: Subsys directory: x86_64-unknown-linux-gnu --
redhat Bacula 5.0.3 (04 August 2010) . /sbin /usr/lib64 /etc/bacula /etc/bacula
/tmp /var/bacula/working /var/run /var/lock/subsys
Man directory: Data directory: Plugin directory: C Compiler: C++ Compiler: Compiler
flags: fno-rtti Linker flags: Libraries: Statically Linked Statically Linked
Statically Linked Statically Linked Statically Linked Database type: Database port:
Database lib: Database name: Database user: Job Output Email: Traceback Email: SMTP
Host Address:

${datarootdir}/man /usr/share /usr/lib64 gcc 4.1.2 /usr/bin/g++ 4.1.2 -g -O2 -Wall


-fno-strict-aliasing -fno-exceptions -lpthread -ldl no no no no no MySQL
-L/usr/lib64/mysql -lmysqlclient_r -lz bacula bacula root@localhost root@localhost
localhost 9101 9102 9103

Tools: FD: SD: DIR: CONS:

Director Port: File daemon Port: Storage daemon Port: Director User: Director
Group: Storage Daemon User: Storage DaemonGroup: File Daemon User: File Daemon
Group: SQL binaries Directory

/usr/bin

Large file support: yes Bacula conio support: no readline support: no TCP Wrappers
support: no TLS support: yes Encryption support: yes ZLIB support: yes enable-
smartalloc: yes enable-lockmgr: no bat support: no enable-gnome: no enable-bwx-
console: no enable-tray-monitor: no client-only: no build-dird: yes build-stored:
yes Plugin support: yes AFS support: no ACL support: no XATTR support: yes Python
support: no Batch insert enabled: yes ---------------------------------
# make # make install Step-6): Check mysql service status and start:
---------------------------------------------# service mysqld start OUTPUT:
---------------------[root@backups bacula-5.0.3]# service mysqld start Initializing
MySQL database: Installing MySQL system tables... OK Filling help tables... OK To
start mysqld at boot time you have to copy support-files/mysql.server to the right
place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands: /usr/bin/mysqladmin
-u root password 'new-password' /usr/bin/mysqladmin -u root -h backups.abc.net.pk
password 'new-password' Alternatively you can run:
/usr/bin/mysql_secure_installation which will also give you the option of removing
the test databases and anonymous user created by default. This is strongly
recommended for production servers. See the manual for more instructions. You can
start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the
MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please
report any problems with the /usr/bin/mysqlbug script! The latest information about
MySQL is available on the web at http://www.mysql.com Support MySQL by buying
support/licenses at http://shop.mysql.com [ OK ] Starting MySQL: [ OK ]
------------------------------------# chkconfig --level 235 mysqld on Step-7):
Create bacula database and tables: ------------------------------------------#
cd /etc/bacula # ./create_mysql_database if it gives error for root password using
NO. Then proceed with ./create_mysql_database -u root -p and now it will prompt you
for password.
# ./make_bacula_tables # ./grant_bacula_privileges step-8): Start bacula service:
-----------------------------# # # # /etc/bacula/bacula start /etc/bacula/bacula-
ctl-fd start /etc/bacula/bacula-ctl-sd start /etc/bacula/bacula-ctl-dir start

Step-9): Check bacula configuration file: ----------------------------------------#


bacula-dir -t -c bacula-dir.conf Setp-9): configure label of backup files via
./bconsole: ------------------------------------------------------# cd /etc/bacula
# ./bconsole *label Automatically selected Catalog: MyCatalog Using Catalog
"MyCatalog" Automatically selected Storage: File Enter new Volume name: NTL1:
Default 2: File 3: Scratch select option: 1 bel * exit Step-10): configure
autostartup of bacula service at machine startup:
--------------------------------------------------------------------# vi
/etc/rc.local /etc/bacula/bacula start /etc/bacula/bacula-ctl-fd start
/etc/bacula/bacula-ctl-sd start /etc/bacula/bacula-ctl-dir start :wq Step-11):
Create iptables rule in bacula Server:
------------------------------------------------A RH-Firewall-1-INPUT -m state
--state NEW -m tcp -p tcp -s x.x.x.x/32 --dport 9101 -j ACCEPT -A RH-Firewall-1-
INPUT -m state --state NEW -m tcp -p tcp -s x.x.x.x/32 --dport 9103 -j ACCEPT #
Because we will use default pool defination for la
Setp-12): Define backups storage location as you required:
---------------------------------------------------------# # # # cd / mkdir backups
chown root:root backups chmod 775 backups

[2] # vi /etc/bacula/bacula-sd.conf ====================================

Step-1): Define storage location and maximan backup file size


-------------------------------------------------------------Device { Name =
FileStorage Media Type = File Archive Device = /backups LabelMedia = yes; Random
Access = Yes; AutomaticMount = yes; RemovableMedia = no; AlwaysOpen = no; Maximum
Volume Size = 1GB }

# default location to store the files

# Maximam backup file size

================================================================ ----------- Bacula


configuration for one client:
--------------================================================================

Note: following sets are required per client in bacula-dir.conf: 1-job 2-Fileset 3-
Client For example: we have client with name smtp.abc.net.pk [1]# vi
/etc/bacula/bacula-dir.conf ====================================

step-1): Create JOB-SET for Client: ----------------------------------Job { Name =


"SMTP" Type = Backup Client = smtp-fd # give any job name # give Client file deamon
name as given i
n /etc/bacula/bacula-fd.conf at client end FileSet = "SMTP Set" # give Client file
set name Schedule = "WeeklyCycle" Storage = File Messages = Standard Pool = Default
# give pool name which we will use for la bling Write Bootstrap =
"/var/bacula/working/SMTP.bsr" } Step-2): create FILE-SET for Client:
-----------------------------------FileSet { Name = "SMTP Set" related JOB-SET
Include { Options { signature = MD5 } File = /etc } } Step-3): create CLIENT-SET
for Client: -------------------------------------Client { Name = smtp-fd # give
Client file deamon name as de fine in related JOB-SET Address = smtp.abc.net.pk #
give Client name or IP FDPort = 9102 Catalog = MyCatalog Password =
"CcbrEewg6yCBOW35gnPYZqfWJnQIMpxItfzX2iv6fYU5" File Retention = 30d Job Retention =
90d AutoPrune = yes } Step-4): Define Label in default Pool defination:
------------------------------------------------Pool { Name = Default Pool Type =
Backup Recycle = yes lumes AutoPrune = yes Volume Retention = 365 days Maximum
Volume Jobs = 1 Label Format = "NTL-" hed e.g NTL-001, NTL-002 .. } # Prune expired
volumes # only 1 time this job will run # Automatically this label with attac #
give Client file set name as define in

# define directorie per line for backups

# Bacula can automatically recycle Vo

=============================================================================
----------- Athorization Setting b/w Bacula Server and client ---------------
============================================================================= Step-
1): Now access client Machine # vi /etc/bacula/bacula-fd.conf Rename Name =
smtp.abc.net.pk-dir to Name = backups-dir(this name is belong to b acula director)
and copy Password field value of client director to the server (director) bacula-
dir.conf Client portion . client machine 1st director zone:
--------------------------------Director { Name = backups-dir Password =
"eCFpyM3DJSVVtPWeObGJmgsrXeomEoFAGraAQSpo6gJ5" <---} Server machine Client protion
in bacula-fd.conf: -----------------------------------------------ld same at server
and client Client { Name = smtp-fd Address = smtp.abc.net.pk FDPort = 9102 Catalog
= MyCatalog Password = "eCFpyM3DJSVVtPWeObGJmgsrXeomEoFAGraAQSpo6gJ5" <---File
Retention = 30d # 30 days Job Retention = 180d # six months AutoPrune = yes # Prune
expired Jobs/Files } Step-2): Start the service of bacual at Client:
----------------------------------------------# /etc/bacula/bacula-fd.conf restart
------------------------------------------------------------------------- The En d
-------------------------------------

password shou

Improtant aspects: ========================================================== # To


write each Volume only once (i.e. one Job per Volume or file in this case), use:
UseVolumeOnce = yes.
# To write nnn Jobs to each Volume, use: Maximum Volume Jobs = nnn. # To limit the
maximum size of each Volume, use: Maximum Volume Bytes = mmmm.

You might also like