參考文章:http://www.6tech.org/2013/03/linux-firewall-cluster-with-pacemaker-and-corosync/
系統(tǒng) centos6.4-x86_64
前提 各節(jié)點服務(wù)器 1構(gòu)建第三方源配置完畢;2搭建好rsync服務(wù)。
(第三方源 http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-6/x86_64/)
安裝基本軟件(各節(jié)點服務(wù)器)
創(chuàng)新互聯(lián)公司是一家專業(yè)提供新余企業(yè)網(wǎng)站建設(shè),專注與網(wǎng)站設(shè)計制作、網(wǎng)站建設(shè)、成都h5網(wǎng)站建設(shè)、小程序制作等業(yè)務(wù)。10年已為新余眾多企業(yè)、政府機構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站設(shè)計公司優(yōu)惠進(jìn)行中。
yum install -y vim git make automake gcc gcc-c++ glibc gd gd-devel glib-devel glibc-headers wget curl tar nc libcurl-devel openssl-devel zlib-devel zlib patch readline readline-devel libffi-devel curl-devel zip rsync ruby rubygems ruby-devel htop mlocate python-dateutil redhat-rpm-config ntp |
修改hosts文件,添加虛擬IP解析
vim /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.0.0.101 vm01-centos 10.0.0.102 vm02-centos 10.0.0.103 vm03-centos |
Install Pacemaker: (Do on all servers)
yum install -y pacemaker cman ccs corosync pssh crmsh |
添加開機啟動
chkconfig pacemaker on |
Create Corosync Key: (Only do on the first server)
corosync-keygen |
Set permissions on the key: (Do first server)
chown root:root /etc/corosync/authkeychmod 400 /etc/corosync/authkey |
拷貝至其他節(jié)點
rsync –avh /etc/corosync/authkey root@10.0.0.101:/etc/corosync/authkeyrsync –avh /etc/corosync/authkey root@10.0.0.103:/etc/corosync/authkey |
Install a base corosync config: (Do on first server)
cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf