安裝ctdb:
yum install ctdb
rpm -qa |grep ctdb
ctdb-4.10.4-10.el7.x86_64
vim /etc/ctdb/nodes
10.14.151.110
10.14.151.145
10.14.151.108
vim /etc/ctdb/public_addresses
10.14.151.244/24 eth0
mkdir /var/lib/ctdb/volatile
mkdir /var/lib/ctdb/persistent
mkdir /var/lib/ctdb/state
mkdir -p /etc/ctdb/events/legacy
cat /etc/ctdb/ctdb.conf |grep -v "#"|grep -v "^$"
[logging]
[cluster]
[legacy]
realtime scheduling = false
systemctl start ctdb
ctdb version
4.10.4
ctdb status
Number of nodes:3
pnn:0 10.14.151.110 OK
pnn:1 10.14.151.145 OK (THIS NODE)
pnn:2 10.14.151.108 OK
Generation:1650883701
Size:3
hash:0 lmaster:0
hash:1 lmaster:1
hash:2 lmaster:2
Recovery mode:NORMAL (0)
Recovery master:2
ctdb ip
Public IPs on node 1
10.14.151.244 2
如截圖畴博,確保/etc/ctdb/events/legacy目錄下有這幾個(gè)腳本文件,多余的刪除掉:
cp /usr/share/ctdb/events/legacy/* /etc/ctdb/events/legacy/
查看VIP是否啟動(dòng):
ctdb報(bào)錯(cuò):
Unable to set scheduler to SCHED_FIFO (Operation not permitted)
在配置文件中添加(/etc/ctdb/ctdb.conf):
[legacy]
realtime scheduling = false
ctdb問題可參考:
<u>https://forums.centos.org/viewtopic.php?t=71812</u>
ctdb高可用驗(yàn)證蓝仲,故障模擬測試:
現(xiàn)vip 在node 0上:
windows通過VIP掛載:
關(guān)閉node0(10.14.151.110)的ctdb:
systemctl stop ctdb
現(xiàn)VIP己自動(dòng)切到node1 上
在windows上測試寫數(shù)據(jù)俱病,沒問題。