LinuxForum.Fans
Тема

Bacula. Ошибка: Job is waiting. Cannot find any...[РЕШЕНО]

Автор: selivan 2 сообщений 4760 просмотров
#121655

ОС: CensOS 5.5 (и на клиенте, и на сервере)
Bacula: 5.0.3

Задача: делать полный бекап клиента раз в неделю по субботам, хранить 2 недели. Инкрементальный бекап - каждый день с понедельника по пятницу, хранить 7 дней. Каждый бекап хранить в отдельном Volume.

Конфиг Director:

text

###################
# Director settings
###################

Director { Name = bacula-dir DIRport = 9101 QueryFile = "/etc/bacula/query.sql" WorkingDirectory = "/var/spool/bacula" PidDirectory = "/var/run" Maximum Concurrent Jobs = 1 Password = "*************" Messages = Daemon }

# Catalog service Catalog { Name = MyCatalog dbname = bacula; user = bacula; password = "*************" }

# Message settings Messages { Name = Standard mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) no-reply@localhost\" -s \"Bacula: %t %e of %c %l\" root@localhost" operatorcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) no-reply@localhost\" -s \"Bacula: Intervention needed for %j\" root@localhost" mail = root@localhost = all, !skipped operator = root@localhost = mount console = all, !skipped, !saved }

