corosync(web)

來源:互聯網
上載者:User

標籤:軟體包


所需軟體包:

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

650) this.width=650;" alt="134921108.jpg" src="http://img1.51cto.com/attachment/201311/134921108.jpg" />650) this.width=650;" alt="134940118.jpg" src="http://img1.51cto.com/attachment/201311/134940118.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


四:測試





corosync(web)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.