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
    }

相关推荐
乌鸦乌鸦你的小虎牙10 分钟前
linux 抓包工具tcpdump使用小记(使用时注意权限和系统资源)
linux·运维·tcpdump
小小寂寞的城20 分钟前
Jenkins里构建一个简单流水线
java·运维·jenkins
*郑*40 分钟前
nginx配置反向代理支持CORS跨域请求
运维·nginx
VirusVIP3 小时前
Windows CMD通过adb检查触摸屏Linux驱动是否被编译
linux·运维·adb
chennalC#c.h.JA Ptho3 小时前
ubuntu studio 系统详解
linux·运维·服务器·经验分享·ubuntu·系统安全
yt948327 小时前
Docker-基础(数据卷、自定义镜像、Compose)
运维·docker·容器
水银嘻嘻9 小时前
web 自动化之 KDT 关键字驱动详解
运维·自动化
Vone_669 小时前
node.js 邮箱验证服务器搭建
运维·服务器·node.js
丢丢丢丢丢丢~10 小时前
apache2的默认html修改
linux·运维·服务器
wusam10 小时前
Linux系统管理与编程20:Apache
linux·运维·服务器·apache·shell编程