ãæ³åã®ãšãããããã¯ããã¯ã¢ããã«é¢ãããã®ã§ãã
ã¿ã€ã ãªãŒãªããã¯ã¢ããã¯ãã·ã¹ãã 管çè ã®äœæ¥ã®éåžžã«éèŠãªéšåã§ãã ã¿ã€ã ãªãŒãªããã¯ã¢ããã«ãããç¡ç ã¯èœã¡çããç¥çµã¯éã§ãããåãäžããå¥åº·ãä¿è·ããŸãã
ãã®ãããã¯ã¯æ¢ã«ã¹ãããããŠãããšä»®å®ããã®ã¯åççã ãšæããŸãããããã§ãèªåã®çµéšãå ±æãããªã¹ã¯ããããŸãã ããã¯ã¢ããã¹ããŒã ã®ã¯ã©ã€ã¢ã³ã/ãµãŒããŒå®è£ ãèªè ã«æ瀺ãããŸãã ããŒã«ãšããŠãç§ã¯ãªãŒãã³ãœãŒã¹ãããžã§ã¯ãã®Baculaãéžã³ãŸããã 6ãæ以äžã®äœ¿çšçµéšããããç§ã¯èªåã®éžæã«æºè¶³ããŠããŸãã
Baculaã¯ããã€ãã®ããŒã¢ã³ã§æ§æãããŠããããããããç¬èªã®æ©èœè² è·ãæ ã£ãŠããŸãã 以äžã®å³ã¯ããããã®æªéã®é¢ä¿ãæš¡åŒçã«ç€ºããŠããŸãã
habracatã®äžã§ãç§ã¯ãã¹ãŠã®æªéã詳现ã«èª¬æããŸã
ç§ã®å Žåãããã¯ã¢ããã¯ä»¥äžã®å¯Ÿè±¡ãšãªããŸãã
- ãã¹ãŠã®ãµãŒããŒã®ããŸããŸãªããŒã¢ã³ã®æ§æãã¡ã€ã«ã
- MySQLããŒã¿ããŒã¹ã
- Windowsãã¡ã€ã«ãµãŒããŒããã®ã¯ãŒã¯ãããŒã
- nixãµãŒããŒããã®ããŸããŸãªéèŠãªããŒã¿ïŒãµã€ã/ãã©ãŒã©ã ãšã³ãžã³ãªã©ïŒ
1.ããã¥ã©ããŒã¢ã³ã®èª¬æ
ãã®ã·ã¹ãã ã¯ãã¯ã©ã€ã¢ã³ã/ãµãŒããŒãã¯ãããžãŒäžã«æ§ç¯ãããããŒã¿è»¢éã«TCPãããã³ã«ã䜿çšããŸãã ããã¯ã¢ããã¯ãç¬èªã®å®å šã«ãªãŒãã³ãªåœ¢åŒã§äœæãããŸãã
Baculaã®ããŒã¿ããã¯ã¢ããã·ã¹ãã ã¯ãDirector DaemonãStorage DaemonãFile DaemonãBacula Consoleã®4ã€ã®äž»èŠèŠçŽ ã§æ§æãããŠããŸãã ãããã®èŠçŽ ã¯ãã¹ãŠãã¹ã¿ã³ãã¢ãã³ã¢ããªã±ãŒã·ã§ã³ãšããŠå®è£ ãããŸãã
Director DaemonïŒDDïŒã¯ãä»ã®ã³ã³ããŒãã³ãã管çããã·ã¹ãã ã®äžå¿çãªèŠçŽ ã§ãã 圌ã®ã¿ã¹ã¯ã«ã¯ãããã¯ã¢ãã/埩å ããã»ã¹ã®ç®¡çã管çè ãžã®ç®¡çã€ã³ã¿ãŒãã§ã€ã¹ã®æäŸãªã©ãå«ãŸããŸãã ç°¡åã«èšãã°ãããã¯ãã¹ãŠã®ããã»ã¹ãéå§ãããã®é²è¡ç¶æ³ãç£èŠãããã£ã¹ãããã£ã§ãã
ã¹ãã¬ãŒãžããŒã¢ã³ïŒSDïŒ-ã¹ãã¬ãŒãžããã€ã¹ã«çŽæ¥ããŒã¿ãèªã¿æžãããã¢ããªã±ãŒã·ã§ã³ã DDããã®å¶åŸ¡ã³ãã³ããšããã¡ã€ã«ããŒã¢ã³ãžã®åé·ããŒã¿ãåãå ¥ããŸãã
ãã¡ã€ã«ããŒã¢ã³ïŒFDïŒ-ãã®èŠçŽ ã¯ãšãŒãžã§ã³ããšãåŒã°ããŸãã çµå±ã®ãšããããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ãã¬ãŒã ã¯ãŒã¯å ã§äœæ¥ããã®ã¯åœŒã§ããããã®ããŒã¿ãããã¯ã¢ããããå¿ èŠããããŸãã ãã¡ã€ã«ããŒã¢ã³ã¯ãããã¯ã¢ãããã¡ã€ã«ã«ã¢ã¯ã»ã¹ããŠSDã«è»¢éããããšã«ãããã«ãŒãã³å šäœãå®è¡ããŸãã ãŸããFDåŽã§ã¯ããããæ§æã«ãã£ãŠæ±ºå®ãããå Žåãããã¯ã¢ããã®æå·åãå®è¡ãããŸãã
Bacula ConsoleïŒBCïŒ-ã·ã¹ãã 管çè ã€ã³ã¿ãŒãã§ãŒã¹ã äžæ žã¯ãBaculaã管çããããã®ã·ã§ã«ã§ãã å³å¯ã«èšãã°ãBacula Consoleã¯ãéåžžãBCã®åãªãã¢ããªã³ã§ããã°ã©ãã£ã«ã«ã³ã³ãããŒã«ã·ã¹ãã ã§æ¡åŒµã§ããŸãã ãããã®ã·ã¹ãã ã«ã¯ããã¬ã€ã¢ãã¿ãŒãšããããå«ãŸããŸãã 1ã€ç®ã¯ã·ã¹ãã 管çè ã®ã³ã³ãã¥ãŒã¿ãŒã«ã€ã³ã¹ããŒã«ãããŠããã¯ã¢ããã·ã¹ãã ã®åäœãç£èŠãã2ã€ç®ã¯ã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ã€ã¹ãä»ããŠå¶åŸ¡ããæ©èœãæäŸããŸãã
Baculaã«ã¿ãã°-ãã¹ãŠã®äºçŽãã¡ã€ã«ãšããã¯ã¢ããã®å Žæã«é¢ããæ å ±ãä¿åããããŒã¿ããŒã¹ã å¿ èŠãªãã¡ã€ã«ã®å¹ççãªã¢ãã¬ã¹æå®ãä¿èšŒããã«ã¯ããã£ã¬ã¯ããªãå¿ èŠã§ãã MySqlãPostgreSqlãSqLiteããµããŒããããŠããŸãã
ãã®æ§é åå²ã«ãããStorage Daemonãè€æ°ã®ã¹ãã¬ãŒãžããã€ã¹ãæã€å°çšãµãŒããŒã«å±éãããŠããå Žåã«ãéåžžã«æè»ãªããã¯ã¢ããã·ã¹ãã ãç·šæã§ããŸãã Bacula Directorã¯ãSDã®è€æ°ã®ã€ã³ã¹ã¿ã³ã¹ã管çããããŒã¿ã®äžéšã1ã€ã®ã¹ãã¬ãŒãžããã€ã¹ã«ããã¯ã¢ããããäžéšãå¥ã®ã¹ãã¬ãŒãžããã€ã¹ã«ããã¯ã¢ããããããšãã§ããŸãã
2. OSããã³ããŒããŠã§ã¢
èªè ãããã¥ã©ã®æªéã®ä»äºã®ã¢ã€ãã¢ã圢æããã®ã§ãç§ã¯èªåã§ãã®ãã¹ãŠã®çŸãããã©ã®ããã«å®çŸãããã説æããŸãã
DDãSDãããã³Baculaã«ã¿ãã°ã®ããŒããŠã§ã¢ãšããŠã次ã®ç¹æ§ãæã€PCããããŸã
è£ çœ® | ã¢ãã« | é | éé»å®¹é/åšæ³¢æ° |
HDD | æ¥ç«HDS723020BLA642 | 3 | 2TB |
CPU | AMD PhenomïŒtmïŒII X4 970ããã»ããµãŒ | 1 | 3500 MHz |
ãã¶ãŒããŒã | ã®ã¬ãã€ãGA-880GA-UD3H | 1 | - |
RAM | 3541 Mb |
ãµãŒããŒã§äœ¿çšãããOSããã³ãœãããŠã§ã¢ã®ããŒãžã§ã³ã«ã€ããŠ
# lsb_release -a LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 5.7 (Final) Release: 5.7 Codename: Final # uname -a Linux backupsrv.domain.ru 2.6.18-274.7.1.el5PAE #1 SMP Thu Oct 20 17:03:59 EDT 2011 i686 athlon i386 GNU/Linux # rpm -qa |grep -E "syslog-ng|bacula|mysql-ser" bacula-libs-5. 0.3-1 syslog-ng-2.1.4-9.el5 bacula-mysql-5. 0.3-1 mysql-server-5. 0.77-4.el5_6.6
ããŒã¿ã¹ãã¬ãŒãžã«ã¯ãããã€ãã®ãœãããŠã§ã¢ïŒmdadmïŒRAIDã¢ã¬ã€ãé¢ä¿ããŠããŸãã
3ã€ã®ãã£ã¹ã¯äžã«ã·ã¹ãã çšã®3ã€ã®ããŒãã£ã·ã§ã³ãããããããã®ãããããã§ãããŒãã§ããŸããããã¯ã¢ããçšã«2ã€ã®ããŒãã£ã·ã§ã³ã®1ã€ã®ã¢ã¬ã€ã
é åå | ã©ã®ããŒãã£ã·ã§ã³ãã | ããŠã³ããã€ã³ã | ãã¡ã€ã«ã·ã¹ãã | é åã¬ãã« |
md0 | / dev / sda1ã/ dev / sdb1ã/ dev / sdc1 | ããŒã | ext2 | 1 |
md1 | / dev / sda2ã/ dev / sdb2ã/ dev / sdc2 | / | ext3 | 1 |
md2 | / dev / sda3ã/ dev / sdb3 | /ããã¯ã¢ãã | ext4 | 1 |
3.ããã¯ã¢ããã¹ããŒã ã®èª¬æãšBaculaããŒã¢ã³ã®èšå®
åèšã§19åã®Baculaã¯ã©ã€ã¢ã³ããæ§æãããŠããŸãããè«æ±ãµãŒããŒãšWindowsãã¡ã€ã«ãµãŒããŒããã®ããã¥ã¡ã³ãã®ããã¯ã¢ããã«ã€ããŠèª¬æããŸãã ããã2ã€ã®ãµãŒããŒã«çŠç¹ãåœãŠãŠããã®ã¯ãä»ã®ã¯ã©ã€ã¢ã³ããåæ§ã«æ§æãããŠããããã§ãããããã®ã¯ã©ã€ã¢ã³ããµãŒããŒã®äŸã䜿çšããŠãç¬èªã®æ§æãæ§ç¯ã§ããŸãã
課éãµãŒããŒã®ããã¯ã¢ããã¯ãåºæ¬çã«mysqlããŒã¿ããŒã¹ãšããŒã¢ã³ã®æ§æãã¡ã€ã«ã®ããã¯ã¢ããã§ãã
BDã§ã¯ããžã§ãã®ååŸã«ã¯ã©ã€ã¢ã³ãã§ããŒã«ã«ã¹ã¯ãªãããå®è¡ã§ããŸãã
æ¯æ©ãããã¯ã¢ãããµãŒããŒã§ã¿ã¹ã¯ãéå§ããããšãããŒã«ã«ã®ã¹ã¯ãªãããïŒèª²éãµãŒããŒèªäœã§ïŒå®è¡ããã課éããŒã¿ããŒã¹ã¢ãŒã«ã€ããäœæãããŸãããã®ã¢ãŒã«ã€ãã¯BDãååŸãã察å¿ããããªã¥ãŒã ããŒã«ã«é 眮ããŸãïŒå®éãSDã¯èªã¿åã/æžã蟌ã¿æäœãå¶åŸ¡ããŸãããä»ã¯é¢ä¿ãããŸããïŒã ã¿ã¹ã¯ã®å®äºåŸããã«ãä¿¡é Œæ§ãé«ããããã«ãäœæãããã¢ãŒã«ã€ãã課éãµãŒããŒäžã®å¥ã®ãã©ã«ããŒã«ç§»åããå¥ã®ã¹ã¯ãªãããèµ·åãããŸãã ãããã£ãŠãããŒã¿ããŒã¹ã¢ãŒã«ã€ãã¯Baculaãšè«æ±ãµãŒããŒã®äž¡æ¹ã«ãããŸãïŒã¯ããç§ã¯åŠæ³ã§ãïŒã ãããã®ã¡ã«ããºã ãšã¹ã¯ãªããã«ã€ããŠã¯ã以äžã§è©³ãã説æããŸãã
Windowsãã¡ã€ã«ãµãŒããŒãããå¿ èŠãªãã¹ãŠã®ã¯ãŒã¯ãããŒãä¿åããŸãã æ¥ææ¥ã«ã次ã®æ¥ãæææ¥ããåææ¥ã®å·®åããã¯ã¢ããã§å®å šããã¯ã¢ãããäœæãããŸãã
次ã«ãBaculaããŒã¢ã³ã®æ§æãã¡ã€ã«ã«ã€ããŠèª¬æããŸãã æã容éã®å€§ããbacula-dir.confããå§ããŸãããã
ãã¹ãŠã®BaculaããŒã¢ã³ã®æ§æãã¡ã€ã«ã¯ããããããªãœãŒã¹ã®èšè¿°ã§æ§æãããŠããŸãã åãªãœãŒã¹ã¯ãããŒã¢ã³ã®ç¹å®ã®æ©èœãç¹åŸŽä»ããŸãã
æ§æå ã®åè¡ã«ã€ããŠã³ã¡ã³ãããŸãããããã£ãŠãBaculaãã¡ã€ã«ïŒbacula-dir.confãbacula-sd.confãbacula-fd.confïŒã®ãªãœãŒã¹ãããã¯ã¯æ¬¡ã®ããã«ãªããŸãã詳现ã説æããå¿ èŠãããå Žåã¯ãã³ã¡ã³ãã§ç€ºããŸãã
ãªãœãŒã¹ãã€ã¬ã¯ã¿ãŒ
Director { # bacula director' Name = backupsrv.domain.ru-dir # , default DIRport = 9101 # , sql Bacula Catalog(mysql database) QueryFile = "/usr/lib/bacula/query.sql" # WorkingDirectory = "/backup/bacula-work/" # pid PidDirectory = "/var/run" # Maximum Concurrent Jobs = 1 # BC Password = "bacula_paS$w0rD10*" # mail', Messages Messages = Daemon # DirAddress = 10.1.19.2 }
ãªãœãŒã¹ã«ã¿ãã°ãããŒã¿ããŒã¹ãžã®æ¥ç¶ã«ã€ããŠèª¬æããŸã
Catalog { Name = MyCatalog dbname = "bacula"; dbuser = "bacula"; dbpassword = "edsfweo8vhwpe" }
ã¡ãã»ãŒãžãªãœãŒã¹
Messages { # Director, ? Name = Daemon # email mailcommand = "/usr/sbin/bsmtp -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r" # (root admins@domain.ru) # , mail = root@backupsrv.domain.ru = alert,error,fatal,terminate, !skipped # console = all, !skipped, !saved # append = "/var/lib/bacula/log" = alert,error,fatal,terminate, !skipped }
åã¯ã©ã€ã¢ã³ãã®ã¿ã¹ã¯ã¯ãããŒã«ãšã¹ãã¬ãŒãžã瀺ããŸãã
ããŒãããžãŒã«ã€ããŠã¯ç³ãèš³ãããŸããããããã¯é¡§å®¢ããŒã¿ã®ããã¯ã¢ããã³ããŒãããããªã¥ãŒã ããŒã«ã§ãã ç§ã®ããªã¥ãŒã ã¯ããœãããŠã§ã¢RAIDã¢ã¬ã€ã«é 眮ãããããã¥ã©åœ¢åŒã®ãã¡ã€ã«ã§ãã ã¯ã©ã€ã¢ã³ãããšã«ç°ãªãããªã¥ãŒã ããŒã«ãå®çŸ©ã§ããŸãã ããšãã°ãããŸããŸãªã¿ã€ãã®ã¯ã©ã€ã¢ã³ãçšã«6ã€ã®ããŒã«ãäœæããŸããã 以äžã®äŸã§ã¯ãè«æ±ããŒã¿ã«ã€ããŠããã®ãã¡ã®1ã€ã®ã¿ã説æããŠããŸãã
ã¹ãã¬ãŒãžã¯ãããªã¥ãŒã ãšããŠäœ¿çšãããç©çããã€ã¹ãèšè¿°ããŸãã
ïŒã¹ãã¬ãŒãžBGB-STã¯SDæ§æã«èšè¿°ãããŠããŸãïŒ
ãªãœãŒã¹ããŒã«
Pool { # , Name = bgb # , Pool Type = Backup # # ( 1-, 2-, # 3-, 3- - 1-) Recycle = yes # bacula catalog( mysql ) # AutoPrune = yes # (volumes) # , # Volume Retention = 90 days # Maximum Volume Bytes = 100G # Maximum Volumes = 3 # LabelFormat = "Vol" }
ãªãœãŒã¹ã¹ãã¬ãŒãž
Storage { # ( # Bacula, ) Name = BGB-F Password = "StoRage_PaSSw0rD" # fqdn Address = backupsrv.domain.ru # SDPort = 9103 # SD Device = BGB-ST # # bacula( /backup/bgbilling/Vol0001) Media Type = File }
ããã¯ã¢ããè«æ±ããŒã¿ããŒã¹ã®äŸã®ã¿ã¹ã¯ã
ãªãœãŒã¹ã¯ã©ã€ã¢ã³ã
Client { # Name = bgbilling-fd # ip Address = 10.103.2.5 # , FDPort = 9102 # mysql Bacula Catalog = MyCatalog # FD Password = "Fd_paSSw0rd" # # , # ( !!) File Retention = 45 days # , Job Retention = 90 days # ( mysql) AutoPrune = yes }
ã¿ã¹ã¯èªäœã
ãžã§ããªãœãŒã¹
Job { # Name = "BGBilling" # (backup or restore) Type = Backup # (, ) Level = Full # Client=bgbilling-fd # -( , ) FileSet="bgbilling-set" # SD Storage = BGB-F # ( (volume) # ) Pool = bgb # ( - # !) ClientRunBeforeJob = "/root/sh/before_bg_db_backup.sh" # ClientRunAfterJob = "/root/sh/after_bg_db_backup.sh" # messages, Messages = Standard # Schedule = "DaylyFullBGBilling" # , # , , # - , Write Bootstrap = "/backup/bsr-files/bgbilling.bsr" }
ç§ã¯ä»äºã®ååŸã«å®è¡ããã¹ã¯ãªããã«å°å¿µããããšãçŽæããŸããã
ä»äºã®åã®ã¹ã¯ãªãã
$ sudo cat /root/sh/before_bg_db_backup.sh #!/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin mysql -e "flush tables with read lock" --user=root --password="ololo" bgbilling lvcreate -L20G -s -n backup_db /dev/BGB-LVM1/billing_db mysql -e "unlock tables" --user=root --password="ololo" bgbilling mount /dev/BGB-LVM1/backup_db /backup tar -czf /usr/backups/`date +%Y-%m-%d_%H-%M`.bgb.tgz /backup/bgbilling/ umount /backup lvremove -f /dev/BGB-LVM1/backup_db
ä»äºã®åŸã®ã¹ã¯ãªãã
$ sudo cat /root/sh/after_bg_db_backup.sh #!/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin rm /usr/backups/after_run_bacula_backup/* mv /usr/backups/*.tgz /usr/backups/after_run_bacula_backup/
FileSetãªãœãŒã¹ïŒããã¯ã¢ãããšã¯äœãïŒ
FileSet { Name = "bgbilling-set" Include { Options { # , # md5 signature = MD5 } # , File = /usr/backups File = /etc File = /root/sh } Exclude { # File = /usr/backups/after_run_bacula_backup/* File = /usr/backups/after_run_bacula_backup } }
èµ·åã¿ã¹ã¯ãã¹ã±ãžã¥ãŒã«ããŸãã
ã¹ã±ãžã¥ãŒã«ãªãœãŒã¹
Schedule { # Name = "DaylyFullBGBilling" # Run = Full sun-sat at 1:10 }
WindowsãµãŒããŒããããã¥ã¡ã³ããããã¯ã¢ããããããã®ãªãœãŒã¹ã«ã€ããŠã¯è©³ããã³ã¡ã³ãããŸãããbacula-dir.confæ§æã®å¯Ÿå¿ããéšåãå®å šã«æäŸããŸã
Storage { Name = WINDOWS-F Address = backupsrv.domain.ru # NB Use a fully qualified name here SDPort = 9103 Password = "StoRage_PaSSw0rD" Device = WINDOWS-ST Media Type = File } Pool { Name = windows Pool Type = Backup Recycle = yes # Bacula can automatically recycle Volumes AutoPrune = yes # Prune expired volumes Volume Retention = 60 days Maximum Volume Bytes = 30G # Limit Volume size to something reasonable Maximum Volumes = 5 # Limit number of Volumes in Pool LabelFormat = "Vol-Windows" } Job { Name = "centra-bdk" Type = Backup Level = Full Client= centra-bdk-fd FileSet="centra-bdk-fd-fs" Storage = WINDOWS-F Pool = windows Messages = Standard Schedule = "Windows_Centra-bdk" Write Bootstrap = "/backup/bsr-files/centra-bdk.bsr" } FileSet { Name = "centra-bdk-fd-fs" Include { Options { signature = MD5 Compression=GZIP } # ! File = "D:\\Public\\!!!\ " File = "D:\\Public\\\ " File = "D:\\Public\\tex\\Maps" File = "D:\\Public\\\ " File = "D:\\Public\\\ 1" } Exclude { File = "*.mp3" File = "*.avi" File = "*.wmv" } } Client { Name = centra-bdk-fd Address = 10.1.19.50 FDPort = 9102 Catalog = MyCatalog Password = "Fd_paSSw0rd" # password for FileDaemon File Retention = 30 days # 30 days Job Retention = 2 months # two months AutoPrune = yes # Prune expired Jobs/Files } Schedule { Name = "Windows_Centra-bdk" Run = Level=Full on sun at 07:10 Run = Level=Differential on mon-sat at 22:15 }
ããã§BDæ§æãã¡ã€ã«ãå®æããŸããã SDæ§æã«ç§»ããŸããã-bacula-sd.confãã¡ã€ã«ã®èª¬æ
ãªãœãŒã¹ã¹ãã¬ãŒãž
Storage { # SD Name = backupsrv.domain.ru-sd # SDPort = 9103 # ( ) WorkingDirectory = "/var/lib/bacula" # pid Pid Directory = "/var/run/bacula" # ip SDAddress = 10.1.19.2 }
ãã£ã¬ã¯ã¿ãŒãªãœãŒã¹ïŒbacula-dir.conf configã§èª¬æãããŠããBDãžã®ãªã³ã¯ïŒ
Director { # DD, , Name = backupsrv.domain.ru-dir # Password = "StoRage_PaSSw0rD" }
ããŸããŸãªããã€ã¹ã®èª¬æãå§ãŸããåèšã§4ã€ã®ç°ãªãããã€ã¹ã䜿çšããŸãã 課éãšWindowsã®2ã€ã®äŸãæããŸãã
課éçšã®ãªãœãŒã¹ããã€ã¹ã
Device { # , Name = BGB-ST # Media Type = File # (, volumes) Archive Device = /backup/bgbilling # Pool'( Vol*) . # DD LabelMedia = yes; # File Random Access = Yes; # , AutomaticMount = yes; # =) RemovableMedia = no; # , AlwaysOpen = no; }
Windowsãã¡ã€ã«ãµãŒããŒã®ããã€ã¹ãªãœãŒã¹
Device { Name = WINDOWS-ST Media Type = File Archive Device = /backup/windows LabelMedia = yes; Random Access = Yes; AutomaticMount = yes; RemovableMedia = no; AlwaysOpen = no; }
ãªãœãŒã¹ã¡ãã»ãŒãžã
Messages { # Name = Standard # DD = = director = backupsrv.domain.ru-dir = all }
æ§æãã¡ã€ã«bconsole.confãBaculaã³ã³ãœãŒã«ãžã®ã¢ã¯ã»ã¹ã
Director { Name = backupsrv.ray-com.ru-dir DIRport = 9101 address = 10.1.19.2 Password = "bacula_paS$w0rD10*" }
é©åãªStorageãã©ã«ããŒãäœæããbaculaããããã®ãã©ã«ããŒã®ææè ã«ããããšãå¿ããªãã§ãã ããã
ã³ã¡ã³ãããã®ãã³ã
@ / usr / local / etc / bacula / client.conf
@ / usr / local / etc / bacula / job.conf
@ / usr / local / etc / bacula / pool.conf
@ / usr / local / etc / bacula / fileset.conf
æ§æã¯ç°ãªããã¡ã€ã«ã«åå²ã§ããŸããã
ãªãã·ã§ã³{眲å= MD5å§çž®= GZIP}
å§çž®ãæå¹ã«ããŸãã
ãµãŒããŒåŽã®æ§æãå®äºããŸããã
ã¯ã©ã€ã¢ã³ãèšå®
åã¯ã©ã€ã¢ã³ããfqdnãµãŒããŒåããã®IPã¢ãã¬ã¹ã«è§£æ±ºããå¿ èŠãããããšã«æ³šæããããšãéèŠã§ãïŒ DNSããŒã«ãæäŸãããããã¹ãã«ç»é²ããŠãã ããïŒ
ãªãœãŒã¹ãã£ã¬ã¯ã¿ãŒã
Director { # BD Name = backupsrv.domain.ru-dir # BD ( Client BD) Password = "Fd_paSSw0rd" } FileDaemon FileDaemon { # Name = bgbilling-fd # 9102 FDport = 9102 WorkingDirectory = /usr/lib/bacula Pid Directory = /var/run/bacula FDAddress = 10.103.2.5 } Messeges Messages { Name = Standard director = backupsrv.domain.ru = all, !skipped, !restored append = "/var/bacula/log" = all, !skipped }
æ§æãã¡ã€ã«ã®ã³ã¡ã³ãã§ãããŸããŸãªæ§æãã¡ã€ã«ã§ãã¹ã¯ãŒããšããŒã¢ã³åãäžèŽããããã¿ãŒã³ã«èšåãããããã©ããã§æ··ä¹±ããŠããå Žåã¯ãäžã®å³ã䜿çšããŠãã ããã
4.å埩æé ã®äŸ
batãŠãŒãã£ãªãã£ã䜿çšããŠãããã¯ã¢ãããç£èŠããã³åŸ©å ãããšäŸ¿å©ã§ãã
Ubuntuã§ã¯ããã®ããã«é 眮ãããŸã
# sudo aptitude install bacula-console-qt
GentooããŒã¿ã«ã§ã¯èŠã€ããããªãã£ãã®ã§ããœãŒã¹ããåéããŸããã
æ§æãã¡ã€ã«bat.confã¯ãåè¿°ã®bconsole.confãšå®å šã«äŒŒãŠããŸãã
ãã®ãããããšãã°ãç¹å®ã®çªå·ã®è«æ±ããŒã¿ããŒã¹ã¢ãŒã«ã€ãã埩å ããããšæããŸãã ç§ã䜿çšããã¢ã«ãŽãªãºã ã¯æ¬¡ã®ãšããã§ãã
1.ããããéããå¿ èŠãªã¿ã¹ã¯ãèŠã€ããŸã
2.ã³ãã³ããªã¹ããã¡ã€ã«jobid = 3059ãå ¥åããŠãã¿ã¹ã¯ã«å¿ èŠãªãã¡ã€ã«ãããããšã確èªããŸã
3.ããã§ã³ã³ãœãŒã«ã«ç§»åããŸãïŒç§ã«ãšã£ãŠã¯ããã䟿å©ã§ã=ïŒïŒã ã³ã³ãœãŒã«ã§ãè«æ±ã¢ãŒã«ã€ããå¥ã®ã¯ã©ã€ã¢ã³ãã«åŸ©å ããŸã
$ sudo bconsole [sudo] password for onotole: Connecting to Director 10.1.19.2:9101 1000 OK: backupsrv.domain.ru-dir Version: 5.0.3 (30 August 2010) Enter a period to cancel a command. *restore Automatically selected Catalog: MyCatalog Using Catalog "MyCatalog" First you select one or more JobIds that contain files to be restored. You will be presented several methods of specifying the JobIds. Then you will be allowed to select which files from those JobIds are to be restored. To select the JobIds, you have the following choices: 1: List last 20 Jobs run 2: List Jobs where a given File is saved 3: Enter list of comma separated JobIds to select 4: Enter SQL list command 5: Select the most recent backup for a client 6: Select backup for a client before a specified time 7: Enter a list of files to restore 8: Enter a list of files to restore before a specified time 9: Find the JobIds of the most recent backup for a client 10: Find the JobIds for a backup for a client before a specified time 11: Enter a list of directories to restore for found JobIds 12: Select full restore to a specified Job date 13: Cancel Select item: (1-13): 9 Defined Clients: 1: 192.168.15.12-fd 2: 1.1.1.1-fd 3: 1.1.1.75-fd 4: ASTERISK-configs-fd 5: DHCPD-configs-fd 6: GW1-configs-fd 7: GW2-configs-fd 8: NAS-20-configs-fd 9: NAS-21-configs-fd 10: NAS-6-configs-fd 11: NAS-ololo-configs-fd 12: NS_AND_MAIL-configs-fd 13: RADIUS-ololo-configs-fd 14: VIRTSRV1-configs-fd 15: bgbilling-fd 16: configs-fd 17: domain.ru-fd 18: mydomain.ru-fd 19: tv.domain.ru-fd 20: zabbix.domain.ru-fd Select the Client (1-20): 15 Automatically selected FileSet: bgbilling-set +-------+-------+----------+----------------+---------------------+------------+ | JobId | Level | JobFiles | JobBytes | StartTime | VolumeName | +-------+-------+----------+----------------+---------------------+------------+ | 3,292 | F | 1,666 | 10,874,552,420 | 2011-12-19 02:31:08 | Vol0014 | +-------+-------+----------+----------------+---------------------+------------+ To select the JobIds, you have the following choices: 1: List last 20 Jobs run 2: List Jobs where a given File is saved 3: Enter list of comma separated JobIds to select 4: Enter SQL list command 5: Select the most recent backup for a client 6: Select backup for a client before a specified time 7: Enter a list of files to restore 8: Enter a list of files to restore before a specified time 9: Find the JobIds of the most recent backup for a client 10: Find the JobIds for a backup for a client before a specified time 11: Enter a list of directories to restore for found JobIds 12: Select full restore to a specified Job date 13: Cancel Select item: (1-13): 12 Enter JobId to get the state to restore: 3059 Selecting jobs to build the Full state at 2011-12-06 02:28:47 You have selected the following JobId: 3059 Building directory tree for JobId(s) 3059 ... +++++++++++++++++++++++++++++++++++++++++++++ 1,535 files inserted into the tree. You are now entering file selection mode where you add (mark) and remove (unmark) files to be restored. No files are initially added, unless you used the "all" keyword on the command line. Enter "done" to leave this mode. cwd is: / $ ls etc/ root/ usr/ $ ls usr usr/ $ mark usr 1,667 files marked. $ done Bootstrap records written to /backup/bacula-work//backupsrv.domain.ru-dir.restore.8.bsr The job will require the following Volume(s) Storage(s) SD Device(s) =========================================================================== Vol0010 BGB-F BGB-ST Volumes marked with "*" are online. 1,667 files selected to be restored. Run Restore job JobName: restore Bootstrap: /backup/bacula-work//backupsrv.domain.ru-dir.restore.8.bsr Where: /usr/restore Replace: always FileSet: bgbilling-set Backup Client: bgbilling-fd Restore Client: bgbilling-fd Storage: BGB-F When: 2011-12-26 15:01:38 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): 5 The defined Client resources are: 1: bgbilling-fd 2: GW1-configs-fd 3: GW2-configs-fd 4: NAS-6-configs-fd 5: NAS-20-configs-fd 6: NAS-21-configs-fd 7: NAS-ololo-configs-fd 8: DHCPD-configs-fd 9: ASTERISK-configs-fd 10: NS_AND_MAIL-configs-fd 11: VIRTSRV1-configs-fd 12: mydomain.ru-fd 13: tv.domain.ru-fd 14: domain.ru-fd 15: 1.1.1.1-fd 16: 1.1.1.75-fd 17: zabbix.domain.ru-fd 18: 192.168.15.12-fd Select Client (File daemon) resource (1-18): 2 Run Restore job JobName: restore Bootstrap: /backup/bacula-work//backupsrv.ray-com.ru-dir.restore.8.bsr Where: /usr/restore Replace: always FileSet: bgbilling-set Backup Client: bgbilling-fd Restore Client: GW1-configs-fd Storage: BGB-F When: 2011-12-26 15:01:38 Catalog: MyCatalog Priority: 10 Plugin Options: *None* OK to run? (yes/mod/no): yes Job queued. JobId=3453 You have messages. *
4.ã¿ã¹ã¯ãæ£åžžã«å®äºããã®ãåŸ ã£ãŠããŸããã¹ããŒã¿ã¹ã¯åããããã§è¿œè·¡ã§ããŸã
ãããªãã¹ã¯ãªãŒã³ã·ã§ãã
æåŸãŸã§ç§ã®äœåãèªãã§ãããã¿ããªã«æè¬ããŸãã
çµè«ãšããŠãç§ã¯èªåèªèº«ã«ããã«ããã€ãã®ãã³ããèš±å¯ããŸãã
ããã¯ã¢ãããäœæãããšã©ãŒãªãã§å®äºããããšãç£èŠããã ãã§ãªããå®æçã«å±éããŠãã§ãã¯ããããšãéèŠã§ãã ãã®ãããªç·Žç¿ã¯ãæåã«ç€ºãããå·éããç¥çµã®åŒ·ããããã³å¥åº·ã«ããã«+100ãäžããŸãã baculaããŒã¿ããŒã¹ãšbsrãã¡ã€ã«ãå®æçã«ããã¯ã¢ããããããšãéåžžã«è¯ãç¿æ £ã§ãã
æããŸããŠããã§ãšãããããŸã!!!
䜿çšããããœãŒã¹ïŒ
1. www.ibm.com/developerworks/en/library/l-Backup_4
2. www.bacula.org/en/?page=documentation