Saturday, January 28, 2012

Add a new bacula client

To add a new client to bacula you have to let the director know the new client first. Go into the bacula configuration directory and add the client to the client resource: 

# cd /opt/bacula/latest/etc
# vi common/client.conf
Client {
  Name = dc01-fd
  Address = dc01
  FDPort = 9102
  Catalog = MyCatalog
  Password = "3DaL1f6SxjlcVzxyURu+Q+IJNvcpG3y1vqwsItCWW8Cd"
  File Retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes

Of course you need a job for the new client, otherwise you wouldn't want to add the new client:

# vi common/jobs.conf
Job {
  Name = "dc01_etc"
  Type = Backup
  Client = dc01-fd
  Schedule = "etc"
  Storage = DDS-3-01
  Pool = etc
  Messages = Standard
  Priority = 10
  Level = Full

Next add the client itself. First you need the software (I assume you have still the sources). Extract the source package and change into the new directory containing the sources. Then run the configure script with --enable-client-only option. This will build the file daemon only:

# ./configure --prefix=/opt/bacula/5.2.3 --enable-client-only
# make
# make install

After the installation finished, change into bacula configuration directory and remove all the sample configuration. You don't need it here:

# cd /opt/bacula/latest/etc
# rm -rf *

Then create your own bacula file daemon configuration:

# vi bacula-fd.conf
Director {
  Name = bck01-dir
  Password = "3DaL1f6SxjlcVzxyURu+Q+IJNvcpG3y1vqwsItCWW8Cd"

Messages {
  Name = Standard
  director = bck01-dir = all, !skipped, !restored

FileDaemon {
  Name = dc01-fd
  FDport = 9102
  WorkingDirectory = /opt/bacula/5.2.3/var/bacula/working
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20

Finally start the client:

# /opt/bacula/latest/sbin/bacula-fd -c /opt/bacula/latest/etc/bacula-fd.conf

Check that the file daemon is running:

# pgrep -fl bacula
1526 /opt/bacula/latest/sbin/bacula-fd -c /opt/bacula/latest/etc/bacula-fd.conf

Then go back to the server which is running the director and restart the bacula director:

# kill -15 `pgrep bacula-dir`
# /opt/bacula/latest/sbin/bacula-dir -c /opt/bacula/latest/etc/bacula-dir.conf

Finally start bconsole and try to run a backup job for the new client:

Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
A job name must be specified.
The defined Job resources are:
     1: BackupCatalog
     2: bck01_etc
     3: dc01_etc
     4: RestoreFiles
Select Job resource (1-4): 3
Run Backup job
JobName:  dc01_etc
Level:    Full
Client:   dc01-fd
FileSet:  etc
Pool:     etc (From Job resource)
Storage:  DDS-3-01 (From Job resource)
When:     2012-01-28 10:33:49
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=22
28-Jan 10:34 bck01-dir JobId 22: Start Backup JobId 22, Job=dc01_etc.2012-01-28_10.33.59_10
28-Jan 10:34 bck01-dir JobId 22: Using Device "DDS-3-01"

1 comment:

  1. Buenos días, te hago una consulta, tengo Bacula sobre ubuntu server 12.04, me restaura todo ok al hacer los pasos de restauración, pero no veo carpetas restauradas en la ruta que le indiqué en el “where”, y así y todo me llega el mail avisandome que el restore se realizó correctamente, sabes a que puede deberse?