该公司原先使用的备用机oracle-linux 5.7 不是很稳定执行。经常死机,新安装centos6.5, 即用bacula要备份的数据。在这里,有关安装故障记录,MEMO.

操作系统:centos6.5

1、安装mysql

用yum安装

yum install mysql mysql-server mysql-devel

这里要注意的是一定要安装mysql-devel,否则在等下configure bacula的时候会报找不到mysql.h文件--这里折腾了我好久。差点想去编译安装mysql

2、安装bacula-server端

解压

./configure --prefix=/opt/bacula --with-mysql                      #这里仅仅要指定mysql就能够,不须要指定路径,由于bacula会去默认的路径去找mysql

make

make install

3、初始化数据库

初始化的时候要保证mysql的rootpassword为空。。

进入bacula/etc 文件夹,运行下面命令

./grant_mysql_privileges
./create_mysql_database
./make_mysql_tables

4、配置bacula Director端\SD端

这里须要配置一个job  一个fileset 一个client 其它用默认的配置就可以满足一般要求

以下贴一下我的配置

Job{                                                          #job的作用是定义一个备份任务。一些參数像差异备份啦 备份周期啦 日志啦等等
Name="7.17"
Type = Backup
Level = Incremental
Client = 7.17
FileSet = "7.17"
Schedule = "WeeklyCycle"
Storage = File
Messages = Standard
Pool = File
Priority = 10
Write Bootstrap = "/opt/bacula/var/bacula/working/%c.bsr"
} FileSet { #在fileset里面定义client要备份的文件或者文件夹
  Name = "7.17"
  Include {
    Options {
      signature = MD5
    }
    File = "/opt/jdk"
  } Client { #定义client的一些參数,比方ip port 等
  Name = 7.17
  Address = 192.168.7.17
  FDPort = 9102
  Catalog = MyCatalog
  Password = "24H/a2pSWjFxWituyFuB8LpParvcDKgEMywQlxEgxxxx2"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

SD端使用默认配置就可以

5、配置FD端--备份client

直接上配置。要点就是director的名字和password要和dir的配置对上!

Director {
Name = Bacula200-dir
Password = "24H/a2pSWjFxWituyFuB8LpParvcDKgEMywQlxEgRldd2"
} #
# Restricted Director, used by tray-monitor to get the
# status of the file daemon
#
Director {
Name = Bacula200-mon
Password="24H/a2pSWjFxWituyFuB8LpParvcDKgEMywQlxEgRldd2"
Monitor = yes
} #
# "Global" File daemon configuration specifications
#
FileDaemon { # this is me
Name = centos-003-fd
FDport = 9102 # where we listen for the director
WorkingDirectory = /opt/bacula/var/bacula/working
Pid Directory = /var/run
Maximum Concurrent Jobs = 20
} # Send all messages except skipped files back to Director
Messages {
Name = Standard
director = centos-003-dir = all, !skipped, !restored
}

6、開始备份、恢复过程

备份首先要创建卷组

在环境变量里面加上 bacula的sbin路径

PATH=$PATH:$HOME/bin:/opt/bacula/sbin

然后使用bconsole进入控制台

然后就能够通过命令控制备份程序了

首先通过label欻关键卷组

然后使用run命令開始操作

备份

*run                                                             #開始任务使用run选择刚才创建的任务
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
A job name must be specified.
The defined Job resources are:
1: BackupClient1
2: xxxxxx
3: xxxxxx
4: BackupCatalog
5: RestoreFiles
Select Job resource (1-5): 1
Run Backup job
JobName: BackupClient1
Level: Incremental
Client: Bacula200-fd
FileSet: Full Set
Pool: File (From Job resource)
Storage: File (From Job resource)
When: 2014-07-07 22:32:21
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=1
You have messages.
*s                                                                               #使用s查看director来查看任务运行情况
Status available for:
1: Director
2: Storage
3: Client
4: All
Select daemon type for status (1-4): 1
Bacula200-dir Version: 5.2.6 (21 February 2012) x86_64-unknown-linux-gnu redhat
Daemon started 07-Jul-14 22:22. Jobs: run=1, running=0 mode=0,0
Heap: heap=274,432 smbytes=81,718 max_bytes=95,201 bufs=292 max_bufs=330 Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 07-Jul-14 23:05 BackupClient1 20140708
Incremental Backup 10 07-Jul-14 23:05 xxxxx 20140708
Incremental Backup 10 07-Jul-14 23:05 xxxxx 20140708
Full Backup 11 07-Jul-14 23:10 BackupCatalog 20140708
==== Running Jobs:
Console connected at 07-Jul-14 22:30
No Jobs running.
==== Terminated Jobs:
JobId Level Files Bytes Status Finished Name
====================================================================
1 Full 16 10.98 M OK 07-Jul-14 22:32 BackupClient1

  #任务完毕后,假设你登陆控制台。他会给你发以下备份成功的消息,假设失败也会发消息告诉你原因
Build OS: x86_64-unknown-linux-gnu redhat
JobId: 1
Job: BackupClient1.2014-07-07_22.32.27_03
Backup Level: Full (upgraded from Incremental)
Client: "Bacula200-fd" 5.2.6 (21Feb12) x86_64-unknown-linux-gnu,redhat,
FileSet: "Full Set" 2014-07-07 22:32:27
Pool: "File" (From Job resource)
Catalog: "MyCatalog" (From Client resource)
Storage: "File" (From Job resource)
Scheduled time: 07-Jul-2014 22:32:21
Start time: 07-Jul-2014 22:32:29
End time: 07-Jul-2014 22:32:30
Elapsed time: 1 sec
Priority: 10
FD Files Written: 16
SD Files Written: 16
FD Bytes Written: 10,988,458 (10.98 MB)
SD Bytes Written: 10,990,169 (10.99 MB)
Rate: 10988.5 KB/s
Software Compression: None
VSS: no
Encryption: no
Accurate: no
Volume name(s): 20140708
Volume Session Id: 1
Volume Session Time: 1404786153
Last Volume Bytes: 10,999,377 (10.99 MB)
Non-fatal FD errors: 0
SD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Backup OK

恢复

*run                                                            #还是使用run開始
A job name must be specified.
The defined Job resources are:
1: BackupClient1
2: xmygc
3: xm214
4: BackupCatalog
5: RestoreFiles
Select Job resource (1-5): 5
Please enter a JobId for restore: 1 #jobid 能够通过s- dirctory 来查看
Run Restore job
JobName: RestoreFiles
Bootstrap: *None*
Where: /tmp/bacula-restores
Replace: always
Client: Bacula200-fd
Storage: File
JobId: 1
When: 2014-07-08 11:00:35
Catalog: MyCatalog
Priority: 10
Plugin Options: *None*
OK to run? (yes/mod/no): mod #能够选择改动恢复的一些參数。这里选择更改恢复目的地
Parameters to modify:
1: Level
2: Storage
3: Job
4: FileSet
5: Restore Client
6: When
7: Priority
8: Bootstrap
9: Where
10: File Relocation
11: Replace
12: JobId
13: Plugin Options
Select parameter to modify (1-13): 9
Please enter path prefix for restore (/ for none): /root/test
Run Restore job
JobName: RestoreFiles
Bootstrap: *None*
Where: /root/test
Replace: always
Client: Bacula200-fd
Storage: File
JobId: 1
When: 2014-07-08 11:00:35
Catalog: MyCatalog
Priority: 10
Plugin Options: *None*
OK to run? (yes/mod/no): yes
Job queued. JobId=2
#报告恢复完毕
08-Jul 11:11 Bacula200-dir JobId 4: Start Restore Job RestoreFiles.2014-07-08_11.10.59_11
08-Jul 11:11 Bacula200-dir JobId 4: Using Device "FileStorage"
08-Jul 11:11 Bacula200-sd JobId 4: Ready to read from volume "20140708" on device "FileStorage" (/home/bak).
08-Jul 11:11 Bacula200-sd JobId 4: Forward spacing Volume "20140708" to file:block 0:198.
08-Jul 11:11 Bacula200-sd JobId 4: End of Volume at file 0 on device "FileStorage" (/home/bak), Volume "20140708"
08-Jul 11:11 Bacula200-sd JobId 4: End of all volumes.
08-Jul 11:11 Bacula200-dir JobId 4: Bacula Bacula200-dir 5.2.6 (21Feb12):
Build OS: x86_64-unknown-linux-gnu redhat
JobId: 4
Job: RestoreFiles.2014-07-08_11.10.59_11
Restore Client: Bacula200-fd
Start time: 08-Jul-2014 11:11:01
End time: 08-Jul-2014 11:11:01
Files Expected: 0
Files Restored: 16
Bytes Restored: 10,988,458
Rate: 0.0 KB/s
FD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Restore OK

版权声明:本文博主原创文章,博客,未经同意不得转载。

开源备份软件bacula安装记录--包括备份-恢复演练的更多相关文章

  1. 开源网络备份软件 bacula 的安装、配置和运行

    安装bacula 1 bacula的几种网络备份拓扑 前面文章介绍了bacula有5个组成部分,在实际的应用中,没有必要将5个部分分别放在不同的服务器上,它们之间的某些部分是可以合并的,常见的bacu ...

  2. 开源监控软件ganglia安装手册

    Ganglia是一个监控服务器,集群的开源软件,能够用曲线图表现最近一个小时,最近一天,最近一周,最近一月,最近一年的服务器或者集群的cpu负载,内存,网络,硬盘等指标. Ganglia的强大在于:g ...

  3. NBU是最牛逼的备份软件

    NBU是最牛逼的备份软件 TSM是IBM的备份   好好看看几个厂商 VERITAS 公司下的NBU入门级备份有BEHP的备份软件有DPIBM的是TSMCommvault也非常牛逼这都是做到了小机AI ...

  4. 开源监控软件ganglia

    开源监控软件ganglia安装手册 Ganglia是一个监控服务器,集群的开源软件,能够用曲线图表现最近一个小时,最近一天,最近一周,最近一月,最近一年的服务器或者集群的cpu负载,内存,网络,硬盘等 ...

  5. 类Unix上5个最佳开源备份工具 Bacula/Amanda/Backupninja/Backuppc/UrBackup

    当为一个企业选择备份工具的时候,你都考虑什么呢? 确定你正在部署的软件具有下面的特性 开源软件 – 你务必要选择那些源码可以免费获得,并且可以修改的软件.确信可以恢复你的数据,即使是软件供应商/项目停 ...

  6. 备份恢复工具xtrabackup安装和使用的记录

    一.安装 下面的方法是在测试环境可以上网的情况下安装的: 提供的是在centos7上安装的方法: 包下载: wget https://www.percona.com/downloads/percona ...

  7. Mysql备份系列(3)--innobackupex备份mysql大数据(全量+增量)操作记录

    在日常的linux运维工作中,大数据量备份与还原,始终是个难点.关于mysql的备份和恢复,比较传统的是用mysqldump工具,今天这里推荐另一个备份工具innobackupex.innobacku ...

  8. Manjaro系统和软件安装记录

    Linux桌面环境  ArchLinux官方wiki manjaro官方wiki pacman官方wiki 从www.distrowatch.com可以查看Linux发行版排行榜,可以看到manjar ...

  9. Mysql备份系列(4)--lvm-snapshot备份mysql数据(全量+增量)操作记录

    Mysql最常用的三种备份工具分别是mysqldump.Xtrabackup(innobackupex工具).lvm-snapshot快照.前面分别介绍了:Mysql备份系列(1)--备份方案总结性梳 ...

随机推荐

  1. Nginx 负载均衡-加权轮询策略剖析

    本文介绍的是客户端请求在多个后端服务器之间的均衡,注意与客户端请求在多个nginx进程之间的均衡相区别(Nginx根据每个工作进程的当前压力调整它们获取监听套接口的几率,那些当前比较空闲的工作进程有更 ...

  2. jQuery选择器实现隔行变色和使用javaScript实现隔行变色

    <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--什么是选择器? jQuery选择器继承了 ...

  3. PHP, Python, Node.js 哪个比较适合写爬虫?

    PHP, Python, Node.js 哪个比较适合写爬虫? 1.对页面的解析能力2.对数据库的操作能力(mysql)3.爬取效率4.代码量推荐语言时说明所需类库或者框架,谢谢.比如:python+ ...

  4. SAE开发一个应用(不仅仅是建站)

    参考http://jingyan.baidu.com/user/npublic/?un=944615045 http://sae.sina.com.cn/ 激活sae账户 登陆新浪云计算官方网站,网址 ...

  5. SVNKIT一段代码的分析

    打印SVNkit版本库中的结构: 函数如下: 调用方法如下: listEntries(repository, ""); System.out.println("XXXXX ...

  6. TCP closing a connection

    client closes socket: clientSocket.close(); step1 :client sends TCP FIN control segment to server st ...

  7. JS上传图片本地实时预览缩略图

    HTML 代码如下 <body> <table width="100%" border="0" cellspacing="0&quo ...

  8. [Django]models定义choices 字典中的页面显示值

    问题: 在django的models.py 在.我们定义一些choices元组,类别似一些字典值.通常下拉框或单个复选框,例如 0相应的M 1妇女和其他有关 class Area(models.Mod ...

  9. 潜水JVM

    原文地址:http://blog.jamesdbloom.com/JVMInternals.html(转载请注明出处和本文地址英文原文) 本文简要解析JVM的内部结构.下图显示了一个典型的一块JVM( ...

  10. GUI & Event例子

    Student No.: _______________ Name: ________________________________________1TK2934 Object-Oriented P ...