Open-source backup software bacula installation records-including backup-recovery drills

Source: Internet
Author: User

The company's original backup machines used Oracle-Linux 5.7 to run very stably, and often crashed. A new centos6.5 was installed, preparing to use bacula to back up data, record the installation fault here.


Operating System: centos6.5


1. Install MySQL

Install with yum

Yum install MySQL mysql-server mysql-devel

Please note that you must install mysql-devel. Otherwise, you will not be able to find the mysql. h file when you wait for configure bacula. It took me a long time to compile and install MySQL.


2. Install bacula-Server

Extract

./Configure -- prefix =/opt/bacula -- With-mysql # You only need to specify MySQL here. You do not need to specify the path because bacula will go to the default path to find MySQL.

Make

Make install


3. initialize the database

During initialization, ensure that the root password of MySQL is blank ....

Go to the bacula/etc directory and execute the following command

./grant_mysql_privileges./create_mysql_database./make_mysql_tables 

4. Configure bacula ctor end \ SD end

You need to configure a job, a fileset, and a client. Other default configurations can meet general requirements.

Paste my configuration below

Job {# job is used to define a backup task, some parameters are like differential backup, backup cycle, logs, etc. 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 {# define the file or directory name =" 7.17 "include {options {Signature = MD5} file ="/opt/JDK "} client in fileset {# define some client parameters, for example, name = 7.17 address = 192.168.7.17 fdport = 9102 catalog = mycatalog Password = "24 h/clock" # password for filedaemon file retention = 30 days #30 days job retention = 6 months # Six Months autoprune = yes # prune expired jobs/Files}

Use the default configuration on the SD side.

5. Configure the FD client-back up the client

Directly Configure. The key point is that the director name and password must be correct with the Dir configuration!

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 DirectorMessages {  Name = Standard  director = centos-003-dir = all, !skipped, !restored}

6. Start the backup and recovery process

To back up a backup, you must first create a volume group.

Add the sbin path of bacula to the Environment Variable

PATH=$PATH:$HOME/bin:/opt/bacula/sbin
Then use bconsole to enter the Console

Then, you can use commands to control the backup program.

First, use the label Label to renew a key volume group.

Run the command to start the operation.

Backup

* Run # Start the task and use run to select the created task 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: Role: incrementalclient: Bacula200-fdFileSet: full setpool: file (from job Resource) Storage: file (from job Resource ) When: 2014-07-07 22: 32: 21 priority: 10ok to run? (Yes/MoD/no): yesjob queued. jobid = 1you have messages.

* S # Use s to view director to view task execution status available for: 1: Director 2: storage 3: Client 4: allselect daemon type for status (1-4 ): 1bacula200-dir version: 5.2.6 (21 February 2012) x86_64-unknown-linux-gnu RedHat daemon started 07-jul14. jobs: Run = 1, running = 0 mode = 274,432 heap: heap = 81,718 smbytes = 95,201 max_bytes = 292 bufs = 330 max_bufs = scheduled jobs: level type pri scheduled name volume ==================================== ========================================================== ========= Incremental Backup 10 07-jul-14 Incremental Backup 10 minutes XXXXX 20140708 Incremental Backup 10 07-jul-14 05 XXXXX 20140708 full backup 11 minutes backupcatalog 20140708 = = Running jobs: console connected at 07-jul-14 22: 30no jobs running. ==== terminated jobs: jobid level files bytes status finished name ================================ ======================================== 1 full 16 10.98 m OK 07-jul14 backupclient1


# After the task is completed, if you log on to the console, he will send you the following Backup success message, if the failure will also send a message to tell you the cause of 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" 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
Restore

* Run # Use run to start a job name must be specified. the defined job resources are: 1: backupclient1 2: xmygc 3: xm214 4: backupcatalog 5: restorefilesselect job Resource (1-5): 5 Please enter a jobid for restore: 1 # jobid you can view run restore jobjobname: restorefilesbootstrap: * none * Where:/tmp/bacula-restoresreplace: alwaysclient: Bacula200-fdStorage: filejobid: 1 When: 11: 00: 35 catalog: Mycatalogpriority: 10 plugin options: * none * OK to run? (Yes/MoD/no): mod # You can modify the recovery parameters. Here, you can change the 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 optionsselect parameter to modify (1-13 ): 9 Please enter path prefix for restore (/For none):/root/testrun restore jobjobname: restorefilesbootstrap: * none * Where:/root/testreplace: Alwaysclient: Bacula200-fdStorage: filejobid: 1 When: 2014-07-08 11: 00: 35 catalog: mycatalogpriority: 10 plugin options: * none * OK to run? (Yes/MoD/no): yesjob queued. jobid = 2

# Report Recovery completed 08-jul Bacula200-dir jobid 4: Start restore job restorefiles.2014-07-08_11.10.59_1108-jul Bacula200-dir jobid 4: Using device "filestorage" 08-jul Bacula200-sd jobid 4: ready to read from volume "20140708" on Device "filestorage" (/home/bak ). 08-jul Bacula200-sd jobid 4: Forward spacing volume "20140708" to file: Block 0: 198.08-Jul Bacula200-sd jobid 4: end of volume at file 0 on Device "filestorage" (/home/bak), volume "20140708" 08-jul Bacula200-sd jobid 4: End of all volumes.08-Jul Bacula200-dir jobid 4: bacula Bacula200-dir 5.2.6 (21feb12): Build OS: x86_64-unknown-linux-gnu RedHat jobid: 4 job: restorefiles.2014-Snapshot 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





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.