corosync+pacemaker安裝配置實驗_第1頁
corosync+pacemaker安裝配置實驗_第2頁
corosync+pacemaker安裝配置實驗_第3頁
corosync+pacemaker安裝配置實驗_第4頁
corosync+pacemaker安裝配置實驗_第5頁
已閱讀5頁,還剩1頁未讀, 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

Corosync安裝測試一、實驗要求1、corosync+pacemaker集群安裝測試二、架構拓撲網絡要求:所有服務器位于同一VLan機器無特殊要求。三、系統環境1、操作系統:CentOS6.62、相關軟件:corosync、pacemaker、pcs3、網絡要求:/etc/hosts文件添加雙方主機名列表。四、地址規劃名稱角色IP地址虛擬IP地址CentOS-66A主服務器15CentOS-66B從服務器25五、安裝軟件1、安裝支持軟件#在編譯安裝之前,必須安裝內核開發包,以及支持庫[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、創建所需的用戶和組#在編譯安裝之前,創建軟件所需的用戶(hacluster)和組(haclient)[shell]#groupadd-g201haclient[shell]#useradd-ghaclient-u201-s/sbin/nologin-Mhacluster[shell]#passwdhacluster##設置群集管理用戶的密碼2.2、編譯安裝corosync、pacemaker、pcs軟件,使用默認路徑安裝。##編譯安裝corosync(作為通信層并提供關系管理服務)[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(實現資源管理)[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相關庫[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##刷新系統運行庫緩存[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##使用多個心跳接口時,必須指定rrp_mode參數: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}}##只有二個群集節點時,corosync2.x配置文件中必須配置quorum內容:quorum{ #Enablethetwo_nodesdirectiveprovider:corosync_votequorumexpected_votes:2two_node:1}##加載CorosyncPacemakerplugin[shell]#vi/etc/corosync/service.d/pcmkservice{ #LoadthePacemakerClusterResourceManager name:pacemaker ver:1}##推薦:corosync節點使用加密通信,利用“/dev/random”隨機數函數生成密鑰[shell]#corosync-keygen[shell]#scp/etc/corosync/authkeyroot@2:/etc/corosync/2、配置群集主機間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##配置群集節點的認證asthehaclusteruser:[shell]#pcsclusterauthnode11node12[shell]#pcsclustersetup--namemyclusternode11node12…………4、因沒有Fencing設備,禁用STONITH組件功能##TodisableSTONITH,setthestonith-enabledclusteroptiontofalse:[shell]#pcspropertysetstonith-enabled=false[shell]#crm_verify-L-V5、二個節點時,禁用quorum策略功能[shell]#pcspropertysetno-quorum-policy=ignore6、pcsd相關配置(/usr/lib/pcsd/)##啟用pcsd(pscwebgui)遠程管理,端口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服務七、測試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附:錯誤處理A、軟件編譯時錯誤解決辦法: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、軟件運行時錯誤處理1、[shell]#pcsclusterauthnode21node22Error:unabletoconnecttopcsdonnode21Er

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論