兩個主機 相同的配置
安裝 corosync.x86_64
pssh-2.3.1-2.1.x86_64.rpm
crmsh-1.2.6-0.rc2.2.1.x86_64.rpm
/etc/corosync/corosync.conf
4 totem {
5 version: 2
6 secauth: off
7 threads: 0
8 interface {
9 ringnumber: 0
10 bindnetaddr: 172.25.28.0
11 mcastaddr: 226.94.1.1 #多播地址
12 mcastport: 54070 #多播端口
13 ttl: 1
14 }
15 }
34 service{
35 name: pacemaker #啓動 pacemaker
36 ver: 0
37 }
crm_verify -LV 檢測配置信息
crm_mon 監控主機狀態
error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined
error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option
error: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity
Errors found during check: config not valid
crm configure property stonith-enabled=false #設置爲 false 來關閉STONITH
crm configure primitive vip ocf:heartbeat:IPaddr2 params ip=172.25.28.70 cidr_netmask=32 op monitor interval=10s #添加VIP信息
crm configure primitive apache ocf:heartbeat:apache params configfile=/etc/httpd/conf/httpd.conf op monitor interval=20s #添加Apache
配置Apache
/etc/httpd/conf/httpd.conf
921 <Location /server-status>
922 SetHandler server-status
923 Order deny,allow
924 Deny from all
925 Allow from 127.0.0.1
926 </Location>
cleanup apache server27.example.com
以上可能造成 vip 和 Apache 不再一個服務器上
解決方法:
crm configure colocation apache-with-vip inf:mysite vip
雙方服務器有一方掛掉 ,整個業務就停止。改進當一方掛掉,另一方接替工作
crm configure property no-quorum-policy=ignore
增加fence 功能
crm configure property stonish-enable=true
主機生成 fence_xvm.key 發給 corosync 兩臺主機 /etc/cluster
dd if=/dev/urandom of=/etc/cluster/fence_xvm.key bs=128 count=1
開啓主機fence
systemctl start fence_virtd
vm2 對應 server26.example.com vm1 對應 server27.example.com
crm configure primitive vmfence stonith:fence_xvm params pcmk_host_map=server26.example.com:vm2;server27.example.com:vm1 op monitor interval=1min
增加 ISCSI 共享磁盤
iscsiadm -m discovery -t st -p 172.25.28.28
iscsiadm -m node -l
fdisk /dev/sda
mkfs.ext4 /dev/sda1
crm configure primitive webdata ocf:heartbeat:Filesystem params device=/dev/sda1 directory=/var/www/html fstype=ext4 op monitor interval=1min
crm configure group webgroup vip webdata mysite 設置組和 服務順序
HA corosync 配置學習筆記
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Android平臺調用WebService詳解
推薦碼發放
2019-02-24 19:41:33
linux上安裝Docker(非常簡單的安裝方法)
幸運券發放
2019-02-24 19:38:01
Nagios 3.2 監控部署(二)
samplelife
2019-02-23 13:57:36
用SSH登陸Linux很慢的解決
zzkjia
2019-02-23 13:30:42
Linux系統中ftp服務的搭建
小陳102
2019-02-23 13:16:35
Linux系統中Samba共享搭建
小陳102
2019-02-23 13:16:34
LINUX下web service的實現
小雞變鳥
2019-02-23 00:41:49
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization
soda119
2019-02-23 13:17:01
CentOS下設置網卡的工作模式的例子
zwyffs
2019-02-23 12:55:52
Cisco VRRP configuration
Yeexw
2019-02-23 12:55:22
標準控制訪問列表的實現
小雞變鳥
2019-02-23 00:41:50
centos ***
samplelife
2019-02-23 13:57:36
交換機的基本配置實驗報告
乘風來
2019-02-23 13:00:59
交換機的基本配置實驗報告
1406404037
2019-02-23 12:50:57