Professional Documents
Culture Documents
Bacula
Bacula
send the verification of datas from any systems in any location across the network.
Start MySQL service and create root password for mysql. Note: In this tutorial, i am using password as centos wherever i need to setup password . Define your own.
[root@server ~]# /etc/init.d/mysqld start [root@server ~]# chkconfig mysqld on [root@server ~]# mysqladmin -u root password centos
Next run the following commands one by one to create necessary tables for bacula. Here -u root means that login with root account and -p means prompt for mysql password i.ecentos in this case.
[root@server ~]# /usr/libexec/bacula/grant_mysql_privileges -u root -p [root@server ~]# /usr/libexec/bacula/create_mysql_database -u root -p [root@server ~]# /usr/libexec/bacula/make_mysql_tables -u root -p [root@server ~]# /usr/libexec/bacula/grant_bacula_privileges -u root -p
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> UPDATE mysql.user SET password=PASSWORD("centos") WHERE user='bacula'; Query OK, 2 rows affected (0.01 sec) Rows matched: 2 Changed: 2 Warnings: 0
mysql> quit
Now update all the configuration files with new password and addresses as shown below.
QueryFile = "/usr/libexec/bacula/query.sql" WorkingDirectory = "/var/spool/bacula" PidDirectory = "/var/run" Maximum Concurrent Jobs = 1 Password = "centos" Messages = Daemon # Console password
# Client (File Services) to backup Client { Name = bacula-fd Address = backup.unixmen.local FDPort = 9102 Catalog = MyCatalog Password = "centos" # password for FileDaemon
# Definition of file storage device Storage { Name = File # Do not use "localhost" here Address = backup.unixmen.local SDPort = 9103 Password = "centos" Device = FileStorage Media Type = File } # N.B. Use a fully qualified name here
# Generic catalog service Catalog { Name = MyCatalog # Uncomment the following line if you want the dbi driver # dbdriver = "dbi:sqlite3"; dbaddress = 127.0.0.1; dbport = dbname = "bacula"; dbuser = "bacula"; dbpassword = "centos" }
[root@server ~]# vi /etc/bacula/bconsole.conf Director { Name = bacula-dir DIRport = 9101 address = localhost Password = "centos" }
##Delete the following lines (Do not uncomment). As i installed centos minimal server, i don't have a GUI mode, so that i deleted the following section## # Restricted Director, used by tray-monitor to get the # status of the storage daemon # Director { Name = bacula-mon Password = "@@MON_SD_PASSWORD@@" Monitor = yes } Device { Name = FileStorage Media Type = File Archive Device = /mybackup LabelMedia = yes; Random Access = Yes; AutomaticMount = yes; RemovableMedia = no; AlwaysOpen = no; }
##Delete (do not uncomment) these lines if you only using CUI mode in Backup server ## # Restricted Director, used by tray-monitor to get the # status of the storage daemon # Director { Name = bacula-mon Password = "@@MON_SD_PASSWORD@@" Monitor = yes }
As i mentioned in the above configuration that my archive data path is /mybackup. So lets create a directory called mybackup.
[root@server ~]# mkdir /mybackup [root@server ~]# chown bacula /mybackup
Now we finished all passwords and address modifications. Next restart all bacula daemons.
[root@server ~]# /etc/init.d/bacula-dir start Starting bacula-dir: [root@server ~]# /etc/init.d/bacula-fd start Starting bacula-fd: [root@server ~]# /etc/init.d/bacula-sd start Starting bacula-sd: [root@server ~]# chkconfig bacula-dir on [root@server ~]# chkconfig bacula-fd on [root@server ~]# chkconfig bacula-sd on [ OK ] [ OK ] [ OK ]
Bacula is running successfully now. You can now add clients, jobs and volumes by updating the bacula config files. Alternatively you can use webmin for this purpose. It is quite easy then updating the config files manually.
[root@server ~]# rpm -ivh webmin-1.620-1.noarch.rpm [root@server ~]# /etc/init.d/webmin start [root@server ~]# chkconfig webmin on
Now you can login through webmin by //http://server-ip-address or server-domain-name:10000/. If you want to access the bacula server through webmin, allow the webmin port 10000 and bacula ports 9101, 9102, 9103 through your firewall or router. Add these following lines in your iptables config file.
[root@server ~]# vi /etc/sysconfig/iptables -A INPUT -p udp -m state --state NEW --dport 10000 -j ACCEPT -A INPUT -p tcp -m state --state NEW --dport 10000 -j ACCEPT -A INPUT -p udp -m state --state NEW --dport 9101 -j ACCEPT -A INPUT -p tcp -m state --state NEW --dport 9101 -j ACCEPT -A INPUT -p udp -m state --state NEW --dport 9102 -j ACCEPT -A INPUT -p tcp -m state --state NEW --dport 9102 -j ACCEPT -A INPUT -p udp -m state --state NEW --dport 9103 -j ACCEPT -A INPUT -p tcp -m state --state NEW --dport 9103 -j ACCEPT
Restart iptables.
[root@server ~]# service iptables restart
Thats it. Now you can maintain and configure your Bacula server using webmin. Then you will find the bacula module is up and running. Login to webmin using your root user and its password.
You will find the Bacula Backup System in the left pane of webmin console under System -> Bacula Backup System. If not is found there, try in the unused modules section.
Click on the Bacula Backup System tab. Initially the Bacula server doesnt get started. To get started Bacula server click on Module Configuration section on the right of the Bacula Backup System page. Now enter the bacula user password and select the database i.e MySQL in this case. Then click save. Now you will get the window like shown below.
From here you can add Backup clients, Volumes and schedule jobs etc.