版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
Amanda安裝網(wǎng)上關(guān)于amanda的教程很多,但基本安裝平臺都在Centos7.0前,我的平臺是7.0的,所以各種各樣的問題出現(xiàn)在我安裝的過程中,差點(diǎn)放棄!為了自已可以溫習(xí)和大家少走彎路,把自已的安裝過程寫下來。.首先配置hosts文件,如下圖:4為客服端,9為服務(wù)端。然后把hosts文件復(fù)制到服務(wù)端#scp/etc/hosts9:/etc/hosts輸入密碼完成復(fù)制。.客服端安裝軟件包:#yuminstall-yAmandaAmanda-develAmanda-client.#Vim/etc/xinetd,d/Amanda
很多教程中socket_type=dragmprotocol=udp不知道為什么,我做的時候出錯,看了一些國外的方法我把客服端和服務(wù)端改成一樣了還有server中l(wèi)ib和Iib64要注意,好像7.0后只有64位了,編輯完成后重啟xinetd#systemctlrestartxinetd.#vim/var/lib/Amanda/.amandahosts.創(chuàng)建要備份的文件夾
#mkdirdata#cd/data#touch123 #測試用,隨意建我們要注意amanda這個用戶,安裝軟件后我們生成的用戶為amandabackup,是沒有amanda這個用戶的,所以我們在/etc/passwd中加:6.服務(wù)端安裝:6.服務(wù)端安裝:#yuminstall-yamandaAmanda-serverAmanda-devel//xinetd配置和客服//xinetd配置和客服端相同。#systemctlrestartxinetd 〃重啟進(jìn)程8.#vim/var/lib/Amanda/.amadahosts9.修改amanda配置文件#vim/etc/amanda/DailySet1/Amanda.conforg"server" 〃設(shè)置使用amanda的單位或者機(jī)構(gòu)的名稱mailto"root@localhost"〃指定將報告發(fā)送的郵件地址dumpuseramanda〃指定使用Amanda備份的用戶,默認(rèn)為amanda用戶dumpcycle7days〃設(shè)置備份周期的長度,單位也可以是weeks,在這里設(shè)置7days和1weeks的效果是ー樣的。runspercycle8〃設(shè)置每個備份周期內(nèi)amanda運(yùn)行的次數(shù)tapetypeHARD-DISK〃設(shè)置存儲類型labelstr"ADailySet1-[0-9][0-9]*$"〃定義卷標(biāo)格式logdir"/var/log/amanda"〃指定日志存放路徑,默認(rèn)存放在amanda配置目錄下tpchanger"chg-disk"http://更換磁帶的腳本changerfile7etc/amanda/DailySet1/changer"definedumptyperoot-tar{〃定義轉(zhuǎn)存儲類global//調(diào)用前面定義的globa!類型program"GNUTAR"http://使用GNUtar作為備份程序,默認(rèn)是DUMPcomment"rootpartitionsdumpedwithtar"〃描述該類型的信息compressnone〃不采用壓縮indexyes〃備份集索,必須為yes(默認(rèn)為no),否則在恢復(fù)的時候?qū)⒉荒苷业娇苫謴?fù)的索引信息prioritylow}definetapetypeHARD-DISK{〃定義磁盤類型comment"disk-to-disk"length1000mbytes}9.創(chuàng)建虛擬磁帶#mkdir-p/amanda/DailySetl#amanda.conf中tapedev項(xiàng)#cd/amanda/DailySetl#fornin'seq18'jdomkdir/Amanda/DailySetl/slot${n};done#touchinfo#ln-sslotldata #創(chuàng)建鏈接文件#chownamanda.disk/amanda #更改目錄屬主,備份時使用amanda用戶,必須使其有權(quán)限?10.添加備份項(xiàng),這里備份38上的/data目錄?#vim/etc/amanda/DailySet1/disklistC/datacomp-root-tar #最后一行注釋掉?創(chuàng)建tapelist文件#touch/etc/amanda/DailySet1/tapelist#chownamanda.diskZetc/amanda/DailySet1/tapelist?制作虛擬磁盤卷標(biāo)與使用磁帶機(jī)ー樣,使用前也需要為虛擬磁盤創(chuàng)建卷標(biāo)#su-amanda$/usr/sbin/amlabelDailySetlDailySet1-01slot1#若成功則顯示如下,其它省略changer:gotexit:0str:1file:/amanda/Dailyset1labelingtapeinslot1(file:/amanda/Dailyset1):rewinding,readinglabel,notanamandatape(Read0bytes)rewinding,writinglabelDailySetl-01,checkinglabel,done.$for((i=2;i<=8;i++));do/usr/sbin/amlabelDailySetlDailySetl-0$islot$i;done?建立curinfo和index目錄或文件#與amanda.config文件定義有關(guān)mkdir-p/etc/amanda/DailySet1/curinfo/client/_var_logtuochZetc/amanda/DailySet1/curinfo/client/_var_log/info#mkdir/etc/amanda/DailySet1/curinfo/client/_datatouch/etc/amanda/DailySet1/curinfo/client/_data/info#mkdir-p/etc/amanda/DailySet1/index/client/_var_log#mkdir/etc/amanda/DailySet1/index/client/_datachown-Ramanda.disk/etc/amanda/DailySet1/curinfo#權(quán)限更改很重要chown-Ramanda.disk/etc/amanda/DailySet1/index?創(chuàng)建holdingdisk位置,amanda.conf文件需求#mkdir/dumps/amanda#chown-Ramanda.disk/dumps11.#vim/etc/Amanda/DailySet1/Amanda-client.conf12.配置測試測試使用的命令為amcheck,必須su到amanda用戶#su-amanda$/usr/sbin/amcheckDailySetl#默認(rèn)檢查選項(xiàng)csAmandaTapeServerHostCheckHoldingdisk/dumps/amanda:188781820KBdiskspaceavailable,using188679420KBslot1:readlabelDailySetl-01',dateX'NOTE:skippingtape-writabletestTapeDailySetl-01labelokServerchecktook0.105secondsAmandaBackupClientHostsCheckClientcheck:1hostcheckedin0.000seconds,0problemsfound(broughttoyoubyAmanda2.5.0p2)顯示如上則表示配置無誤附:amcheck命令選項(xiàng)amcheck(su-amanda)默認(rèn)時為-cs-s檢測服務(wù)端狀態(tài)及磁帶狀態(tài)-c檢測客戶端狀態(tài)-I服務(wù)端測試-t服務(wù)端tape測-m有錯誤時發(fā)送mail給用戶(mailto)-a發(fā)送mai!給用戶-M+mailadderss需求測試.備份測試#su-amanda$/usr/sbin/amdumpDailySetl#按照DailySetl設(shè)置備份數(shù)據(jù)DISKplannerclient/dataSTARTplannerdate20100930STARTdriverdate20100930STATSdriverstartuptime0.039FINISHplannerdate20100930time0.127STARTtaperdatestamp20100930labelDailySet1-01tape0SUCCESSdumperclient/data201009301[sec0.025kb34kps1320.9orig-kb100]SUCCESSchunkerclient/data201009301[sec0.061kb34kps1070.8]SUCCESStaperclient/data201009301[sec0.002kb96kps41308.1{wr:writers3rdwait0.000wrwait0.000filemark0.000}]INFOtapertapeDailySet1-01kb96fm1[OK]FINISHdriverdate20100930time0.365?創(chuàng)建cron周期任務(wù)#crontab-uamanda-e #如下:*1***/usr/local/sbin/amdumpDailySetl附:amdump命令及amcleanup命令amdumpamdumpconfig[host[disk...]...] 一般放在cron周期事務(wù)中example:runsamdumpeveryweeknightat1a.m.asuserbin:01**1-5bin/usr/local/sbin/amdumpdaily#daily為配置名稱注意兩點(diǎn):1ヽwaitingforholdfiletoberemoved2、amdumporamflushisalreadyrunning,oryoumustrunamcleanupamcleanupamcleanup可以產(chǎn)生amanda的郵件報告并且在客戶機(jī)在備份到tapeserver失敗后,更新amanda的數(shù)據(jù)庫。amdump進(jìn)程一般會在amdump之前自動運(yùn)行,但是有時amdump不能使它運(yùn)行,這時需要手動運(yùn)行。在備份機(jī)宕機(jī)后,我們應(yīng)該在系統(tǒng)啟動中使用amcleanup命令。我們可以將命令放到/etc/rc.local文件中/usr/local/sbin/amcleanupdaily如果一切正常(amcleanupdonenothing)會出現(xiàn)下面的提示:amcleanup:nounprocessedlogfiletocleanup. 還原時使用的是client,必須使用root用戶進(jìn)行還原,而且我們選擇進(jìn)入到需要還原的目錄下,這樣我們不用再進(jìn)行備份地址的選擇。[root@clientdata]#amrecoverDailySetl-sserver-tserver#-s是指定索引的主機(jī)名?t指定備份機(jī)的主機(jī)名(IP也可以)?如果配置正常的話則會自動進(jìn)行還原數(shù)據(jù)。以下是手動還原的方法:amrecover>listdiskListofdiskforhostclient/data200Listofdiskforhostclientamrecover>setdisk/data200Disksetto/data.amrecover>amrecover>setdate2010-09-30200Workingdatesetto2010-09-30.amrecover>ls2010-09-30yum.conf2010-09-30yp.conf2010-09-30xinetd.conf2010-09-30rwtab2010-09-30rpc-More-amrecover>addyum.conf#查看磁盤#選擇磁盤#選擇日期#列出備份過的文件#增加還原內(nèi)容yum.confadd/為還原全部內(nèi)容到/data目錄Added/yum.conf#増加還原內(nèi)容#増加還原內(nèi)容xinetd.confAdded/xinetd.confamrecover>extract #取出這兩個文件Extractingfilesusingtapedrivenull:onhost42.Thefollowingtapesareneeded:DailySet1-08Restoringfilesintodirectory/dataContinue[?/Y/n]?YExtractingfilesusingtapedrivenull:onhost42.LoadtapeDailySet1-08nowContinue[?/Y/n/s/t]?Y./xinetd.conf,/yum.confamrecover>?還原結(jié)束。退出amrecover1進(jìn)行查看amrecover>quit200Goodbye.[root@clientdata]#IItotal16-rw-r-r-1rootroot1001Oct814:31xinetd.conf-rw-r-r-1rootroot333Oct814:31yum.conf[root@clientdata]#amadmin工具(下面英文較多,自己看)amadmin控制amanda備份的管理接口配置文件configAmandaamadminconfigcommand[commandoptions]如果disklist文件中沒有指定磁盤時,命令中將需要指定hostname[disks][Bothhostnameanddisksarespecialexpressions,seethe"HOST&DISKEXPRESSION"sectionofamanda(8)foradescription.]@force-bump[hostname[disks]*]+強(qiáng)制hostname上的disk在下一次amanda運(yùn)行時使用増量備份@force-no-bump[hostname[disks]*]+強(qiáng)制hostname上的disk不在下一次amanda運(yùn)行時使用増?備份@unforce-bump[hostname[disks]*]+不使用force-bump或force-no-bump命令@force[hostname[disks]*]+強(qiáng)制hostname上的disk在下一次amanda運(yùn)行時使用完全(level。)備份@unforce[hostname[disks]*]+不使用強(qiáng)制命令@reusetapelabel[...]在它們周期結(jié)束后重新使用tape@no-reusetapelabel[...]在它們周期結(jié)束后不重新使用tape,如果tape用盡,amanda則請求新的tape并使計(jì)數(shù)正確。@due[hostname[disks]*]?查看下一次完全備份的時間@find[-sorthkdlpb][hostname[disks]*]*Displayallbackupscurrentlyontapeorintheholdingdisk.Thetapelabelorholdingdiskfilename,filenumber,andstatusaredisplayed.The-sortoptionchangesthesortorderusingthefollowingflags:hhostnamekdisknameddumpdateIbackuplevelpdumppartbtapelabel〇Anuppercaseletterreversesthesortorderforthatkey.Thedefaultsortorderishkdlpb.@delete[hostname[disks]*]+刪除disk如果沒有從disklist中去掉disk,則下一次運(yùn)行時amanda將認(rèn)為它是ー個新的disk@bumpsize顯示當(dāng)前預(yù)先預(yù)留的全部備份等級的入口參數(shù)@balance[-days<num>]顯示分配的備份時間表@export[hostname[disks]*]?將amanda中的數(shù)據(jù)記錄轉(zhuǎn)換為文本格式,用于將該文件傳送到另外的amanda服務(wù)器并輸入@importamanda數(shù)據(jù)庫的導(dǎo)入(參照export)@disklist[hostname[disks]*]?顯示所有在hostname中的disk的信息。通常用作査找調(diào)試debug@info[hostname[disks]*]*顯示所有在hostname中的disk的amanda數(shù)據(jù)庫的記錄信息。通常用作調(diào)試debugEXAMPLES(示例)Requestthreespecificfilesystemsonmachine-agetafulllevel0backupduringthenextAmandarun.$amadmindailyforcemachine-a//var/usramadmin:machine-a:/issettoaforcedlevel0tonight.amadmin:machine-a:/varissettoaforcedlevel0tonight.amadmin:machine-a:/usrissettoaforcedlevel0tonight.Requestallfilesystemsonmachine-bgetafulllevel0backupduringthenextAmandarun.$amadmindailyforcemachine-bamadmin:machine-b:/issettoaforcedlevel0tonight.amadmin:machine-bソvarissettoaforcedlevel0tonight.amadmin:machine-b:/usrissettoaforcedlevel0tonight.amadmin:machine-b:/homeissettoaforcedlevel0tonight.Undothepreviousforcerequestfor/homeonmachine-b.Theotherfilesystemswillstillgetafulllevel0backup.$amadmindailyunforcemachine-b/homeamadmin:forcecommandformachine-b:/homecleared.Locatebackupimagesof/varfrommachine-c.Thetapeorfilecolumndisplayseitheratapelabelorafilenamedependingonwhethertheimageisontapeorisstillintheholdingdisk.Iftheimageisontape,thefilecolumntellsyouwhichfileonthetapehastheimage(filenumberzeroisatapelabel).Thiscolumnshowszeroandisnotmeaningfuliftheimageisstillintheholdingdisk.Thestatuscolumntellsyouwhetherthebackupwassuccessfulorhadsometypeoferror.$amadmindailyfindmachine-c/vardatehostdiskIvtapeorfilefilepartstatus2000-11-09machine-c/var00001109-OK2000-11-08machine-c/var20001092-OK2000-11-07machine-c/var2/amanda/20001107/machine-c._var.20OK2000-11-06machine-c/var20001072-OK2000-11-05machine-c/var20001063-OKthatmaybetransmittedtoanotherAmandamachineandimported.importConvertexportedrecordsreadfromstandardinputtoaformAmandausesandinsertthemintothedatabaseonthismachine.disklist[hostname[disks]*]*Displaythedisklistinformationforeachofthedisksonhostname(orallhosts).Mostlyusedfor[hostname[disks門?Displaythedatabaserecordforeachofthedisksonhostname(orallhosts).Mostlyusedfordebugging.EXAMPLESRequestthreespecificfilesystemsonmachine-agetafulllevel0backupduringthenextAmandarun.$amadmindailyforcemachine-a//var/usramadmin:machine-a:/issettoaforcedlevel0tonight.amadmin:machine-a:/varissettoaforcedlevel0tonight.amadmin:machine-a:/usrissettoaforcedlevel0tonight.Requestallfilesystemsonmachine-bgetafulllevel0backupduringthenextAmandarun.$amadmindailyforcemachine-bamadmin:machine-b:/issettoaforcedlevel0tonight.amadmin:machine-b:/varissettoaforcedlevel0tonight.amadmin:machine-b:/usrissettoaforcedlevel0tonight,amadmin:machine-b:/homeissettoaforcedlevel0tonight.Undothepreviousforcerequestfor/homeonmachine-b.Theotherfilesystemswillstillgetafulllevel0backup.$amadmindailyunforcemachine-b/homeamadmin:forcecommandformachine-b:/homecleared.Locatebackupimagesof/varfrommachine-c.Thetapeorfilecolumndisplayseitheratapelabelorafilenamedependingonwhethertheimageisontapeorisstillintheholdingdisk.Iftheimageisontape,thefilecolumntellsyouwhichfileonthetapehastheimage(filenumberzeroisatapelabel).Thiscolumnshowszeroandisnotmeaningfuliftheimageisstillintheholdingdisk.Thestatuscolumntellsyouwhetherthebackupwassuccessfulorhadsometypeoferror.$amadmindailyfindmachine-c/vardatehostdiskIvtapeorfilefilepartstatus2000-11-09machine-c/var00001109-OK2000-11-08machine-c/var20001092-OK2000-11-07machine-c/var2/amanda/20001107/machine-c.var.20OK2000-11-06machine-c/var20001072-OK2000-11-05machine-c/var20001063—OK2000-11-04machine-c/var20001052-OK2000-11-03machine-c/var20001042-OK2000-11-02machine-c/var20001032-OK2000-11-01machine-c/var10001025-OK2000-10-31machine-c/var10001013-OKForgetaboutthe/workspacediskonmachine-d.Ifyoudonotalsoremovethediskfromthedisklistfile,Amandawilltreatitasanewdiskduringthenextrun.$amadmindailydeletemachine-d/workspaceamadmin:machine-d:/workspacedeletedfromdatabase.amadmin:NOTE:you?.lhavetoremovethesefromthedisklistyourself.FindthenexttapeAmandawilluse(inthiscase,123456).$amadmindailytapeThenextAmandarunshouldgoontotape123456oranewtape.Showhowwellfullbackupsarebalancedacrossthedumpcycle.Thedue-datecolumnisthedaythebackupsaredueforafullbackup.#fsshowsthenumberoffilesystemsdoingfullbackupsthatnight,andorigKBandoutKBshowtheestimatedtotalsizeofthebackupsbeforeandafteranycompression,respectively.Thebalancecolumnshowshowfaroffthatnight?,backupsarefromtheaveragesize(shownatthebottomofthebalancecolumn).Amandatriestokeepthebackupswithin+/-5%,butsincetheamountofdata
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- GB/T 46848.7-2025技術(shù)產(chǎn)品文件產(chǎn)品設(shè)計(jì)數(shù)據(jù)管理要求第7部分:簽審與發(fā)放
- 遼寧省遼陽市2025-2026學(xué)年高一上學(xué)期1月期末考試政治試卷
- 2026佛山市順德區(qū)容桂幸福陳占梅小學(xué)招募實(shí)習(xí)教師10人備考考試試題附答案解析
- 2026陜西西北工業(yè)大學(xué)自動化學(xué)院唐煒團(tuán)隊(duì)招聘1人參考考試試題附答案解析
- 2026中國航空工業(yè)集團(tuán)有限公司華東審計(jì)中心崗位招聘18人備考考試試題附答案解析
- 2026河南洛陽古都麗景控股集團(tuán)有限公司招聘9人參考考試題庫附答案解析
- 2026湖南懷化溆浦縣衛(wèi)生健康局公益性崗位招聘備考考試試題附答案解析
- 2026西安未央湖社區(qū)衛(wèi)生服務(wù)中心招聘備考考試試題附答案解析
- 2026湖南長沙市芙蓉區(qū)定王臺街道社區(qū)衛(wèi)生服務(wù)中心招聘備考考試試題附答案解析
- 2026年河北衡水市人民醫(yī)院寒假志愿者招募參考考試試題附答案解析
- 漁夫和他的靈魂-練習(xí)及答案
- 探析鐵路橋涵施工中缺陷和應(yīng)對策略
- LYT 1279-2020聚氯乙烯薄膜飾面人造板
- 聲樂教學(xué)與藝術(shù)指導(dǎo)的有效結(jié)合淺析
- 電解質(zhì)紊亂護(hù)理查房-課件
- 城市軌道交通工程竣工驗(yàn)收管理培訓(xùn)
- 運(yùn)動訓(xùn)練的監(jiān)控
- GB/T 6730.62-2005鐵礦石鈣、硅、鎂、鈦、磷、錳、鋁和鋇含量的測定波長色散X射線熒光光譜法
- 中考?xì)v史第一輪復(fù)習(xí)教案
- 中國郵政《國際及臺港澳郵件處理規(guī)則》
- 植物病害發(fā)生發(fā)展
評論
0/150
提交評論