Boa tarde meu bacula estava funcionando
normalmente quando eu reiniciei o servidor de backup aparece o seguinte erro: Obs: Já dei um Drop no postgresql e conferi as senhas.
bacula-dir: dird.c:1015-0 Could not open Catalog "MyCatalog", database "bacula".
bacula-dir: dird.c:1020-0 postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula
Possible causes: SQL server not running; password incorrect; max_connections exceeded.
20-Jan 12:05 bacula-dir ERROR TERMINATION
Please correct configuration file: bacula-dir.conf
rodei o comando bacula-dir -d100 -c /etc/bacula/bacula-dir.conf
bacula-dir -d100 -c /etc/bacula/bacula-dir.conf
bacula-dir: dird.c:223-0 Debug level = 100
bacula-dir: jcr.c:140-0 read_last_jobs seek to 192
bacula-dir: jcr.c:147-0 Read num_items=10
bacula-dir: dir_plugins.c:160-0 Load dir plugins
bacula-dir: dir_plugins.c:162-0 No dir plugin dir!
bacula-dir: postgresql.c:1126-0 db_init_database first time
[root@152-249-244-141 bacula]# bacula-dir: postgresql.c:241-0 pg_real_connect done
bacula-dir: postgresql.c:243-0 db_user=bacula db_name=bacula db_password=528978528978
bacula-dir: dird.c:1015-0 Could not open Catalog "MyCatalog", database "bacula".
bacula-dir: dird.c:1020-0 postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula
Possible causes: SQL server not running; password incorrect; max_connections exceeded.
20-Jan 12:03 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf
Segue abaixo a configuração do bacula-dir.conf
#
# Default Bacula Director Configuration file
#
# The only thing that MUST be changed is to add one or more
# file or directory names in the Include directive of the
# FileSet resource.
#
# For Bacula release 5.2.13 (19 February 2013) -- redhat (Core)
#
# You might also want to change the default email address
# from root to your address. See the "mail" and "operator"
# directives in the Messages resource.
#
Director { # define myself
Name = bacula-dir
DIRport = 9101 # where we listen for UA connections
QueryFile = "/etc/bacula/query.sql"
WorkingDirectory = "/var/spool/bacula"
PidDirectory = "/var/run"
Maximum Concurrent Jobs = 1
Password = "34235" # Console password
Messages = Daemon
}
JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Client = bacula-fd
FileSet = "bacula_arquivos_set"
Schedule = "WeeklyCycle"
Storage = File
Messages = Standard
Pool = baculamensal
Priority = 10
Write Bootstrap = "/var/spool/bacula/%c.bsr"
}
#
# Define the main nightly save backup job
# By default, this job will back up to disk in /tmp
Job {
Name = "BackupBacula"
JobDefs = "DefaultJob"
}
Job {
Name = "Backup_server_Debian"
Type = Backup
Client = server-debian-fd
FileSet = "server_debian_Departamental"
Schedule = "Agenda_gfs"
Storage = File
Messages = Standard
Pool = Diaria
Priority = 10
}
# Backup the catalog database (after the nightly save)
Job {
Name = "BackupCatalog"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"
# This creates an ASCII copy of the catalog
# Arguments to
make_catalog_backup.pl are:
#
make_catalog_backup.pl <catalog-name>
RunBeforeJob = "/usr/libexec/bacula/
make_catalog_backup.pl MyCatalog"
# This deletes the copy of the catalog
RunAfterJob = "/usr/libexec/bacula/delete_catalog_backup"
Write Bootstrap = "/var/spool/bacula/%n.bsr"
Priority = 11 # run after main backup
}
#
# Standard Restore template, to be changed by Console program
# Only one such job is needed for all Jobs/Clients/Storage ...
#
Job {
Name = "RestoreFiles"
Type = Restore
Client=bacula-fd
FileSet = "bacula_arquivos_set"
Storage = File
Pool = Default
Messages = Standard
Where = /tmp/bacula-restores
}
# List of files to be backed up
FileSet {
Name = "bacula_arquivos_set"
Enable VSS = yes
Include {
Options {
signature = MD5
compression = GZIP2
}
File = /etc
File = /var
File = /opt
}
Exclude {
File = /var/spool/bacula
File = /var/lib/pgsql
}
}
FileSet {
Name = "server_debian_Departamental"
Enable VSS = yes
Include {
Options {
signature = MD5
compression = GZIP2
}
File = /home/Departamental
}
Exclude {
}
}
#
# When to do the backups, full backup on first sunday of the month,
# differential (i.e. incremental since full) every other sunday,
# and incremental backups other days
Schedule {
Name = "WeeklyCycle"
Run = Full Pool = baculamensal 1st saturday at 21:00
}
Schedule {
Name = "Agenda_gfs"
Run = Differential Pool = Diaria Monday-Thursday at 19:00
Run = Full Pool = Mensal 1st 2nd 3rd 4th 5th Friday at 19:00
}
# This is the backup of the catalog
FileSet {
Name = "Catalog"
Include {
Options {
signature = MD5
}
File = "/var/spool/bacula/bacula.sql"
}
}
# Client (File Services) to backup
Client {
Name = bacula-fd
Address = localhost
FDPort = 9102
Catalog = MyCatalog
Password = "49834" # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}
Client {
Name = server-debian-fd
Address = 192.168.0.2
FDPort = 9102
Catalog = MyCatalog
Password = "43792473" # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}
#
# Second Client (File Services) to backup
# You should change Name, Address, and Password before using
#
#Client {
# Name = bacula2-fd
# Address = localhost2
# FDPort = 9102
# Catalog = MyCatalog
# Password = "@@FD_PASSWORD@@2" # password for FileDaemon 2
# 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 = 127.0.0.1 # N.B. Use a fully qualified name here
SDPort = 9103
Password = "45674"
Device = FileStorage
Media Type = File
}
# Generic catalog service
Catalog {
Name = MyCatalog
# Uncomment the following line if you want the dbi driver
# dbdriver = "dbi:postgresql"; dbaddress = 127.0.0.1; dbport =
dbname = "bacula"; dbuser = "bacula"; dbpassword = "528978528978"
}
# Reasonable message delivery -- send most everything to email address
# and to the console
Messages {
Name = Standard
#
# NOTE! If you send to two email or more email addresses, you will need
# to replace the %r in the from field (-f part) with a single valid
# email address in both the mailcommand and the operatorcommand.
# What this does is, it sets the email address that emails would display
# in the FROM field, which is by default the same email as they're being
# sent to. However, if you send email to more than one address, then
# you'll have to set the FROM address manually, to a single address.
# for example, a '
no-r...@mydomain.com', is better since that tends to
# tell (most) people that its coming from an automated source.
#
mailcommand = "/usr/sbin/mail -s \"Bacula: %t %e of %c %l\" %r"
operatorcommand = "/usr/sbin/mail -s \"Bacula: Intervention needed for %j\" %r"
mail =
edu...@tiffel.com.br = all, !skipped
operator =
gab...@tiffel.com.br = mount
console = all, !skipped, !saved
#
# WARNING! the following will create a file that you must cycle from
# time to time as it will grow indefinitely. However, it will
# also keep all your messages if they scroll off the console.
#
append = "/var/log/bacula/bacula.log" = all, !skipped
catalog = all
}
#
# Message delivery for daemon messages (no job).
Messages {
Name = Daemon
mailcommand = "/usr/sbin/mail -s \"Bacula daemon message\""
mail =
edu...@tiffel.com.br = all, !skipped
console = all, !skipped, !saved
append = "/var/log/bacula/bacula.log" = all, !skipped
}
# File Pool definition
Pool {
Name = Default
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # one year
}
Pool {
Name = baculamensal
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes
Volume Use Duration = 20 hours # Prune expired volumes
Volume Retention = 20 days # one year
Label Format = "baculamensal-${NumVols}"
Maximum Volume Bytes = 3G # Limit Volume size to something reasonable
Maximum Volumes = 12 # Limit number of Volumes in Pool
}
Pool {
Name = Mensal
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes
Volume Use Duration = 2 days # Prune expired volumes
Volume Retention = 4 days # one year
Label Format = "Mensal-${NumVols}"
Maximum Volume Bytes = 100GB # Limit Volume size to something reasonable
Maximum Volumes = 16 # Limit number of Volumes in Pool
}
Pool {
Name = Diaria
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes
Volume Use Duration = 3 days # Prune expired volumes
Volume Retention = 7 days # one year
Label Format = "Diaria-${NumVols}"
Maximum Volume Bytes = 5GB # Limit Volume size to something reasonable
Maximum Volumes = 20 # Limit number of Volumes in Pool
}
# Scratch pool definition
Pool {
Name = Scratch
Pool Type = Backup
}
#
# Restricted console used by tray-monitor to get the status of the director
#
Console {
Name = bacula-mon
Password = "342442"
CommandACL = status, .status
}