Saturday, November 28, 2015

Bacula Installation (RHEL 6)




Installation steps:

1. Get the EPEL repository and install it.

2. Register the system and select the “server optional” channel.

3. Install the packages:
# yum install mysql-devel mysql-server
# yum install bacula-storage-mysql
# yum install bacula-director-mysql bacula-console
# yum install bacula-client
# yum install bacula-traymonitor

4. Start the mysql service:
# service mysqld start
# chkconfig mysqld on

5.
Now create your root password:
# mysqladmin -u root password NEWPASSWORD

6. Now you need to run the scripts provided to you by Bacula that will create all your tables:
# /usr/libexec/bacula/grant_mysql_privileges -u root -p
# /usr/libexec/bacula/create_mysql_database -u root -p
# /usr/libexec/bacula/make_mysql_tables -u root -p
# /usr/libexec/bacula/grant_bacula_privileges -u root –p

7. Change the bacula user password:
# mysql -u root -p
mysql> UPDATE mysql.user SET password=PASSWORD ('yOuRPassWordinbetweenHere') WHERE user='bacula';
mysql> FLUSH PRIVILEGES;
mysql> quit

8. The Director config file:
# vim /etc/bacula/bacula-dir.conf

Director {                            # define myself
  Name = bacula-dir
  DIRport = 9101
  QueryFile = "/usr/libexec/bacula/query.sql"
  WorkingDirectory = /var/spool/bacula
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "centos"         # Console password
  Messages = Daemon
}

Client {
  Name = bacula-fd
  Address = bacula.example.com
  FDPort = 9102
  Catalog = MyCatalog
  Password = centos
  File Retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes
}

Storage {
  Name = File
# Do not use "localhost" here
  Address = bacula.example.com                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "centos"
  Device = FileStorage
  Media Type = File
}

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"
}

Console {
  Name = bacula-mon
  Password = "centos"
  CommandACL = status, .status
}

9. The Console config file:
# vim /etc/bacula/bconsole.conf
Make changes to the password & address.

Director {
  Name = bacula-dir
  DIRport = 9101
  Address = localhost
  Password = "centos"
}

10. The Storage Daemon config file:
# vim /etc/bacula/bacula-sd.conf

Director {
  Name = bacula-dir
  Password = "centos"
}

Director {
  Name = bacula-mon
  Password = "centos"
  Monitor = yes
}

Device {
  Name = FileStorage
  Media Type = File
  Archive Device = /backup
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}


11. The File Daemon config file:
# vim /etc/bacula/bacula-fd.conf

Director {
  Name = bacula-dir
  Password = "centos"
}

Director {
  Name = bacula-mon
  Password = "centos"
  Monitor = yes
}

12. We have earlier defined that the storage daemon that the Archive Device was “/backup”. We now need to create /backup and change ownership to Bacula so that it can write there.
# mkdir /backup
# chown bacula /backup

13. Bacula have now installed. Now it’s time to start the service and also make sure bacula services start up automatically on reboot.
# service bacula-dir start
# service bacula-fd start
# service bacula-sd start
# chkconfig bacula-dir on
# chkconfig bacula-fd on
# chkconfig bacula-sd on

14. The install of Webmin is fairly straightforward.

14.1 Add the Webmin repo. You can do this with the following command;
# cat /etc/yum.repos.d/webmin.repo
[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

14.2 Import the GPG key:
# wget http://www.webmin.com/jcameron-key.asc
# rpm --import http://www.webmin.com/jcameron-key.asc

14.3 Install webmin:
# yum install webmin

14.4 Go to http://<your_server>:10000


1 comment:

  1. I was more than happy to discover this website. I want to to thank you for your time just for this wonderful read!!

    I definitely really liked every part of it and I have you
    saved as a favorite to check out new things in your website.

    ReplyDelete