Bacula: Client

_Backup com Bacula – Primeiro Cliente Linux – 1.9

Entendendo um pouco da estrutura de backup do Bacula.

logo
Configurando o primeiro cliente Linux.
Cenário:
Bacula Servidor: IP: 192.168.0.218 FQDN: ba-vm-bkp-01
Bacula Cliente: IP: 192.168.0.247
1 – No cliente será preciso instalar o bacula-fd.
# apt-get update
# apt-get install bacula-fd
bacula-fd (5.2.6+dfsg-9) ...
OBS: O Cliente não pode ter uma versão superior que a versão do servidor.
Para saber a versão do director, basta executar o comando version no bconsole do servidor Bacula.
2 – Verificando no servidor Bacula a versão do director.
# bconsole 
Connecting to Director localhost:9101
1000 OK: bacula-dir Version: 5.0.0 (26 January 2010)
Enter a period to cancel a command.
*version
bacula-dir Version: 5.0.0 (26 January 2010) x86_64-redhat-linux-gnu redhat  
You have messages.
O Que é preciso configurar?
3 – Após a instalação do bacula-fd será preciso configurar o arquivo bacula-fd.conf
# cd /etc/bacula/
vim bacula-fd.conf
Director {
  Name = debian-client-bacula-dir
  Password = "R0BUWPaLVtZAEsDZxsSzobWxvbY_KD7it"
}
PARA
Director {
  Name = bacula-dir # NOME QUE FOI DEFINIDO NO SERVIDOR BACULA NA TAG director
  Password = "senha-client-debian" # SENHA DO CLIENTE BACULA
}
FileDaemon {                          # this is me
  Name = debian-client-bacula-fd
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /var/lib/bacula
  Pid Directory = /var/run/bacula
  Maximum Concurrent Jobs = 20
  FDAddress = 127.0.0.1
} 
PARA
FileDaemon {                          # this is me
  Name = debian-client-bacula-fd      # NOME DO CLIENTE
  FDport = 9102                  
  WorkingDirectory = /var/lib/bacula
  Pid Directory = /var/run/bacula
  Maximum Concurrent Jobs = 20
# FDAddress = 127.0.0.1
} 
Configurando o servidor Bacula.
# cd /etc/bacula/
# vim bacula-dir.conf
Client {
 Name = debian-client-bacula-fd
 Address = 192.168.0.247 # IP/FQDN DO CLIENTE
 FDPort = 9102
 Catalog = MyCatalog
 Password = "senha-client-debian" # SENHA DO CLIENTE
 File Retention = 30 days # 30 days
 Job Retention = 6 months # six months
 AutoPrune = yes # Prune expired Jobs/Files
}
4 – Reiniciando o bacula-dir do servidor Bacula.
# /etc/init.d/bacula-dir restart
Shutting down bacula-dir:                                  [  OK  ]
Starting bacula-dir:                                       [  OK  ]
5 – Acessando o console do servidor Bacula e verificando o status do client.
# bconsole 
Connecting to Director localhost:9101
1000 OK: bacula-dir Version: 5.0.0 (26 January 2010)
Enter a period to cancel a command.
*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: All
Select daemon type for status (1-4): 3
The defined Client resources are:
     1: bacula-fd
     2: debian-client-bacula-fd
Select Client (File daemon) resource (1-2): 2
Connecting to Client debian-client-bacula-fd at 192.168.0.247:9102

debian-client-bacula-fd Version: 5.2.6 (21 February 2012)  x86_64-pc-linux-gnu debian 7.0
# vim bacula-dir.conf
6 – Configurando um novo job (Job) para o cliente Linux que esta sendo adicionado no servidor Bacula.
#Job {
#  Name = "BackupClient2"
#  Client = bacula2-fd
#  JobDefs = "DefaultJob"
#}
#
PARA
Job {
        Name    = "Backup do cliente Debian"
        Client  = debian-client-bacula-fd
        JobDefs = "DefaultJob"
        FileSet = client_debian_set
}
7 – Configurando um novo fileset (FileSet) para o cliente Linux que esta sendo adicionado no servidor Bacula.
FileSet {
  Name = "client_debian_set"
  Include {
    Options {
      signature = MD5
    }
    File = /etc
    File = /opt
  }

  Exclude {
    File = /.journal
    File = /.fsck
  }
}
8 – Reiniciando o bacula-dir do servidor Bacula.
# /etc/init.d/bacula-dir restart
Shutting down bacula-dir:                                  [  OK  ]
Starting bacula-dir:                                       [  OK  ]
9 – Após o comando bconsole, será executado o comando estimate listing. Este comando tem como função realizar um um teste no job de backup.
*estimate listing
The defined Job resources are:
     1: BackupClient1
     2: Backup do cliente Debian
     3: BackupCatalog
     4: RestoreFiles
Select Job resource (1-4): 2
Using Catalog "MyCatalog"
Connecting to Client debian-client-bacula-fd at 192.168.0.247:9102
-rw-r--r--   1 root     root            2940 2015-04-07 11:56:56  /etc/gai.conf
...
2000 OK estimate files=878 bytes=61,821,452
10 – Realizando o primeiro backup do primeiro cliente Linux.
*run
A job name must be specified.
The defined Job resources are:
     1: BackupClient1
     2: Backup do cliente Debian
     3: BackupCatalog
     4: RestoreFiles
