Ceph与Bacula运维实战:数据迁移与备份配置优化指南

#作者:猎人

文章目录

1ceph数据迁移&&bacula配置调整

1.1ceph数据迁移&&bacula配置调整

为了规避因单个OSD利用率达90%而导致整个集群错误无法访问,ceph集群现已在原ceph块设备的基础上建立了cephfs文件系统用于存储数据,需要把原备份到块设备上的设备迁移到新建的cephfs上,迁移完毕后把ceph rbd回收,后续所有的备份数据直接写到cephfs。

  • rbd分配的指定空间满了之后需要新创建,cephpfs的空间可以横向扩容,也可以避免单个OSD引起集群故障

1.2在备份服务器的ceph-client上mount cephfs文件系统

  • T机房(1xx.xxx.xxx.x3):ceph-fuse -m 1x.xxx.xx.x9:6789 -r /tt_bacula /cephfs/
  • Y机房(1x.xxx.xx.x1):ceph-fuse -m 1x.xxx.xx.51:6789 /cephfs/

1.2.1迁移数据

  • T:/data1/backup_disk0*/下的数全部数据迁移到/cephfs/tt_bacula/backup_disk0*/
  • Y:/data1/backup_disk0*/下的数全部数据迁移到/cephfs/yz_bacula/backup_disk0*/
    特别注意:在做数据恢复的时候需要把数据还原到原/data1/backup_disk0*/下才能恢复数据

1.2.2调整bacula-sd配置

1.2.2.1T机房:

bacula-sd.conf中添加7个Device FileChgr8/9/10/11/12/13/14分别指向/cephfs/tt_bacula/下的7个目录

bacula-sd.conf新加配置如下:

复制代码
Autochanger {
  Name = FileChgr8
  Device = FileChgr8-Dev1, FileChgr8-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}