Messages { Name = Daemon # daemon messages (no job). mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" root@localhost" mail = root@localhost = all, !skipped console = all, !skipped, !saved append = "/var/log/bacula.log" = all, !skipped }

################## # Storage settings ##################

Storage { Name = bacula-sd # Do not use "localhost" here. Use a fully qualified name here Address = athena SDPort = 9103 Password = "*********" Device = FileStorage Media Type = File }

################## # Schedule settings ##################

Schedule { Name = "WeeklyCycle_at_22" Run = Level=Incremental mon-fri at 22:00 Run = Level=Full sat at 22:00 }

Schedule { Name = "WeeklyCycle_at_21" Run = Level=Incremental mon-fri at 22:00 Run = Level=Full sat at 21:00 }

Schedule { Name = "WeeklyFull_at_22" Run = Full daily at 22:00 }

Schedule { Name = "WeeklyFull_at_21" Run = Full daily at 21:00 } ####################### # Bacula Catalog backup #######################

Pool { Name = bacula-catalog Pool Type = Backup Recycle = yes # automatically recycle Volumes Purge Oldest Volume = yes AutoPrune = yes # prune expired volumes Volume Retention = 8 days Maximum Volume Jobs = 1 Maximum Volumes = 7 Label Format = "bacula-catalog-" }

# Bacula need at least one restore job to be defined Job { Name = restore-job Type = Restore Client = athena FileSet = bacula-catalog-files Storage = bacula-sd Messages = Standard Pool = bacula-catalog Where = / }

# Backup the catalog database (after the nightly save) Job { Name = bacula-catalog-backup Type = Backup Client = athena FileSet = bacula-catalog-files Storage = bacula-sd Messages = Standard Pool = bacula-catalog Schedule = "WeeklyFull_at_22" # This creates an ASCII copy of the catalog RunBeforeJob = "/usr/lib64/bacula/make_catalog_backup.pl MyCatalog" # This deletes the copy of the catalog RunAfterJob = "/usr/lib64/bacula/delete_catalog_backup" Write Bootstrap = "/data/bacula/BaculaCatalog.bsr" Priority = 11 # run after main backup }

FileSet { Name = bacula-catalog-files Include { Options { signature = MD5 } File = /var/lib/bacula/bacula.sql } }

################# # Client settings #################

@|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"

Конфиг conf.d/anteus.conf(кусок конфига директора, описывающий конкретного клиента):

text

#################
# Client anteus #
#################

Client { Name = anteus Address = anteus.radix-tools FDPort = 9102 Catalog = MyCatalog Password = "*************" File Retention = 15 days Job Retention = 15 days AutoPrune = yes }

# Pools for this client

Pool { Name = anteus-full Pool Type = Backup Recycle = yes # automatically recycle Volumes Recycle Oldest Volume = yes AutoPrune = yes # prune expired volumes Volume Retention = 15 days Maximum Volume Jobs = 1 Maximum Volumes = 3 Label Format = "anteus-full-" }

Pool { Name = anteus-inc Pool Type = Backup Recycle = yes # automatically recycle Volumes Recycle Oldest Volume = yes AutoPrune = yes # prune expired volumes Volume Retention = 7 days Maximum Volume Jobs = 1 Maximum Volumes = 7 Label Format = "anteus-inc-" }

# Jobs

Job { Name = anteus-backup Type = Backup Client = anteus FileSet = anteus-files Schedule = "WeeklyCycle_at_22" Storage = bacula-sd Messages = Standard Pool = anteus-full Full Backup Pool = anteus-full Incremental Backup Pool = anteus-inc Write Bootstrap = "/data/bacula/anteus-bootstrap.bsr" Priority = 10 }

# File Sets

FileSet { Name = anteus-files Include { Options { signature = MD5 compression = GZIP } File = / } Exclude { File = /proc File = /sys File = /dev File = /tmp File = /.journal File = /.fsc File = /data } }

Конфиг Storage:

text

Storage {                             # definition of myself
  Name = bacula-sd
  SDPort = 9103                  # Director's port
  WorkingDirectory = "/var/spool/bacula"
  Pid Directory = "/var/run"
  Maximum Concurrent Jobs = 20
  # !!!!
  Heartbeat Interval = 30 sec
}

# List Directors who are permitted to contact Storage daemon Director { Name = bacula-dir Password = "*************" }

# Devices supported by this Storage daemon # To connect, the Director's bacula-dir.conf must have the # same Name and MediaType.

Device { Name = FileStorage Media Type = File Archive Device = /data/bacula LabelMedia = yes; # lets Bacula label unlabeled media Random Access = Yes; AutomaticMount = yes; # when device opened, read it RemovableMedia = no; AlwaysOpen = no; # ignored for file storage }

# Send all messages to the Director, # mount messages also are sent to the email address Messages { Name = Standard director = bacula-dir = all }

Конфиг File Daemon клиента:

text

Director {
  Name = bacula-dir
  Password = "*********"
}

FileDaemon { Name = anteus-fd FDport = 9102 # where we listen for the director WorkingDirectory = /var/lib/bacula Pid Directory = /var/run Maximum Concurrent Jobs = 20 }

# Send all messages except skipped files back to Director Messages { Name = Standard director = bacula-dir = all, !skipped, !restored }

Тестирую конфигурацию, трижды запускаю в bconsole

text
run job=anteus-backup level=full yes

Всё нормально, в messages сыпятся Backup Status: OK

text

*list media
Pool: anteus-full
+---------+------------------+-----------+---------+----------+----------+--------------+---------+------+-----------+-----------+---------------------+
| MediaId | VolumeName       | VolStatus | Enabled | VolBytes | VolFiles | VolRetention | Recycle | Slot | InChanger | MediaType | LastWritten         |
+---------+------------------+-----------+---------+----------+----------+--------------+---------+------+-----------+-----------+---------------------+
|       6 | anteus-full-0001 | Used      |       1 |   63,097 |        0 |    1,296,000 |       1 |    0 |         0 | File      | 2011-01-26 21:37:08 |
|       7 | anteus-full-0007 | Used      |       1 |   10,697 |        0 |    1,296,000 |       1 |    0 |         0 | File      | 2011-01-26 21:37:24 |
|       8 | anteus-full-0008 | Used      |       1 |   10,697 |        0 |    1,296,000 |       1 |    0 |         0 | File      | 2011-01-26 21:37:34 |
+---------+------------------+-----------+---------+----------+----------+--------------+---------+------+-----------+-----------+---------------------+

Запускаю ещё раз

text
run job=anteus-backup level=full yes

Появляется ошибка:

text

26-Jan 21:37 bacula-sd JobId 14: Job anteus-backup.2011-01-26_21.37.44_06 is waiting. Cannot find any appendable volumes.
Please use the "label" command to create a new Volume for:
    Storage:      "FileStorage" (/data/bacula)
    Pool:         anteus-full
    Media type:   File

Все найденные в мануале и в гугле настройки включены:

В конфиге Storage:

text

...
Device {
...
LabelMedia = yes;
AutomaticMount = yes;
...
}

В конфиге Director:

text

...
Client {
  Name = anteus
...
  AutoPrune = yes
}

Pool { Name = anteus-full ... Recycle = yes Recycle Oldest Volume = yes AutoPrune = yes Maximum Volume Jobs = 1 Maximum Volumes = 3 Label Format = "anteus-full-" } ...

Пробовал убирать Recycle Oldest Volume, заменять на Purge Oldest Volume - не помогает.

В логах bacula абсолютно ничего интересного :(

В этой теме http://forum.lissyara.su/viewtopic.php?f=47&t=28485&p=259953#p259953 аналогичная проблема вроде была решена, но внимательно чтение документа по ссылке ничего нового мне не дало :(

Прощу помощи oO

#122549

Проблема решена :)) Следующая комбинация настроек(привожу упрощённый вариант, ротация и полный/частичный бекап у меня сделаны сложнее):

text

    Pool {
      Name = client1
      Pool Type = Backup
      Recycle = yes
      Purge Oldest Volume = yes
      AutoPrune = yes
      Volume Retention = 7 days
      Maximum Volume Jobs = 1
      Maximum Volumes = 8
      Label Format = "client1-full-"
    }

позволяет хранить каждое задание бекапа в отдельном файле, делать автоматическую ротацию и при этом ничего не ломается (!!) , если сделать бекап вручную вне цикла - просто прибъётся самый старый бекап.

Войдите или зарегистрируйтесь, чтобы ответить.