Open source backup software Bacula installation records-including backup-recovery walkthroughs

Source: Internet
Author: User
Tags bacula

The company originally used the standby machine Oracle-linux 5.7 is not very stable execution. Often crashes, new installation centos6.5, that is, the data to be backed up with Bacula. Here, for the installation of the fault record, MEMO.


Operating system: centos6.5


1. Install MySQL

Install with Yum

Yum install MySQL mysql-server mysql-devel

Note here to be sure to install Mysql-devel, otherwise in the Configure Bacula when the time will be reported to find mysql.h file--Here toss me for a long while. Almost want to compile and install MySQL


2, install Bacula-server end

Extract

./configure--prefix=/opt/bacula--with-mysql #这里仅仅要指定mysql就能够, you do not need to specify a path, because Bacula will go to the default path to find MySQL

Make

Make install


3. Initialize the database

When initializing, make sure that MySQL Rootpassword is empty.

Go to the Bacula/etc folder and run the following command


4, configuration Bacula director End \SD end

Here you need to configure a job a fileset a client other with the default configuration to meet the general requirements

Here's a sticker for my configuration

job{#job的作用是定义一个备份任务. Some of the parameters are like differential backups, backup cycles, logs, etc. name= "7.17" Type = Backup level = Incremental Client = 7.17 Fileset = "7.17" Schedule = "Week Lycycle "Storage = file Messages = Standard Pool = File Priority = Ten Write Bootstrap ="/opt/bacula/var/bacula/worki NG/%C.BSR "}fileset {#在fileset里面定义client要备份的文件或者文件夹   Name =" 7.17 "   Include {    Options {      signature = md5   } & nbsp;  File = "/OPT/JDK"  }client {#定义client的一些參数, for example, IP port   Name = 7.17  Address = 192.168.7.17  Fdport = 9102  Catalog = mycatalog  Password = "24H/A2PSW jfxwituyfub8lpparvcdkgemywqlxegxxxx2 "          # Password for filedaemon  File Retention = Days            # days  Job Retention = 6 months             # six months  autoprune = yes                      # prune expired Jobs/files}

Use the default configuration on the SD side to

5. Configuring the FD side--Backup client

Directly on the configuration. The main point is the director's name and password to the Dir and the configuration of the pair!


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 was me  Name = centos-003-fd  fdport = 9102                  # Where we listen for the dire ctor  workingdirectory =/opt/bacula/var/bacula/working  Pid Directory =/var/run  Maximum Concurrent Jobs = 20}# Send All messages except skipped files back to directormessages {  Name = standard  director = centos- 003-dir = All,!skipped,!restored}

6. Start Backup and restore process

Backup first to create a volume group

Add the Bacula sbin path to the environment variable

Path= $PATH: $HOME/bin:/opt/bacula/sbin
Then use Bconsole to enter the console

Then you can control the Backup program by command.

First through the label Sizzle Key volume group

Then use the Run command to start the operation

Backup

*run                                                             #開始任务使用run选择刚才创建的任务Automatically selected catalog:mycatalogusing Catalog "MyCatalog" A job name must be Specified. The defined Job resources are:     1:backupclient1     2:xxxxxx     3:xxxxxx     4:backupcatalog     5: Restorefilesselect Job Resource (1-5): 1  Run Backup jobjobname:  backupclient1level:    incrementalclient:   Bacula200-fdfileset:  Full Setpool:     file (from job Resource) Storage:  file (from job Resource) When:     2014-07-07 22:32:21priority:10ok to run?

(yes/mod/no): Yesjob queued. Jobid=1you has messages.


*s #使用s查看director来查看任务运行情况Status available F Or:1: Director 2:storage 3:client 4:allselect daemon type for status (1-4): 1bacula200-dir Version:5. 2.6 (February) 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=330Scheduled Jobs: Level Type Pri scheduled Name volume=================================================    ==================================incremental Backup 07-jul-14 23:05 BackupClient1 20140708Incremental              Backup 07-jul-14 23:05 xxxxx 20140708Incremental backup ten 07-jul-14 23:05 xxxxx 20140708Full Backup 07-jul-14 23:10 backupcatalog 20140708====running jobs:console Connect Ed at 07-jul-14 22:30no Jobs running.====terminated Jobs:jobiD level Files Bytes Status finished Name ============================================================= ======= 1 full 10.98 M OK 07-jul-14 22:32 BackupClient1


  #任务完毕后, suppose you log in to the console.                  He will send you the following backup success message, assuming that the failure will also send a message to tell you why Build os:x86_64-unknown-linux-gnu redhat JobId: 1 job:backupclient1.2014-07-07_22.32.27_03 Backup level:full (upgraded from INC                remental) 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: Ten FD files written:16 SD Files written:16 FD Bytes written:10,988,458 (10.98 MB) SD Bytes Writt en: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
Recovery

*run #还是使用run開始A Job name must be specified. The defined Job resources are:1: BackupClient1 2:XMYGC 3:xm214 4:backupcatalog 5:restorefilessele CT Job Resource (1-5): 5Please Enter a JobId for restore:1 #jobid be able to view run S-dirctory via Resto Re jobjobname:restorefilesbootstrap: *none*where:/tmp/bacula-restoresreplace:alwaysclient:ba        cula200-fdstorage:filejobid:1when:2014-07-08 11:00:35catalog:mycatalogpriority: 10Plugin Options: *none*ok to run?

(yes/mod/no): MoD #能够选择改动恢复的一些參数. Select Change Recovery destination 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 Optionsselec T parameter to modify (1-13): 9Please Enter path prefix for restore (/for none):/root/testrun Restore Jobjobname:res Torefilesbootstrap: *none*where:/root/testreplace:alwaysclient:bacula200-fdstorage:file jobid:1when:2014-07-08 11:00:35catalog:mycatalogpriority:10plugin Options: *none* OK to run?

(yes/mod/no): Yesjob queued. jobid=2


#报告恢复完毕08-jul 11:11 bacula200-dir JobId 4:start Restore Job restorefiles.2014-07-08_11.10.59_1108-jul 11:11 Bacula200-dir JobId 4:using Device "filestorage" 08-jul 11:11 bacula200-sd JobId 4:ready to read from volume "20140708" O N Device "Filestorage" (/home/bak). 08-jul 11:11 bacula200-sd JobId 4:forward spacing Volume "20140708" to File:block 0:19 8.08-jul 11:11 bacula200-sd JobId 4:end of Volume at the 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 





Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

Open source backup software Bacula installation records-including backup-recovery walkthroughs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.