close

最近在使用Bacula備份軟體 不知道要怎麼摸熟他.....
弄得我瓶頸重重阿!!!!!
希望有大神相助~~~~~~~~~~~
以下是我將做過的紀錄整理了起來
希望對和我一樣新手有些幫助
 


Bacula 備份測試實驗

Bacula是一款跨平台開源跨平台備份管理工具,系統管理員可用來管理備份,恢復和核查在網絡上的計算機數據。 可備份到不同類型的媒體,包括磁帶和磁碟。支持如壓縮,轉移或備份計算機數據,或目錄服務。

  • 支援完全備份,增量備份,差異備份。

  • 支援多種恢復方式

  • 支援多種文件系統下的備份恢復(ext3、ext2、reiserfs、xfs、jfs、smbfs、iso9660、ntfs等)

  • 支援各種備份介質

  • 支援多種操作系統

一個完整的bacula備份系統,由下面5個部分組成,如下:

  • Director Daemon:負責監聽所有的備份、恢復、驗證、存檔事務,以及定製備份和恢復文件計劃等,並將整個系統運行狀況記錄在一個數據庫文件中。其配置文件為bacula-dir.conf。

  • Storage Daemon(SD):主要負責將數據備份到存儲介質上,而在數據恢復時,負責將數據從存儲介質中傳送出去。其配置文件為bacula-sd.conf。

  • File Daemon(FD):安裝在需要備份數據的機器上的守護進程,在備份數據時,它負責把文件傳出,在恢復數據時負責接收數據並執行恢復操作。配置文件為bacula-fd.conf。

  • Console:管理控製臺。可以通過這個控製臺連接到Director Daemon進行管理備份與恢復操作。

  • Monitor:進程監控端。

參考資料 :

http://www.itread01.com/articles/1475837755.html 企業級的開源備份工具Bacula之安裝

#1 https://www.server-world.info/en/note?os=CentOS_7&p=bacula

#2 https://www.server-world.info/en/note?os=CentOS_7&p=bacula&f=2

http://yuhfa.blogspot.tw/2008/12/bacula.html 配置介紹教學

http://fanli7.net/a/bianchengyuyan/C__/20160624/565936.html

http://ixdba.blog.51cto.com/2895551/822090

http://www.howtoing.com/how-to-install-bacula-server-on-centos-7/ 安裝centOS

https://read01.com/dkngEd.html Linux 11種備份工具

 

