To create the RPM packages of Bacula 5.0.2 on CentOS5 or RHEL5, perform this steps:

Build Script

For convenience you can download the make_bacula_rpms_centos5_v0.2.tar.gz script attached to this page. It performs all necessary steps described below.

OS, required packages

Do a base install of CentOS5 (i386 or x86_64 supported)

Now add some more packages (as root):

yum install autoconf automake e2fsprogs-devel gcc-c++ glibc-devel glibc-headers krb5-devel libacl-devel libgomp libstdc++-devel libtermcap-devel libxml2-devel m4 make mysql mysql-devel mysql-server ncurses ncurses-devel openssl-devel perl-DBI php qt4 qt4-devel readline-devel redhat-rpm-config rpm-build screen zlib-devel

Additional packages

To build the wxconsole, you must install additional packages. If you do not need wxconsole, you can skip this step. In this case, you must set “build_wxconsole 0” when performing the rpmbuild command (see below). Install the epel repo

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

Install the additional packages:

yum install qwt qwt-devel wxGTK

Setup rpm_build environment

As a regular (non-root) user, setup your private rpm_build environment. Simply copy over the default rpm-build structure:

cp -r /usr/src/redhat ~/rpm_build

Create a .rpmmacros file in your home dir, with at least this content:

      %_topdir    %(echo ${HOME}/rpm_build)
      %_tmppath   %{_topdir}/tmp
      %packager   <Your_Firstname> <Your_LastName> <Your_Email_Address>
      # if you got your own rpm gpg key, add this two lines:
      #%_signature gpg
      #%_gpg_name  <Your_Firstname> <Your_LastName>

Build bacula rpms

Download the bacula .src.rpm files to a directory in the user folder structure (not as root!)

If you want to build the wxconsole (GTK), add –define “build_wxconsole 1”. If you want to build the bconsole (Gnome) version, add –define “build_bconsole 1” instead.

As non-root user, perform the build:

rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wxconsole 1" bacula-5.0.2-1.src.rpm
rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wxconsole 1" bacula-bat-5.0.2-1.src.rpm
rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wxconsole 1" bacula-mtx-5.0.2-1.src.rpm
rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wxconsole 1" bacula-docs-5.0.2-1.src.rpm

Install bacula (Bacula Server)

To install, copy the created rpm files (to be found in rpm_build/RPMS/<architecture> to your server and install using:

      rpm -Uvh bacula-libs-5.0.2-1.<arch>.rpm
      rpm -Uvh bacula-mysql-5.0.2-1.<arch>.rpm
      rpm -Uvh bacula-bat-5.0.2-1.<arch>.rpm
      

U have to change the rights for the library libbac-5.X.Y.so which on a x64 arch is found on:

      /usr/lib64/
      

On a i386 must be on

      /usr/lib/
      

chown bacula:bacula /usr/lib?/libbac-5.0.1.so

If not the system would send u messages to your email account if u have one, u will receive this log:

Dec 3 21:50:03 my-backup bacula-dir: 03-Dec 21:50 Message delivery ERROR: Mail prog: /usr/sbin/bsmtp: error while loading shared libraries: libbac-5.0.1.so: cannot open shared object file: Permission denied

Setup the MySQL Database

Add the bacula user to MySQL. Allow connection from localhost only. (Adding ”%” as the host part might lead to security issues.)

mysql -p

set password for 'bacula'@'localhost' = password ('YourPassword');
quit

Modify the bacula sql scripts

Now you need to edit the bacula sql scripts to allow for a MySQL administrator level password

cd /usr/lib/bacula/
vi grant_mysql_privileges
vi create_mysql_database
vi make_mysql_tables

Note: on x64 arch you will found this on

      /usr/lib64/bacula

Original line:

if $bindir/mysql $* -u root -f <<END-OF-DATA

Modified line:

if $bindir/mysql -p $* -u root -f <<END-OF-DATA

Execute the bacula sql install scripts

WARNING! If you already got a bacula database, you must execute the update scripts NOT this install scripts. Otherwise you corrupt your current bacula database!

cd /usr/lib/bacula/
./grant_mysql_privileges
./create_mysql_database
./make_mysql_tables

Configure bacula

Configure bacula director, file daemon, and storage daemon. Consult the Bacula documentation for this.

Start the services

      service bacula-sd start
      service bacula-dir start
      service bacula-fd start

You should now have a working installation of bacula server.

Install bacula on a client

On a client, you must install the bacula-client rpm package, only and configure the file /etc/bacula/bacula-fd.conf. Normally this means, pointing the daemon to your director and setting the client password.

Then start the fd daemon:

      service bacula-fd start

Enhancements

If you plan for a large bacula installation, it might be better to build the PostgreSQL version of bacula. Please consult the documentation on what rpmbuild settings and packages you need.

This document is based on howto_install_bacula_5.0.0_from_src.rpm_on_rhel_5_or_centos_5 .

howto_install_bacula_5.0.2_from_src.rpm_on_rhel_5_or_centos_5.txt · Last modified: 2010/12/04 20:07 by klabacita
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki