天天看點

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檔案以及主機名配置

corosync(web)
corosync(web)

修改主機名和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

HOSTNAME=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

四:測試

上一篇: uname

繼續閱讀