corosync+pacemaker安裝配置實(shí)驗(yàn)_第1頁
corosync+pacemaker安裝配置實(shí)驗(yàn)_第2頁
corosync+pacemaker安裝配置實(shí)驗(yàn)_第3頁
corosync+pacemaker安裝配置實(shí)驗(yàn)_第4頁
corosync+pacemaker安裝配置實(shí)驗(yàn)_第5頁
已閱讀5頁,還剩1頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

Corosync安裝測試一、實(shí)驗(yàn)要求1、corosync+pacemaker集群安裝測試二、架構(gòu)拓?fù)渚W(wǎng)絡(luò)要求:所有服務(wù)器位于同一VLan機(jī)器無特殊要求。三、系統(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ā)包,以及支持庫[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)庫[shell]#./autogen.sh##用于生成configure文件[shell]#./configure[shell]#make&&makeinstall##使用yum安裝pcs&pcsd(Pacemaker/Corosync配置工具)[shell]#yum-yinstallpcs#注:可以編譯安裝resource-agents以獲取更多ocf格式資源包,也可以使用crmshCLI工具來配置管理群集。#推薦使用yum安裝corosync+pacemaker[shell]#yum-yinstallcorosyncpacemakerpcs2.3、拷貝配置文件、啟動腳本[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啟動軟件[shell]#ldconfig–v##刷新系統(tǒng)運(yùn)行庫緩存[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、因沒有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##啟動pcsd服務(wù)七、測試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. 本站所有資源如無特殊說明,都需要本地電腦安裝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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論