




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
Corosync安裝測(cè)試一、實(shí)驗(yàn)要求1、corosync+pacemaker集群安裝測(cè)試二、架構(gòu)拓?fù)渚W(wǎng)絡(luò)要求:所有服務(wù)器位于同一VLan機(jī)器無(wú)特殊要求。三、系統(tǒng)環(huán)境1、操作系統(tǒng):CentOS6.62、相關(guān)軟件:corosync、pacemaker、pcs3、網(wǎng)絡(luò)要求:/etc/hosts文件添加雙方主機(jī)名列表。四、地址規(guī)劃名稱角色I(xiàn)P地址虛擬IP地址CentOS-66A主服務(wù)器15CentOS-66B從服務(wù)器25五、安裝軟件1、安裝支持軟件#在編譯安裝之前,必須安裝內(nèi)核開發(fā)包,以及支持庫(kù)[shell]#yum-yinstallgccgcc-c++kernel-developensslopenssl-devel[shell]#yum-yinstallautomakeautoconfpkgconfignssnss-devel[shell]#yum-yinstalllibqblibqb-devellibtoollibtool-ltdl-devel[shell]#yum-yinstallglib2glib2-devellibuuidlibuuid-devel[shell]#yum-yinstalllibxml2libxml2-devellibxsltlibxslt-devel[shell]#yum-yinstallbzip2bzip2-develdbusdbus-devel[shell]#yum-yinstallpampam-devellibesmtplibesmtp-devel[shell]#yum-yinstallfence-agentsresource-agentsdocbook-style-xsl[shell]#yum-yinstallcluster-gluecluster-glue-libscluster-glue-libs-devel[shell]#yum-yinstallgnutlsgnutls-develpythonpython-develpython-lxml2.1、創(chuàng)建所需的用戶和組#在編譯安裝之前,創(chuàng)建軟件所需的用戶(hacluster)和組(haclient)[shell]#groupadd-g201haclient[shell]#useradd-ghaclient-u201-s/sbin/nologin-Mhacluster[shell]#passwdhacluster##設(shè)置群集管理用戶的密碼2.2、編譯安裝corosync、pacemaker、pcs軟件,使用默認(rèn)路徑安裝。##編譯安裝corosync(作為通信層并提供關(guān)系管理服務(wù))[shell]#tar-xvzfcorosync-2.3.4.tar.gz-C/usr/local/src[shell]#cd/usr/local/src/corosync-2.3.4[shell]#./configure##--prefix=/usr/local/corosync[shell]#make&&makeinstall##編譯安裝pacemaker(實(shí)現(xiàn)資源管理)[shell]#tar-xvzfpacemaker-master.tar.gz-C/usr/local/src[shell]#cd/usr/local/src/pacemaker-master[shell]#exportPKG_CONFIG_PATH=/usr/lib64/pkgconfig##指定corosync相關(guān)庫(kù)[shell]#./autogen.sh##用于生成configure文件[shell]#./configure[shell]#make&&makeinstall##使用yum安裝pcs&pcsd(Pacemaker/Corosync配置工具)[shell]#yum-yinstallpcs#注:可以編譯安裝resource-agents以獲取更多ocf格式資源包,也可以使用crmshCLI工具來(lái)配置管理群集。#推薦使用yum安裝corosync+pacemaker[shell]#yum-yinstallcorosyncpacemakerpcs2.3、拷貝配置文件、啟動(dòng)腳本[shell]#mkdir-p/etc/cluster/[shell]#ln-s/etc/rc.d/init.d/corosync/etc/rc.d/init.d/cman[shell]#ln-s/usr/sbin/corosync-cmapctl/usr/sbin/corosync-objctl[shell]#cp/etc/corosync/corosync.conf.example/etc/corosync/corosync.conf2.4啟動(dòng)軟件[shell]#ldconfig–v##刷新系統(tǒng)運(yùn)行庫(kù)緩存[shell]#servicepcsdstart[shell]#servicecorosyncstart[shell]#servicepacemakerstart六、軟件配置1、主配置文件(/etc/corosync/corosync.conf):[shell]#vi/etc/corosync/corosync.conf#Pleasereadthecorosync.conf.5manualpagetotem{version:2secauth:offthreads:0rrp_mode:active##使用多個(gè)心跳接口時(shí),必須指定rrp_mode參數(shù):none,active,orpassiveinterface{ringnumber:0bindnetaddr:mcastaddr:mcastport:5405ttl:1}##配置第二條心跳路徑的接口IPinterface{ringnumber:1bindnetaddr:mcastaddr:mcastport:5405ttl:1}}logging{fileline:offto_stderr:noto_logfile:yeslogfile:/var/log/cluster/corosync.logto_syslog:yesdebug:offtimestamp:onlogger_subsys{subsys:AMFdebug:off}}##只有二個(gè)群集節(jié)點(diǎn)時(shí),corosync2.x配置文件中必須配置quorum內(nèi)容:quorum{ #Enablethetwo_nodesdirectiveprovider:corosync_votequorumexpected_votes:2two_node:1}##加載CorosyncPacemakerplugin[shell]#vi/etc/corosync/service.d/pcmkservice{ #LoadthePacemakerClusterResourceManager name:pacemaker ver:1}##推薦:corosync節(jié)點(diǎn)使用加密通信,利用“/dev/random”隨機(jī)數(shù)函數(shù)生成密鑰[shell]#corosync-keygen[shell]#scp/etc/corosync/authkeyroot@2:/etc/corosync/2、配置群集主機(jī)間SSH信任連接[shell]#ssh-keygen-trsa[shell]#scp/root/.ssh/id_rsa.pubroot@2:/root[shell]#cat/root/id_rsa.pub>>/root/.ssh/authorized_keys3、配置群集ConfigureCorosync##配置群集節(jié)點(diǎn)的認(rèn)證asthehaclusteruser:[shell]#pcsclusterauthnode11node12[shell]#pcsclustersetup--namemyclusternode11node12…………4、因沒(méi)有Fencing設(shè)備,禁用STONITH組件功能##TodisableSTONITH,setthestonith-enabledclusteroptiontofalse:[shell]#pcspropertysetstonith-enabled=false[shell]#crm_verify-L-V5、二個(gè)節(jié)點(diǎn)時(shí),禁用quorum策略功能[shell]#pcspropertysetno-quorum-policy=ignore6、pcsd相關(guān)配置(/usr/lib/pcsd/)##啟用pcsd(pscwebgui)遠(yuǎn)程管理,端口2224;[shell]#mv/usr/lib/pcsd/pcsd.rb/usr/lib/pcsd/pcsd.rb.bak[shell]#cp/usr/lib/pcsd/pcsd.rb.disable-gui/usr/lib/pcsd/pcsd.rb[shell]#servicepcsdrestart##啟動(dòng)pcsd服務(wù)七、測(cè)試1、可以使用命令查看日志文件:[shell]#tail-f/var/log/messages[shell]#tail-n30/var/log/pacemaker.log[shell]#tail-n30/var/log/cluster/corosync.log2、可以使用corosync-cfgtool命令查看群集:[shell]#corosync-cfgtool-sPrintingringstatus.LocalnodeID2130706433RINGID0id=status=ring0activewithnofaults[shell]#corosync-cmapctl|grepmembers3、可以使用pacemakerd-F命令查看安裝組件:[shell]#pacemakerd-FPacemaker1.1.12(Build:d262b21)Supportingv3.0.9:libqb-logginglibqb-ipclha-fencingupstartnagioscorosync-nativeatomic-attrdacls附:錯(cuò)誤處理A、軟件編譯時(shí)錯(cuò)誤解決辦法:1、configure:error:Packagerequirements(nss)werenotmet解決方式:yum-yinstallnssnss-develconfigure:error:Packagerequirements(libqb)werenotmet:解決方式:yum-yinstalllibqblibqb-devel3、configure:error:Youdonothavethelibuuiddevelopmentpackageinstalled解決方式:yum-yinstalllibuuidlibuuid-develglib2glib2-devel4、checkingforcpg...configure:error:Packagerequirements(libcpg)werenotmet:Nopackage'libcpg'found解決方式:exportPKG_CONFIG_PATH=/usr/local/corosync/lib/pkgconfig2、軟件運(yùn)行時(shí)錯(cuò)誤處理1、[shell]#pcsclusterauthnode21node22Error:unabletoconnecttopcsdonnode21Er
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 廚師外出培訓(xùn)協(xié)議書
- 化肥農(nóng)藥購(gòu)銷協(xié)議書
- 受損財(cái)產(chǎn)賠付協(xié)議書
- 以數(shù)字化提升教育領(lǐng)域中的學(xué)生團(tuán)隊(duì)協(xié)作效果探討
- 社會(huì)穩(wěn)定與變革的動(dòng)態(tài)平衡試題及答案
- 取消租房合同協(xié)議書
- 資金使用效率提升的試題及答案
- 從傳統(tǒng)到線上女包市場(chǎng)的數(shù)字化轉(zhuǎn)型之路
- 工程法規(guī)應(yīng)試策略試題及答案
- 從零開始搭建企業(yè)的數(shù)字化工作體系
- 網(wǎng)絡(luò)技術(shù)基礎(chǔ)知識(shí)試題及答案
- 2025年四川省自然資源投資集團(tuán)有限責(zé)任公司招聘筆試參考題庫(kù)附帶答案詳解
- 物業(yè)客服的測(cè)試題及答案
- JJF(紡織) 020-2024 織物厚度儀校準(zhǔn)規(guī)范
- 廣西專升本(高等數(shù)學(xué))模擬試卷2(共198題)
- 2025年陜西漢水電力實(shí)業(yè)(集團(tuán))有限責(zé)任公司招聘筆試參考題庫(kù)附帶答案詳解
- 穴位埋線治療
- 畢業(yè)設(shè)計(jì)(論文)-智能物料搬運(yùn)小車設(shè)計(jì)
- 《基礎(chǔ)護(hù)理學(xué)》第七版考試題庫(kù)大全-上部分(600題)
- DBJ45 024-2016 巖溶地區(qū)建筑地基基礎(chǔ)技術(shù)規(guī)范
- LY/T 3419-2024自然教育評(píng)估規(guī)范
評(píng)論
0/150
提交評(píng)論