Home Cloud & Networking Networking Getting started with Bacula

Getting started with Bacula

0
1982
3 min read

(For more resources related to this topic, see here.)

Getting ready

You will need root access to a BSD or Linux machine where you will be installing the Bacula server. This article is using Debian Linux 6.0 as an example. The machine is assumed to have an IP address of 10.10.1.100.

How to do it…

Learn Programming & Development with a Packt Subscription

To install Bacula Director and Bacula Storage, perform the following steps:

  1. Log in to the target machine using SSH client or a physical console.

  2. Install the Bacula Director and Bacula Storage daemons plus the bconsole utility, using the package manager of your choice as follows (this example uses APT):

    $ apt-get install bacula-director-sqlite bacula-sd-sqlite baculaconsole

  3. Now, replace the contents of the /etc/bacula/bacula-dir.conf file with the following code:

    Director { Name = debian-dir DIRport = 9101 QueryFile = "/etc/bacula/scripts/query.sql" WorkingDirectory = "/var/lib/bacula" PidDirectory = "/var/run/bacula" Maximum Concurrent Jobs = 1 Password = "password-dir" DirAddress = 10.10.1.100 } Storage { Name = LocalStorage Address = 10.10.1.100 SDPort = 9103 Password = "password-sd" Device = FileStorage Media Type = File } Job { Name = DefaultJob Type = Backup Messages = Standard Pool = Default Client = DefaultClient Fileset = DefaultFileset Storage = LocalStorage } Client { Name = DefaultClient Address = 10.10.1.100 Password = "" Catalog = DefaultCatalog } Fileset { Name = DefaultFileset } Catalog { Name = DefaultCatalog dbname = "bacula"; dbuser = ""; dbpassword = "" }

    The highlighted lines contain information you might want to alter, such as passwords and network addresses.

  4. Replace the bacula-sd.conf file with a new one that has the following code:

    Storage { Name = LocalStorage SDPort = 9103 WorkingDirectory = "/var/lib/bacula" Pid Directory = "/var/run/bacula" Maximum Concurrent Jobs = 20 SDAddress = 10.10.1.100 } Director { Name = debian-dir Password = "password-sd" } Device { Name = FileStorage Media Type = File Archive Device = /tmp/test-backups LabelMedia = yes; Random Access = Yes; AutomaticMount = yes; RemovableMedia = no; AlwaysOpen = no; } Messages { Name = Standard director = debian-dir = all }

  5. And finally, the bconsole.conf file would look as follows:

    Director { Name = localhost-dir DIRport = 9101 address = 10.10.1.100 Password = "password-dir" }

    Note that appropriate passwords should match in both files.

  6. Now restart the daemons as follows so the new configuration is applied:

    $ /etc/init.d/bacula-director restart $ /etc/init.d/bacula-sd restart

  7. Create a directory for backup storage mentioned in the bacula-sd.conf file as follows:

    $ mkdir /tmp/test-backups

    Now you should be able to use the bconsole utility to inspect the status of Director and Storage using the status director and status storage commands as follows:

    $ bconsole Connecting to Director 10.10.1.100:9101 1000 OK: debian-dir Version: 5.0.2 (28 April 2010) Enter a period to cancel a command. *status director debian-dir Version: 5.0.2 (28 April 2010) i486-pc-linux-gnu debian squeeze/sid Daemon started 07-Jun-12 13:54, 0 Jobs run since started. Heap: heap=245,760 smbytes=48,038 max_bytes=48,940 bufs=109 max_ bufs=119 No Scheduled Jobs. ==== Running Jobs: No Jobs running. ==== *status storage Automatically selected Storage: LocalStorage Connecting to Storage daemon LocalStorage at 10.10.1.100:9103 LocalStorage Version: 5.0.2 ... Running Jobs: No Jobs running. Device status: Device "FileStorage" (/tmp/test-backups) is not open. *

How it works…

A typical Bacula system consists of three independently running daemons:

  • Storage daemon (SD): This daemon receives backups from Director and stores them into the storage (files or tapes)

  • File daemon (FD): This daemon collects the files from client machines and sends them to the Director

  • Director daemon: This daemon performs job scheduling and negotiates data transfers between Storage and File daemons

In this setup, we installed Director and Storage daemons on the same machine and configured a file-based storage at /tmp/test-backups in our filesystem.

The bconsole utility is used to connect to the Director daemon, pass commands to it, and receive messages from it. When we requested the status of Storage with the status storage command, Director forwarded the request to Storage. Therefore, it’s only important to have a direct connection from console to Director.

Replace the sample passwords of Director, Storage and the bconsole utility. Each component can reside on a separate machine as long as connectivity between them is possible. Don’t forget to always use fully qualified domain names or non-local IP addresses when specifying remote components.

Summary

In this article we learned to set up the simplest Bacula Director and Bacula Storage installations using the Bacula’s bconsole utility.

Resources for Article :


Further resources on this subject:


NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here