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
    }

相关推荐
典学长编程4 分钟前
Linux操作系统从入门到精通!第二天(命令行)
linux·运维·chrome
wuk99818 分钟前
基于MATLAB编制的锂离子电池伪二维模型
linux·windows·github
ai小鬼头2 小时前
AIStarter如何助力用户与创作者?Stable Diffusion一键管理教程!
后端·架构·github
天天扭码2 小时前
从图片到语音:我是如何用两大模型API打造沉浸式英语学习工具的
前端·人工智能·github
你想考研啊2 小时前
四、jenkins自动构建和设置邮箱
运维·jenkins
Code blocks3 小时前
使用Jenkins完成springboot项目快速更新
java·运维·spring boot·后端·jenkins
饥饿的半导体4 小时前
Linux快速入门
linux·运维
独立开阀者_FwtCoder4 小时前
【Augment】 Augment技巧之 Rewrite Prompt(重写提示) 有神奇的魔法
前端·javascript·github
还是奇怪6 小时前
Linux - 安全排查 2
linux·运维·安全
牛奶咖啡136 小时前
Linux系统的常用操作命令——文件远程传输、文件编辑、软件安装的四种方式
运维·服务器·软件安装·linux云计算·scp文件远程传输·vi文件编辑·设置yum的阿里云源