Bacula 在错误的库中加载磁带

Bacula 在错误的库中加载磁带

我在存储 (LibHP08 和 LibHP09) 上安装了两个 HP 磁带库,我尝试配置一些作业来访问这两个库,但是在 bacula 访问错误的库时遇到了一些问题。

例如,bacula 尝试访问 LibHP08 上插槽 20 上的卷“G00022L5”,但它到达了 LibHP09 上插槽 20 上的卷“H00011L5”。基本上,它尝试在正确的插槽上获取磁带,但在错误的库中。它生成以下错误:

LibHP 3307 Issuing autochanger "unload slot 20, drive 1" command.
 Warning: Director wanted Volume "G00022L5".
    Current Volume "H00011L5" not acceptable because:
    1998 Volume "H00011L5" catalog status is Append, not in Pool.

然后,bacula 卸载驱动器,尝试找到正确的磁带,但加载了错误的磁带,再次生成错误,依此类推。

由于找不到正确的磁带,因此该作业永远无法完成。

我的一些泳池:

Pool {
  Name = machine-Pool-Weekly
  Pool Type = Backup
  Storage = LibHP08, LibHP09
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 34 days
}

Pool {
  Name = machine-Pool-Monthly
  Pool Type = Backup
  Storage = LibHP08, LibHP09
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1825 days
}

编辑:更新了存储和设备/自动转换器配置

设备/自动转换器配置:

#
## An autochanger device with four drives
##  Library HP (LibHP08)
##
Autochanger {
  Name = LibHP08_Changer
  Device = LibHP08-drive_1, LibHP08-drive_2, LibHP08-drive_3, LibHP08-drive_4
  Changer Command = "/usr/lib64/bacula/mtx-changer %c %o %S %a %d"
  Changer Device = /dev/tape/by-id/scsi-35001438016063c04
}

#
## An autochanger device with four drives
##  Library HP (LibHP09)
##
Autochanger {
  Name = LibHP09_Changer
  Device = LibHP09-drive_1, LibHP09-drive_2, LibHP09-drive_3, LibHP09-drive_4
  Changer Command = "/usr/lib64/bacula/mtx-changer %c %o %S %a %d"
  Changer Device = /dev/tape/by-id/scsi-3500143801606395c
}

Device {
  Name = LibHP08-drive_1                      #
  Drive Index = 0
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-35001438016063c05-nst 
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

Device {
  Name = LibHP08-drive_2                      #
  Drive Index = 1
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-35001438016063c08-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

Device {
  Name = LibHP08-drive_3                      #
  Drive Index = 2
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-35001438016063c0b-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

Device {
  Name = LibHP08-drive_4                      #
  Drive Index = 3
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-35001438016063c0e-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

Device {
  Name = LibHP09-drive_1                      #
  Drive Index = 0
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-3500143801606395d-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

Device {
  Name = LibHP09-drive_2                      #
  Drive Index = 1
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-35001438016063960-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

Device {
  Name = LibHP09-drive_3                      #
  Drive Index = 2
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-35001438016063963-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

Device {
  Name = LibHP09-drive_4                      #
  Drive Index = 3
  Media Type = LTO-5
  Archive Device = /dev/tape/by-id/scsi-35001438016063966-nst
  AutomaticMount = yes;               # when device opened, read it
  AlwaysOpen = yes;
  RemovableMedia = yes;
  RandomAccess = no;
  AutoChanger = yes
  Alert Command = "sh -c 'smartctl -H -l error %c'"  
  Maximum Changer Wait = 600
  Maximum Concurrent Jobs = 1
  LabelMedia = yes
}

存储配置:

Storage { 
  Name = LibHP08
  Address = sd-host 
  SDPort = 9103 
  Password = "myPassword"
  Device = LibHP08_Changer
  Media Type = LTO-5 
  Autochanger = yes
  Maximum Concurrent Jobs = 4
} 

Storage { 
  Name = LibHP09
  Address = sd-host 
  SDPort = 9103 
  Password = "myPassword"
  Device = LibHP09_Changer
  Media Type = LTO-5 
  Autochanger = yes
  Maximum Concurrent Jobs = 4
} 

在 bconsole 上我执行了以下命令:

update slots

有些磁带放在了错误的位置,它更新了目录,但错误仍然存​​在。

我目前正在使用 Bacula v5.2.12,我在不同的机器上安装了 Director 和 Storage,它们之间的通信没有任何问题

编辑:我在postgresql上执行了以下sql:

    select mediaid, volumename, slot, poolid, storageid, deviceid from media where storageid=2 order by volumename;
    select mediaid, volumename, slot, poolid, storageid, deviceid from media where storageid=1 order by volumename;

我的两个库都应该有 48 盘磁带,但运行 sql 后,我注意到一个库有 51 盘磁带,另一个库有 45 盘磁带,再次运行“更新插槽”后,每个库中都有 3 盘磁带被重新定位。

显然,运行一项作业的简单事实已经扰乱了 postgresql 中的磁带。

我的postgresql版本是:

postgresql-server.x86_64           8.4.13-1.el6_3

有任何想法吗?

相关内容