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
    }

相关推荐
裴东青3 小时前
10-实战:RuoYi-Cloud的自动化发布
运维·ci/cd·自动化
哎呦,帅小伙哦3 小时前
Linux 时间:从原子钟到 clock_gettime 的每一面
linux·运维·服务器
sxgzzn3 小时前
新能源场站数智化转型:基于数字孪生与AI的智慧运维管理平台解析
大数据·运维·人工智能
张小姐的猫3 小时前
【Linux】多线程 —— 线程互斥
linux·运维·服务器·c++
CodeMartain3 小时前
Dify Windows 原生部署(无 Docker、纯本地)
运维·docker·容器
xxx1x1x4 小时前
极客向:DLL/运行库故障的底层逻辑与自动化修复方案
运维·自动化·dll文件·dll·dll修复·dll缺失·dll一键修复
YuanDaima20484 小时前
Linux 进阶运维与 AI 环境实战:进程管理、网络排错与 GPU 监控
linux·运维·服务器·网络·人工智能
lolo大魔王5 小时前
Linux 数据文件处理实战:排序、搜索、压缩、归档一站式详解
linux·运维·服务器
llrraa20105 小时前
配置docker国内镜像源
运维·docker·容器
starvapour5 小时前
Ubuntu切换到Fcitx5中文输入法
linux·运维·ubuntu