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
    }

相关推荐
大路谈数字化9 分钟前
Centos中内存CPU硬盘的查询
linux·运维·centos
放飞自我的Coder2 小时前
【github-action 如何为github action设置secrets/environment】
github·action
绝无仅有2 小时前
编写 Go 项目的 Dockerfile 文件及生成 Docker 镜像
后端·面试·github
赏点剩饭7782 小时前
linux中的hostpath卷、nfs卷以及静态持久卷的区别
linux·运维·服务器
绝无仅有2 小时前
使用 Docker 部署 Go 项目(Beego 框架)
后端·面试·github
神鸟云3 小时前
DELL服务器 R系列 IPMI的配置
linux·运维·服务器·网络·边缘计算·pcdn
herderl3 小时前
**僵尸进程(Zombie Process)** 和**孤儿进程(Orphan Process)**
linux·运维·服务器·网络·网络协议
星哥说事3 小时前
开源轻量级表格革命——用Teable解锁你的数据管理新姿势
github
泽02023 小时前
Linux 编译器 gcc 与 g++
linux·运维·服务器