bareos主要由主控端和客户端构成:

包含的重要的服务有:

bareos-director

bareos-storage

bareos-filedaemon

bareos-bconsole

bareos-database

bareos安装

安装bareos yum源:

wget -O /etc/yum.repos.d/bareos.repo http://download.bareos.org/bareos/release/latest/CentOS_6/bareos.repo

安装bareos:
yum install bareos bareos-database-mysql
安装好MySQL并运行如下脚本,为Bareos创建数据库和表:
/usr/lib/bareos/scripts/create_bareos_database
/usr/lib/bareos/scripts/make_bareos_tables
/usr/lib/bareos/scripts/grant_bareos_privileges
启动Bareos服务
/etc/init.d/bareos-dir start   # Director进程,逻辑控制
/etc/init.d/bareos-sd start   # Storage Daemon
/etc/init.d/bareos-fd start    # File Daemon
Bareos使用的端口 9101-9103
使用如下命令访问Director:
bconsole
输入help命令查看帮助:

  • 常用的命令有:
show filesets
status dir
status client
status storage
status schedule
run  #运行run命令开始执行备份任务
quit

安装Bareos Webui

Bareos-webui是Bareos的Web管理接口,比 bconsole 命令要简单直观。 

System requirements

  • A working Bareos environment, Bareos >= 16.2. The Bareos Director and Bareos Webui should have the same version.
  • You can install Bareos Webui on any host it does not have to be installed on the same as the Bareos Director.
  • An Apache 2.x Webserver with mod-rewrite, mod-php5 and mod-setenv enabled.
  • PHP >= 5.5
安装好Apache和PHP(CentOS 6默认的php 5.3版本需要升级):
yum install httpd php php-cli php-common
安装 bareos-webui:
CentOS 6上安装
cd /var/www/html/
wget https://codeload.github.com/bareos/bareos-webui/zip/master -O bareos-webui.zip

 unzip bareos-webui.zip

mv bareos-webui-master bareos-webui
cp bareos-webui/install/apache/bareos-webui.conf /etc/httpd/conf.d/

修改bareos-webui.conf文件

/etc/init.d/httpd restart

onfigure the directors

mkdir /etc/bareos-webui
cp /var/www/html/bareos-webui/install/directors.ini /etc/bareos-webui/

Configure the webui

cp /var/www/html/bareos-webui/install/configuration.ini /etc/bareos-webui/

Create restricted named consoles

cp /var/www/html/bareos-webui/install/bareos/bareos-dir.d/console/admin.conf.example  /etc/bareos-webui/admin.conf

cp /var/www/html/bareos-webui/install/bareos/bareos-dir.d/profile/webui-admin.conf  /etc/bareos-webui/

console配置文件/etc/bareos-webui/admin.conf

profile resource配置文件/etc/bareos-webui/webui-admin.conf

修改/etc/bareos/bareos-dir.d/director/bareos-dir.conf文件,在最后添加如下两行

@/etc/bareos-webui/admin.conf
@/etc/bareos-webui/webui-admin.conf

/etc/init.d/bareos-dir restart

登录web页面:http://IP/bareos-webui

手动测试备份任务

查看的默认备份的目录为/usr/sbin

查看备份文件

测试恢复

默认恢复到/tmp/bareos-restores,可以输入mod自定义位置

查看恢复的文件

恢复单个文件

如果有多个文件可以写个列表,使用<符号导入

restore client=client1 file=</tmp/file-list

增加bareos-filedaemon客户端

在新的服务安装bareos-filedaemon

yum install -y bareos-filedaemon

在bareos-director服务器执行如下命令

bconsole

*configure add client name=node2 address=172.17.20.124 password=secret

会创建如下两个文件

/etc/bareos/bareos-dir-export/client/node2/bareos-fd.d/director/bareos-dir.conf

/etc/bareos/bareos-dir.d/client/node2.conf

从bareos-director上拷贝文件到新的bareos-filedaemon服务器

scp /etc/bareos/bareos-dir-export/client/node2/bareos-fd.d/director/bareos-dir.conf node2:/etc/bareos/bareos-fd.d/director/

scp /etc/bareos/bareos-dir.d/client/node2.conf node2:/etc/bareos/bareos-dir.d/client/

在bareos-director服务器上执行

*reload

在新的bareos-client启动服务

service bareos-fd start

查看bareos-fd命令

bareos-fd -xc

在web页面上查看客户端

使用新的client运行一个job

查看node2的状态

预估备份情况

运行备份job

列出备份的文件

查看存储卷

在web页面上查看所做的操作

备份相关配置

定义要备份的文件或目录(高级的定义写法请参考官方文档)

/etc/bareos/bareos-dir.d/fileset/SelfTest.conf配置文件

例如:

定义备份的时间表(高级的时间表写法可以参考官方文档)

/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf配置文件

例如:

AfterBackup时间表

/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf配置文件

例如:

定义备份存放的路径

/etc/bareos/bareos-sd.d/device/FileStorage.conf配置文件