Bacula是C/S 架構的高效備份程序,是個易於使用的網絡解決方案,具有很大靈活性,同時提供許多先進的存儲管理功 能,可以容易找到和恢復丟失或損壞的文件。採用模塊化設計,具有很好的擴展性。(c/s架構 https://read01.com/kjxay.html

 

安裝程序 :

yum install -y bacula-director bacula-storage bacula-console bacula-client mariadb-server

 

關閉 SELinux

#check

getenforce

#disabled

vim /etc/sysconfig/selinux    SELINUX=disable

reboot

Add Database for Bacula to MariaDB

systemctl start mariadb

systemctl enable mariadb

alternatives --config libbaccats.so

      Enter to keep the current selection[+], or type selection number: 1

/usr/libexec/bacula/grant_mysql_privileges

/usr/libexec/bacula/create_mysql_database -u root

/usr/libexec/bacula/make_mysql_tables -u bacula

mysql_secure_installation

mysql -u root -p

     UPDATE mysql.user SET password=PASSWORD("password") WHERE user='bacula';

     FLUSH PRIVILEGES;

     exit

Configure Bacula Director

vim /etc/bacula/bacula-dir.conf

[...]
Director {                         # define myself
 Name = bacula-dir
 DIRport = 9101             # where we listen for UA connections
 QueryFile = "/usr/libexec/bacula/query.sql"
 WorkingDirectory = "/var/spool/bacula"
 PidDirectory = "/var/run"
 Maximum Concurrent Jobs = 1
 Password = "password"      # Console password
 Messages = Daemon

[...]

# Client (File Services) to backup
Client {
 Name = bacula-fd
 Address = 192.168.1.200
 FDPort = 9102
 Catalog = MyCatalog
 Password = "password"       # password for FileDaemon
 File Retention = 30 days         # 30 days
 Job Retention = 6 months         # six months
 AutoPrune = yes                  # Prune expired Jobs/Files
}

[...]
# Definition of file storage device
Storage {
 Name = File
# Do not use "localhost" here
 Address = 192.168.1.99             # N.B. Use a fully qualified name here
 SDPort = 9103
 Password = "password"
 Device = FileStorage
 Media Type = File
}

[...]
# Generic catalog service
Catalog {
 Name = MyCatalog
# Uncomment the following line if you want the dbi driver
# dbdriver = "dbi:sqlite3"; dbaddress = 127.0.0.1; dbport =
 dbname = "bacula"; dbuser = "bacula"; dbpassword = "password"
}

[...]

Console {
 Name = bacula-mon
 Password = "password"
 CommandACL = status, .status
}


 

                                                                                                              



 

bacula-dir -tc /etc/bacula/bacula-dir.conf (檢查bacula-dir文件有無錯誤)

 

Configure Bacula Storage

mkdir /backup

chown bacula /backup

 

vim /etc/bacula/bacula-sd.conf

[...]
Director {
 Name = bacula-dir
 Password = "password"
}

##Delete the following lines (Do not uncomment). As i installed centos minimal server, i don't have a GUI mode, so that i deleted the following section##

# Restricted Director, used by tray-monitor to get the
#   status of the storage daemon
#
Director {
 Name = bacula-mon
 Password = "@@MON_SD_PASSWORD@@"
 Monitor = yes
}

[...]

Device {
 Name = FileStorage
 Media Type = File
 Archive Device = /backup
 LabelMedia = yes;                # lets Bacula label unlabeled media
 Random Access = Yes;
 AutomaticMount = yes;            # when device opened, read it
 RemovableMedia = no;
 AlwaysOpen = no;
}
[...]

 

bacula-sd -tc /etc/bacula/bacula-sd.conf  (檢查bacula-sd文件有無錯誤)


 

Configure Bacula Console

vim /etc/bacula/bconsole.conf

Director {
 Name = bacula-dir
 DIRport = 9101
 address = localhost
 Password = "password"
}                                    

 

bconsole -tc /etc/bacula/bconsole.conf (檢查bconsole文件有無錯誤)

 

Configure Bacula file daemon

 

vim /etc/bacula/bacula-fd.conf

 

# List Directors who are permitted to contact this File daemon
#
Director {
Name = bacula-dir
Password = "password"
}
##Delete (do not uncomment) these lines if you only using CUI mode in Backup server ##
# Restricted Director, used by tray-monitor to get the
#   status of the storage daemon
#
Director {
Name = bacula-mon
Password = "@@MON_SD_PASSWORD@@"
Monitor = yes
}

bacula-fd -tc /etc/bacula/bacula-fd.conf

資料夾權限

chown -R bacula:bacula /…….

chmod -R 700 /……..

restart all bacula daemons

service bacula-dir start
service bacula-fd start
service bacula-sd start
chkconfig bacula-dir on
chkconfig bacula-fd on
chkconfig bacula-sd on

 

Bacula With Webmin

wget

http://sourceforge.net/projects/webadmin/files/webmin/1.660/webmin-1.660-1.noarch.rpm

(版本可以更換)

rpm -Uvh webmin-1.660-1.noarch.rpm

service webmin start
chkconfig webmin on

vim /etc/sysconfig/iptables
 


-A INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9101 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9102 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9103 -j ACCEPT















 

參考資料:

http://wenku.baidu.com/view/213742685a8102d276a22fa9.html?re=view

http://fanli7.net/a/bianchengyuyan/C__/20160628/566512.html

https://www.digitalocean.com/community/tutorials/how-to-install-bacula-server-on-centos-7

http://note617.blogspot.tw/2011/07/bacula-bconsole.html

http://www.chriscouture.com/installing-bacula-webmin-bacula-webon-centos-7/

https://www.linuxhelp.com/how-to-setup-backup-server-using-bacula-and-webmin-in-centos/


 


測試Linux虛擬主機上local disk

 

PC VM Workstation Linux(192.168.1.99) mount 192.168.1.163 /mnt/vol/custom folder
透過bacula 備份到Linux /backup  folder

 

SD透過freenas分享iscsi掛載資料夾作為storage

FD透過freenas分享NFS掛載資料夾作為備份目標

這實驗測試成功backup、restore

backup complete

restore complete

 

NFS資料夾掛載後沒有辦法 change owner給bacula時執行備份會出現的訊息

 

restore 測試無法執行

改為使用iscsi  可以執行並能完成

bacula webmin測試

修改 webmin miniserv.conf  => ssh=0  可以使用IP登入
http://eitwebguru.com/webmin-error-the-web-server-is-running-in-ssl-mode/

使用web create Storage Devices 還是必須使用手動授權資料夾
SElinux 需要關閉不然無法chown bacula


 

Freenas Storage

原有計畫將freenas新增Plugin並作為storage經過幾次設定和修改設定檔,還是無法順利與freenas SD連接
freenas本身的plugin已無支援更新,為這個實驗上的不穩定原因

(出現這錯誤的原因待查明)

 

備份執行過程中曾經造成網路無法辨識(目前查無原因),重開機後回復正常且備份會持續執行。


 

Bacula windows 測試
http://www.bacula.org/5.1.x-manuals/de/main/main/Windows_Version_Bacula.html  參考網站

在本機PC(192.168.1.40)上安裝Bcaula並與虛擬機Linux bacula(192.168.1.88)連接

 

在windows上使用CMD登入Linux主機bconsole



 

Bacula vmware 參考教學

http://bacula.us/vmware-virtual-machines-back-up-with-bacula-and-ghettovcb/






 

以下為Bacula Systems安裝完成後登入web畫面

 

Bacula Systems VMware 手冊

https://www.baculasystems.com/wp-content/uploads/vmware-plugin_including_single_file_recovery_s.pdf






 

arrow
arrow
    創作者介紹
    創作者 WarnerLi 的頭像
    WarnerLi

    Work smarter not harder

    WarnerLi 發表在 痞客邦 留言(0) 人氣()