Select Job resource (1-4): 2
Run Backup job
JobName:  Backup do cliente Debian
Level:    Incremental
Client:   debian-client-bacula-fd
FileSet:  client_debian_set
Pool:     File (From Job resource)
Storage:  File (From Job resource)
When:     2015-04-28 15:06:59
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=50
You have messages.
*m
28-Abr 15:07 bacula-dir JobId 50: No prior Full backup Job record found.
28-Abr 15:07 bacula-dir JobId 50: No prior or suitable Full backup found in catalog. Doing FULL backup.
*m
28-Abr 15:07 bacula-dir JobId 50: Start Backup JobId 50, Job=Backup_do_cliente_Debian.2015-04-28_15.07.04_03
28-Abr 15:07 bacula-dir JobId 50: Using Device "FileStorage"
28-Abr 15:07 bacula-sd JobId 50: Volume "primeiro-bkp" previously written, moving to end of data.
28-Abr 15:07 bacula-sd JobId 50: Ready to append to end of Volume "primeiro-bkp" size=355932262
*m
You have no messages.
*m
28-Abr 15:07 bacula-sd JobId 50: Job write elapsed time = 00:00:02, Transfer rate = 30.95 M Bytes/second
28-Abr 15:07 bacula-dir JobId 50: Bacula bacula-dir 5.0.0 (26Jan10): 28-Abr-2015 15:07:08
  Build OS:               x86_64-redhat-linux-gnu redhat 
  JobId:                  50
  Job:                    Backup_do_cliente_Debian.2015-04-28_15.07.04_03
  Backup Level:           Full (upgraded from Incremental)
  Client:                 "debian-client-bacula-fd" 5.2.6 (21Feb12) x86_64-pc-linux-gnu,debian,7.0
  FileSet:                "client_debian_set" 2015-04-28 15:06:01
  Pool:                   "File" (From Job resource)
  Catalog:                "MyCatalog" (From Client resource)
  Storage:                "File" (From Job resource)
  Scheduled time:         28-Abr-2015 15:06:59
  Start time:             28-Abr-2015 15:07:06
  End time:               28-Abr-2015 15:07:08
  Elapsed time:           2 secs
  Priority:               10
  FD Files Written:       878
  SD Files Written:       878
  FD Bytes Written:       61,821,452 (61.82 MB)
  SD Bytes Written:       61,916,956 (61.91 MB)
  Rate:                   30910.7 KB/s
  Software Compression:   None
  VSS:                    no
  Encryption:             no
  Accurate:               no
  Volume name(s):         primeiro-bkp
  Volume Session Id:      3
  Volume Session Time:    1430162560
  Last Volume Bytes:      417,916,716 (417.9 MB)
  Non-fatal FD errors:    0
  SD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Backup OK

28-Abr 15:07 bacula-dir JobId 50: Begin pruning Jobs older than 44 years 10 months 13 days 18 hours 7 mins 8 secs.
28-Abr 15:07 bacula-dir JobId 50: No Jobs found to prune.
28-Abr 15:07 bacula-dir JobId 50: Begin pruning Jobs.
28-Abr 15:07 bacula-dir JobId 50: No Files found to prune.
28-Abr 15:07 bacula-dir JobId 50: End auto prune.
11 – Verificando o status.
*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: All
Select daemon type for status (1-4): 3
The defined Client resources are:
     1: bacula-fd
     2: debian-client-bacula-fd
Select Client (File daemon) resource (1-2): 2
Connecting to Client debian-client-bacula-fd at 192.168.0.247:9102

debian-client-bacula-fd Version: 5.2.6 (21 February 2012)  x86_64-pc-linux-gnu debian 7.0
Daemon started 28-Abr-15 14:49. Jobs: run=1 running=0.
 Heap: heap=487,424 smbytes=95,880 max_bytes=178,965 bufs=69 max_bufs=115
 Sizeof: boffset_t=8 size_t=8 debug=0 trace=0 
Running Jobs:
Director connected at: 28-Abr-15 15:11
No Jobs running.
====

Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name 
======================================================================
    20  Full          1    110.8 K  OK       12-Abr-15 23:10 BackupCatalog
    21  Incr          0         0   OK       13-Abr-15 23:05 BackupClient1
    22  Full          1    117.2 K  OK       13-Abr-15 23:10 BackupCatalog
    23  Incr          0         0   OK       14-Abr-15 23:05 BackupClient1
    24  Full          1    123.6 K  OK       14-Abr-15 23:10 BackupCatalog
    25  Incr          0         0   OK       15-Abr-15 23:05 BackupClient1
    26  Full          1    130.0 K  OK       15-Abr-15 23:10 BackupCatalog
    27  Incr          0         0   OK       27-Abr-15 23:05 BackupClient1
    28  Full          1    136.4 K  OK       27-Abr-15 23:10 BackupCatalog
    50  Full        878    61.82 M  OK       28-Abr-15 15:10 Backup_do_cliente_Debian
====
*
continua …
Fonte:
www.bacula.com.br
www.bacula.org
Close Menu