例如:

Job和Jobdefs路径

/etc/bareos/bareos-dir.d/job/

/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf #默认job定义

存储定义的路径

/etc/bareos/bareos-dir.d/storage/

console和profile权限路径

/etc/bareos/bareos-dir.d/console/

/etc/bareos/bareos-dir.d/profile/

添加自定义fileset

/etc/bareos/bareos-dir.d/fileset/my.conf

使用命令行*configure add fileset name=my,或者重启/etc/init.d/bareos-dir restart使其生效。

使用show fileset查看

添加自定义jobdefs

/etc/bareos/bareos-dir.d/jobdefs/My.conf

使用命令行*configure add jobdefs name=My,或者重启/etc/init.d/bareos-dir restart使其生效。

使用show jobdefs查看

添加自定义job

/etc/bareos/bareos-dir.d/job/my-job.conf

重启/etc/init.d/bareos-dir restart

添加自定义schedule

/etc/bareos/bareos-dir.d/schedule/DailyCycle.conf

重启/etc/init.d/bareos-dir restart

查看自定义备份是否运行成功

定义备份保留时间

/etc/bareos/bareos-dir.d/pool/Full.conf

Volume Retention = 365 days

添加备份情况邮件提醒

/etc/bareos/bareos-dir.d/messages/Standard.conf

重启/etc/init.d/bareos-dir restart

Copy or Migration

迁移数据,从一个Volume移动到另一个Volume。(具体用法可参考官方文档)

安装 bareos-storage-tape

相关配置文件:

/etc/bareos/mtx-changer.conf
/etc/bareos/bareos-sd.d/autochanger/autochanger-0.conf
/etc/bareos/bareos-sd.d/device/tapedrive-0.conf

插件使用

可以配合一些插件备份数据

例如:

MySQL Plugin

Backup of MySQL Databases using the Bareos MySQL Percona xtrabackup Plugin

1.Install the xtrabackup tool from Percona

2.Install the files BareosFdPercona.py and bareos-fd-percona.py in your Bareos plugin directory

https://github.com/bareos/bareos-contrib/tree/master/fd-plugins/bareos_percona

3.Configuration Activate your plugin directory in the fd resource conf on the client

编辑bareos-fd.d/client/mysql-fd.conf

Client { 
   Name = mysql-fd 
   #... 
   Plugin Directory = /usr/lib64/bareos/plugins 
   Plugin Name = "python" 
 }

编辑bareos-dir.d/fileset/mysql.conf

FileSet { 
     Name = "mysql" 
     Include  { 
         Options { 
             compression=GZIP 
             signature = MD5 
         } 
         File = /etc 
         #... 
         Plugin = "python:module_path=/usr/lib64/bareos/plugins:module_name=bareos-fd-percona" 
     } 
 }

其他插件 bpipe plugin,LDAP Plugin,VMware Plugin等用法可参考官方文档。

加密(具体可参考官方文档)

传输加密

修改bareos-dir.conf

修改bareos-fd.conf

修改bareos-sd.conf

数据加密

修改bareos-fd.conf

由于图片地址用的公司的,现提供PDF文件:

https://files.cnblogs.com/files/wsl222000/%E4%BD%BF%E7%94%A8bareos%E5%A4%87%E4%BB%BD.pdf

最新文章

  1. ( 转 ) Android自绘字体大小paint.settextsize随分辨率大小变化
  2. [Ubuntu][Linux]更改PATH路径
  3. 161222、Bootstrap table 服务器端分页示例
  4. docker-compose安装使用
  5. div mouseenter 事件在IE下无效
  6. su su -
  7. Python之路-python环境安装和简单的语法使用
  8. 为什么 Node.js 这么火,而同样异步模式 Python 框架 Twisted 却十几年一直不温不火?
  9. 1101. Quick Sort (25)
  10. navicat 数据库管理工具快捷键
  11. P5016 龙虎斗 题解
  12. Numpy 创建数组
  13. 汇编语言--微机CPU的指令系统(五)(条件设置字节指令)
  14. ABP框架系列之三十五:(MVC-Controllers-MVC控制器)
  15. Vue-认识状态管理vuex
  16. day1-课堂笔记
  17. 如何使用PhoneGap打包Web App
  18. Tomcat 安装为服务后台自动启用
  19. Redis使用示例及在PHP环境中用redis存储session
  20. 关于EF Unit of Work Repository的简单用法

热门文章

  1. 解决github访问过慢问题
  2. 微信公众号 报token验证失败
  3. SVN 代码托管
  4. Android笔记——Socket通信实现简单聊天室
  5. Windows10 IIS配置PHP运行环境(原创)
  6. July 09th 2017 Week 28th Sunday
  7. mvc 从客户端 中检测到有潜在危险的 Request 值
  8. 【海龟汤策略】反趋势交易策略源代码分享(基于BOTVS)
  9. NGUI UILabel文字宽度和 UITweener
  10. Linux学习总结(八)-磁盘格式化,挂载,swap扩容