corosync(web)


所需軟件包:

cluster-glue-1.0.6-1.6.el5.i386.rpm       heartbeat-libs-3.0.3-2.3.el5.i386.rpm  

pacemaker-cts-1.1.5-1.1.el5.i386.rpm      cluster-glue-libs-1.0.6-1.6.el5.i386.rpm  

libesmtp-1.0.4-5.el5.i386.rpm             pacemaker-libs-1.1.5-1.1.el5.i386.rpm

corosync-1.2.7-1.1.el5.i386.rpm           openais-1.1.3-1.6.el5.i386.rpm        

perl-TimeDate-1.16-5.el5.noarch.rpm       corosynclib-1.2.7-1.1.el5.i386.rpm        

openaislib-1.1.3-1.6.el5.i386.rpm         resource-agents-1.0.4-1.1.el5.i386.rpm

heartbeat-3.0.3-2.3.el5.i386.rpm          pacemaker-1.1.5-1.1.el5.i386.rpm


一:IP地址hosts文件以及主機名配置

134921108.jpg134940118.jpg

修改主機名和hosts文件

server1:

shell>hostname server1.gz.com

shell>vim /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=server1.gz.com

shell>vim /etc/hosts

192.168.2.10  server1.gz.com

192.168.2.20  server2.gz.com


server2:

shell>hostname server2.gz.com

shell>vim /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=server2.gz.com

shell>vim /etc/hosts

192.168.2.10  server1.gz.com

192.168.2.20  server2.gz.com


二:軟件安裝


在根目錄下新建一個corosync文件夾,將軟件包全部上傳到此文件夾下。

shell>cd /corosync

shell>yum  localinstall  *rpm  --nogpgcheck


三:配置corosync

shell>cd /etc/corsync

shell> cp  -p corosync.conf.example corosync.conf

shell> vim corosync.conf

compatibility: whitetank

totem {

       version: 2

       secauth: off

       threads: 0

       interface {

               ringnumber: 0

               bindnetaddr: 192.168.2.0

               mcastaddr: 226.94.1.1

               mcastport: 5405

       }

}

logging {

       fileline: off

       to_stderr: no

       to_logfile: yes

       to_syslog: yes

       logfile: /var/log/cluster/corosync.log

       debug: off

       timestamp: on

       logger_subsys {

               subsys: AMF

               debug: off

       }

}

shell> mkdir /var/log/cluster/   #新建羣集日誌目錄

shell> corosync-keygen

shell> service corosync start


檢查錯誤以及查看啓動過程

shell>grep -i -e "corosync cluster engine" -e "configuration file" /var/log/messages

shell>grep -i totem /var/log/messages

shell>grep -i error /var/log/messages

shell>grep -i pcmk_startup  /var/log/messages


安裝服務

shell>yum install httpd


定義資源服務

shell>crm

crm(live)configure# primitive webip ocf:heartbeat:IPaddr params ip=192.168.2.100

crm(live)configure# property stonith-enabled=false

crm(live)configure# group webgroup webip webserver

crm(live)configure# property no-quorum-policy=ignore


四:測試





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章