Device {
  Name = FileChgr8-Dev1
  Media Type = File8
  Archive Device = /cephfs/tt_bacula/backup_disk03/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
Device {
  Name = FileChgr8-Dev2
  Media Type = File8
  Archive Device = /cephfs/tt_bacula/backup_disk03/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}

Autochanger {
  Name = FileChgr9
  Device = FileChgr9-Dev1, FileChgr9-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}
Device {
  Name = FileChgr9-Dev1
  Media Type = File9
  Archive Device = /cephfs/tt_bacula/backup_disk01/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
Device {
  Name = FileChgr9-Dev2
  Media Type = File9
  Archive Device = /cephfs/tt_bacula/backup_disk01/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}

Autochanger {
  Name = FileChgr10
  Device = FileChgr10-Dev1, FileChgr10-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}
Device {
  Name = FileChgr10-Dev1
  Media Type = File10
  Archive Device = /cephfs/tt_bacula/backup_disk02/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
Device {
  Name = FileChgr10-Dev2
  Media Type = File10
  Archive Device = /cephfs/tt_bacula/backup_disk02/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}

Autochanger {
  Name = FileChgr11
  Device = FileChgr11-Dev1, FileChgr11-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}
Device {
  Name = FileChgr11-Dev1
  Media Type = File11
  Archive Device = /cephfs/tt_bacula/backup_disk04/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
Device {
  Name = FileChgr11-Dev2
  Media Type = File11
  Archive Device = /cephfs/tt_bacula/backup_disk04/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}

Autochanger {
  Name = FileChgr12
  Device = FileChgr12-Dev1, FileChgr12-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}
Device {
  Name = FileChgr12-Dev1
  Media Type = File12
  Archive Device = /cephfs/tt_bacula/backup_disk05/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
Device {
  Name = FileChgr12-Dev2
  Media Type = File12
  Archive Device = /cephfs/tt_bacula/backup_disk05/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}

Autochanger {
  Name = FileChgr13
  Device = FileChgr13-Dev1, FileChgr13-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}
Device {
  Name = FileChgr13-Dev1
  Media Type = File13
  Archive Device = /cephfs/tt_bacula/backup_disk06/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
Device {
  Name = FileChgr13-Dev2
  Media Type = File13
  Archive Device = /cephfs/tt_bacula/backup_disk06/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}

Autochanger {
  Name = FileChgr14
  Device = FileChgr14-Dev1, FileChgr14-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}
Device {
  Name = FileChgr14-Dev1
  Media Type = File14
  Archive Device = /cephfs/tt_bacula/backup_disk07/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
Device {
  Name = FileChgr14-Dev2
  Media Type = File14
  Archive Device = /cephfs/tt_bacula/backup_disk07/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 10
}
1.2.2.2Y机房:
bacula-sd.conf中添加1个Device FileChgr3分别指向/cephfs/yz_bacula/目录
bacula-sd.conf新加配置如下:
Autochanger {
  Name = FileChgr3
  Device = FileChgr3-Dev1, FileChgr3-Dev2
  Changer Command = ""
  Changer Device = /dev/null
}

Device {
  Name = FileChgr3-Dev1
  Media Type = File3
  Archive Device = /cephfs/yz_bacula
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 5
}

Device {
  Name = FileChgr3-Dev2
  Media Type = File3
  Archive Device = /cephfs/yz_bacula
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 5
}

1.2.2.3调整bacula-dir配置

  1. 把前面新添加的7个SD加到bacula-dir.conf中

  2. T机房:把原来Job中的 Storage 都换成对应新建的Storage,例如原Storage = tiantan-ceph-sd7(/data1/backup_disk07/)替换成现在Storage = tiantan-ceph-sd14(/cephfs/tt_bacula/backup_disk07/)

  3. Y机房:把原来Job中的 Storage 都换成对应新建的Storage = yizhuang-ceph-sd3(亦庄把yizhuang-ceph-sd1和yizhuang-ceph-sd2在此做一个合并,合并到yizhuang-ceph-sd3)
    bacula-dir.conf新加配置如下:

    Storage {
    Maximum Concurrent Jobs = 10
    Name = tiantan-ceph-sd8
    SDPort = 9103
    Address = xxxxxxxx
    Device = FileChgr8
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File8
    }
    Storage {
    Maximum Concurrent Jobs = 10
    Name = tiantan-ceph-sd9
    SDPort = 9103
    Address = xxxxxxxx
    Device = FileChgr9
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File9
    }
    Storage {
    Maximum Concurrent Jobs = 10
    Name = tiantan-ceph-sd10
    SDPort = 9103
    Address = xxxxxxxx
    Device = FileChgr10
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File10
    }
    Storage {
    Maximum Concurrent Jobs = 10
    Name = tiantan-ceph-sd11
    SDPort = 9103
    Address = xxxxxxxx
    Device = FileChgr11
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File11
    }
    Storage {
    Maximum Concurrent Jobs = 10
    Name = tiantan-ceph-sd12
    SDPort = 9103
    Address = xxxxxxxx
    Device = FileChgr12
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File12
    }
    Storage {
    Maximum Concurrent Jobs = 10
    Name = tiantan-ceph-sd13
    SDPort = 9103
    Address = xxxxxxxx
    Device = FileChgr13
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File13
    }
    Storage {
    Maximum Concurrent Jobs = 10
    Name = tiantan-ceph-sd14
    SDPort = 9103
    Address = xxxxxxxx
    Device = FileChgr14
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File14
    }
    Storage {
    Maximum Concurrent Jobs = 10
    Name = yizhuang-ceph-sd3
    SDPort = 9103
    Address = xxx
    Device = FileChgr3
    Password = "TFDkggO6cIG/PL6P4mRYHjlBvAjckn2eOd7f5l5Zn32o"
    Media Type = File3
    }

相关推荐
用户302698074667 分钟前
Windows终端重生记:告别老古董,拥抱开源的Terminal新时代!
github
用户001739737368 分钟前
Ansible:运维界的「隐形战甲」,告别重复劳动的终极武器!!!
github
用户7815949966712 分钟前
渐进式之美:Vue.js如何改变了前端开发的游戏规则!!!
github
用户8136093414915 分钟前
当面试官要我手撕红黑树,我反手打开了这个神仙仓库!(实战心得)
github
寻月隐君39 分钟前
告别竞态条件:基于 Axum 和 Serde 的 Rust 并发状态管理最佳实践
后端·rust·github
dessler40 分钟前
Kafka-消费者(Consumer)和消费者组(Consumer Group)
linux·运维·kafka
进击的程序汪1 小时前
Linux 启动过程流程图--ARM版
linux·运维·arm开发
紫璨月1 小时前
nginx反向代理的bug
运维·nginx·bug
没有名字的小羊1 小时前
2.安装Docker
运维·docker·容器
xiezhr1 小时前
50 个常用 Docker 命令
运维·docker·容器