Bacula did install using this as a reference point follow along (the prompts have been omitted) as your reading this:
http://www.unixmen.com/install-and-configure-bacula-server-in-centos-6-4-rhel-6-4/
I had a lot of modification due using the remi repo,tons of dependency issues,it was asking for the MySql-Devel package which needed the MySql-Server 5.1.73-3.el6_5.i686 i am on x86_64(strange) installed, as a workaround I uninstalled My-Sql Client and MySql-Libs then installed Percona Server which allowed me to install the My-SQL-Devel package after and continue to the finish. It is stable alongside NethServer I have interface via Webmin, and i am working to use Bacula-Web as the GUI as I feel this could intergrate well with the NethServer Distro. The install documentation is translated over and missing files so this will take a bit, for now Bacula is able to be used via Webmin for GUI. This not for the faint of heart, to develop this package into this distro will take a lot of work, at this point, yes it is powerful, and you can backup to Tape,DVD,and Hard Drive Arrays, but the bugs would need to get worked out to become a viable solution.I will keep at it and keep installing material to test for stability.
Here are the things I did to get Bacula installed, this is only working on the backside right now on Webmin, and will be implemented into NethServer in the future.
This was the reference point:
http://www.unixmen.com/install-and-configure-bacula-server-in-centos-6-4-rhel-6-4/
Please note the following:
f you have a older Red Hat Linux system running the 2.4.x kernel and you have the directory /lib/tls installed on your system (normally by default), bacula will NOT run. This is the new pthreads library and it is defective. You must remove this directory prior to running Bacula, or you can simply change the name to /lib/tls-broken) then you must reboot your machine (one of the few times Linux must be rebooted). If you are not able to remove/rename /lib/tls, an alternative is to set the environment variable “LD_ASSUME_KERNEL=2.4.19″ prior to executing Bacula. For this option, you do not need to reboot, and all programs other than Bacula will continue to use /lib/tls. The above mentioned /lib/tls problem does not occur with Linux 2.6 kernels.
to check your running kernel:
Type at the #uname -r
When u start the first line:
yum install bacula-director-mysql bacula-console bacula-client bacula-storage-mysql my-sql server mysql-devel
If you are on x86-64: The following may occur if you have remi as a repository, or EPEL
my install showed i needed a few dependencies, which included my-sql server and my-sql-dev the problem is if you are on x86-64 it asks for the i686 version file mysql 5.1.73-3.el6_5 this gets to be a huge issue as you cannot install it from your repository, on my machine it did not allow it, yours it may, you need the mysql-server and mysql-devel files installed. I had to resolve the dependency by uninstalling mysql-client and mysql-libs and i installed Percona-Server 5.5
located here:
http://blogs.reliablepenguin.com/2015/01/24/install-percona-server-5-5-centos-6-5
This mainly occurred since i had remi for my repository after that i installed the packages one by one to make sure there were no dependency issues:
yum install bacula-director-mysql bacula-console bacula-client bacula-storage-mysql my-sql server mysql-devel
ie: yum install bacula-director-mysql
yum install bacula-console
Next it asks to start service mysqld start,chkconfig, set password…this should be already installed
service mysqld start
chkconfig mysqld on
mysqladmin -u root password centos
Next create database for bacula,and tables if you have your own password it will prompt for it, if not in NethServer look for the password in /etc/my.pwd using vi (already installed) or nano, I prefer nano, so at the prompt to install nano,
yum install nano
This creates the database and tables:
/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 -
it will then prompt you to set bacula password
mysql -u root -p
this enters into mysql
if this does not work check to make sure the service is on
type:
service mysql start
if you cannot get in still use at the prompt
mysql -p
you should see this:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 67
Server version: 5.5.35 MySQL Community Server (GPL) by Remi
Copyright © 2000, 2013, 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.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
Pay attention to this line which you will enter in: do not use the password that is current as it will leave you vulnerable to an attack choose a strong password and write it down nearby:
mysql> UPDATE mysql.user SET password=PASSWORD(“centos”) WHERE user=‘bacula’;
after that:
FLUSH PRIVILEGES;
EXIT;
your done with MySQL now continue on:
Next
Update Bacula Director
Edit file /etc/bacula/bacula-dir.conf,
You can use vi or nano
cd /etc/bacula/
vi bacula-dir.conf
OR
nano bacula-dir.conf
Take warning of the following:
1.The Password line uses the password you wrote down
2.IP Address uses the local machine the Primary IP connected to NethServer
[…]
Director { # define myself
Name = bacula-dir
DIRport = 9101 # where we listen for UA connections
QueryFile = “/usr/libexec/bacula/query.sql”
WorkingDirectory = “/var/spool/bacula”
PidDirectory = “/var/run”
Maximum Concurrent Jobs = 1
Password = “centos” # Console password
Messages = Daemon
[…]
Client (File Services) to backup
Client {
Name = bacula-fd
Address = 192.168.1.101
FDPort = 9102
Catalog = MyCatalog
Password = “centos” # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}
[…]
Definition of file storage device
Storage {
Name = File
Do not use “localhost” here
Address = 192.168.1.101 # N.B. Use a fully qualified name here
SDPort = 9103
Password = “centos”
Device = FileStorage
Media Type = File
}
[…]
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”
}
[…]
Console {
Name = bacula-mon
Password = “centos”
CommandACL = status, .status
}
Save the script
After you finish that, continue on to
Update Storage Daemon
Edit file: /etc/bacula/bacula-sd.conf,
Use Vi or nano editor
vi /etc/bacula/bacula-sd.conf
or
nano /etc/bacula/bacula-sd.conf
you should see:
The following applies:
- Use the password again that you wrote down where password lines apply
- The Archive device line you can use what is listed or use any directory you please.I kept it the same for simplicity I can change it later on.
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##
[…]
Director {
Name = bacula-dir
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; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}
[…]
save the script
Continue on:
Update file daemon
Edit file /etc/bacula/bacula-fd.conf,
Use nano or vi editor:
vi /etc/bacula/bacula-fd.conf
you should see:
This applies here:
- Use the password you wrote down in the password fields.
List Directors who are permitted to contact this File daemon
Director {
Name = bacula-dir
Password = “centos”
}
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
}
Save the script
Continue on
Create a directory as shown or whatever you used as your backup directory,run Chown as showen
As i mentioned in the above configuration, my archive device path is “/mybackup”. So let me create a directory called “mybackup”.
mkdir /mybackup
chown bacula /mybackup
Now follow this:
Now we finished all passwords and address modifications. Next restart all bacula daemons and make them to start automatically on every 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
Bacula has been successfully installed and configured. You can now add clients, jobs and volumes by updating the bacula config files. Alternatively you can use webmin to make the work more simple. It is quite easier then updating the config files manually.
Webmin install if you choose:check for latest version on the webmin site located at:
http://www.webmin.com/download.html
use wget to link your version for download, on their website find the download and hover over it and right-click and copy link address
then at your command prompt
wget right click paste the link from their website
wget http://sourceforge.net/projects/webadmin/files/webmin/1.660/webmin-1.660-1.noarch.rpm
Substitute what version you downloaded from the website using wget modify the .rpm to match
follow the remaining lines for Service, Chkconfig
rpm -Uvh webmin-1.660-1.noarch.rpm
service webmin start
chkconfig webmin on
Moving on:
Adjust Firewall/Router using iptables:
iptables is located at /etc/sysconfig/
nano or vi iptables
nano iptables
add these lines
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9101 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9102 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9103 -j ACCEPT
Then:save script
Restart iptables at the command prompt:
service iptables restart
Access Webmin
Now you can login through webmin by “//http://server-ip-address:10000″ or “http://domain-name:10000/”.
You should be all set for bacula on webmin for now I am working on Bacula-Web for intergration into NethServer at this time.
Further instructions should follow:
Note: If you have problems with Webmin check that webmin is started
at the prompt:
service webmin start
if you still have issues rpc may be blocking it, i had to move my webmin to 10001
I can assist you if that should happen
Note:If you have trouble updating after using Percona Server
do this at the prompt:
cd /etc/yum.repos.d/
nano or vi
nano percona-release.repo
Set all lines under repositories to
enabled=0
Yum remove Percona-Server-Client55
then
Yum install mysql-devel
and you should be good to go!
Watch uninstalling Percona-Server as it can cause you to loose mysql and the tables you created for bacula, it just happened to me all for one file, which you could not get to…MySQL-Devel which you need to install Percona-Server to get and its dependencies,this package broke my yum update i removed it and lost mysql in the process and installed it back on, now you might need to rebuild the tables to bacula to get it to run once more. This is a awful bug on NethServer, or CentOs as it does not allow you to install the i686 mysql and its dependencies you need to run around the “block” to correct it… as shown. I am rebuilding the tables and will report back if it is completely stable.
I have reninstalled Mysql as shown and am recreating the tables now, most of the files were intact this just needed to be redone:
Had to redo:
Now set bacula user password on MySQL. To do that, log in to your MySQL server with command:
mysql -u root -p
Or mysql -p
Your password for mysql should still be there… mine was…
And set password as shown below:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 67
Server version: 5.5.35 MySQL Community Server (GPL) by Remi
Copyright © 2000, 2013, 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.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
Reconfigured:
mkdir /mybackup
chown bacula /mybackup
Then finally
service bacula-dir start
service bacula-fd start
service bacula-sd start
chkconfig bacula-dir on
chkconfig bacula-fd on
chkconfig bacula-sd on
Backup and running !!
Phil