如何部署Bareos备份5-备到GlusterFS

Bareos

5 备份保存到GlusterFS

5.1 基本配置

5.1.1 配置名称解析

vim /etc/hosts

添加如下选项

10.168.0.180 GFS01.cmdschool.org GFS01
10.168.0.181 GFS02.cmdschool.org GFS02
10.168.0.182 GFS03.cmdschool.org GFS03

5.1.2 安装GlusterFS客户端包

yum install -y centos-release-gluster38
yum install -y glusterfs-fuse

5.1.3 安装Bareos存储包

yum install -y bareos-storage-glusterfs

5.2 分布式存储配置

5.2.1 配置GlusterD连接权限

vim /etc/glusterfs/glusterd.vol

增加如下选项:

volume management
[…]
option rpc-auth-allow-insecure on
end-volume

重启存储服务

/etc/init.d/glusterd restart

5.2.2 配置bricks连接进程权限

gluster volume set gv_bareos_1 server.allow-insecure on

通过停启卷确保配置生效

gluster volume stop backups
gluster volume start gv_bareos_1

5.2.3 配置卷的文件系统权限

mount -t glusterfs GFS01:/gv_bareos_1 /mnt/
mkdir /mnt/bareos
chown bareos:bareos /mnt/bareos/
chmod ug=rwx /mnt/bareos/
umount /mnt/

5.3 配置Bareos

5.3.1 SD中附加分布式存储

cp /etc/bareos/bareos-sd.d/device/GlusterStorage.conf.example /etc/bareos/bareos-sd.d/device/GlusterStorage.conf
chown bareos:bareos /etc/bareos/bareos-sd.d/device/GlusterStorage.conf
vim /etc/bareos/bareos-sd.d/device/GlusterStorage.conf

修改配置如下:

Device {
  Name = GlusterStorage
  Description = "Storage device using a Gluster backend."
  Archive Device = "Gluster Device"
  Device Options = "uri=gluster://GFS01/gv_bareos_1/bareos"
  Device Type = gfapi
  Media Type = GlusterFile
  Label Media = yes
  Random Access = yes
  Automatic Mount = yes
  Removable Media = no
  Always Open = no
}

重启服务测试配置文件

systemctl restart bareos-sd
systemctl status bareos-sd

5.3.2 DIR中附加分布式存储

cp /etc/bareos/bareos-dir.d/storage/Gluster.conf.example /etc/bareos/bareos-dir.d/storage/Gluster.conf
chown bareos:bareos /etc/bareos/bareos-dir.d/storage/Gluster.conf
vim /etc/bareos/bareos-dir.d/storage/Gluster.conf

详细内容如下:

Storage {
  Name =  Gluster
  Address  = "10.168.0.22"
  Password = "VzAWcmWi4zLIEEjtWDo7WMkFw6wPWkSinHlXwjLuLyKh"
  Device = GlusterStorage
  Media Type = GlusterFile
}

注:密码请参阅同级别目录下的“File.conf”文件
重启服务测试配置文件

systemctl restart bareos-dir
systemctl status bareos-dir

5.3.3 更改分布式存储为备份的默认存储

vim /etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf

修改配置如下:

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = bareos-fd
  FileSet = "SelfTest"                     # selftest fileset                            (#13)
  Schedule = "WeeklyCycle"
  Storage = Gluster
  Messages = Standard
  Pool = Incremental
  Priority = 10
  Write Bootstrap = "/var/lib/bareos/%c.bsr"
  Full Backup Pool = Full                  # write Full Backups into "Full" Pool         (#05)
  Differential Backup Pool = Differential  # write Diff Backups into "Differential" Pool (#08)
  Incremental Backup Pool = Incremental    # write Incr Backups into "Incremental" Pool  (#11)
}

重启服务使配置生效

bconsole
Connecting to Director localhost:9101
1000 OK: bareos-dir Version: 16.2.4 (01 July 2016)
Enter a period to cancel a command.
*reload
reloaded

5.3.4 测试存储连接

bconsole
Connecting to Director localhost:9101
1000 OK: bareos-dir Version: 16.2.4 (01 July 2016)
Enter a period to cancel a command.
* status storage=Gluster
Connecting to Storage daemon Gluster at 10.168.0.22:9103

bareos-sd Version: 16.2.4 (01 July 2016) x86_64-redhat-linux-gnu redhat CentOS Linux release 7.0.1406 (Cor                                                   e)
Daemon started 05-Sep-17 08:56. Jobs: run=0, running=0.
 Heap: heap=135,168 smbytes=46,033 max_bytes=100,734 bufs=110 max_bufs=112
 Sizes: boffset_t=8 size_t=8 int32_t=4 int64_t=8 mode=0 bwlimit=0kB/s
[…]
Device "GlusterStorage" (Gluster Device) is not open.
[…]

===========================================================
官方文档
————-
https://github.com/bareos/bareos-docs
http://doc.bareos.org/master/html/bareos-manual-main-reference.html

官方源
————-
http://download.bareos.org/bareos/release/

没有评论

发表回复

Bareos
如何部署Bareos备份6-备份GlusterFS

6 备份GlusterFS的数据 6.1 基本配置 6.1.1 配置存储客户端名称 In Glust …

Bareos
如何部署Bareos备份4-添加客户端

4 添加备份客户端 4.1 基本配置 4.1.1 配置主机名称 In Clients hostnam …

Bareos
如何部署Bareos备份3-使用控制台

3 使用备份控制台 In Server 3.1 bconsole的基本指令 3.1.1 启动bcon …