您好,登錄后才能下訂單哦!
這篇文章主要介紹Gluster集群高可用性配置和節點增刪的示例分析,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
IP地址規劃
#vi /etc/hosts 200.192.100.101 glusternode1 #節點1地址 200.192.100.102 glusternode2 #節點2地址 200.192.100.100 glustervip #gluster服務地址
Volume Bricks規劃
在節點1,節點2上執行:
#mkdir /storage #mount /dev/vg01/lvstorage /storage
在節點1,節點2上安裝keepalived:
#yum install keepalived #vi /etc/keepalived/keepalived.conf ! Configuration File for keepalived vrrp_script chk_gluster { script "/etc/keepalived/check_gluster.sh" interval 2 global_defs { router_id LVS_DEVEL } vrrp_instance VI_1 { state MASTER #備服務器要改為BACKUP interface eth0 virtual_router_id 101 priority 100 #備服務器優先級要降低 advert_int 1 authentication { auth_type PASS auth_pass Pass2020wd } track_script { chk_gluster } virtual_ipaddress { 200.192.100.100/24 } } } :wq #vi /etc/keepalived/check_gluster.sh #!/bin/bash num=$(netstat -lnupt |grep glusterd | wc -l) if [ $num -eq 0 ];then systemctl start glusterd gluster volume start storage force if [ $(netstat -lnupt |grep glusterd | wc -l) -eq 0 ];then systemctl stop keepalived fi fi :wq #給腳本權限 chmod +x /etc/keepalived/check_gluster.sh
在節點1上添加節點2: gluster peer probe glusternode2
在節點2上添加節點1: gluster peer probe glusternode1
查看節點狀態
gluster peer status
建立復制卷:
#創建復制卷 gluster volume create storage replica 2 glusternode1:/storage glusternode2:storage #啟動卷storage gluster volume start storage #查看卷狀態 gluster volume status #查看卷信息 gluster volume info storage
在節點1,2上執行
systemctl enable keepalived systemctl start keepalived
mount -t glusterfs glustervip:/storage /home/data
在glusternode2上查看服務IP已經飄逸
ip -a|grep 200.192.100.100 gluster volume status #查看狀態發現glusternode1已經斷開連接
將glusternode1上的節點刪除
#先去掉glusternode1上的brick gluster volume remove-brick iso replica 1 glusternode1:/storage force gluster volume status gluster peer status gluster peer detach glusternode1 #將glusternode1節點去掉 gluster peer status gluster volume status
等glusternode1節點故障修復完成后,將節點重新加回
gluster peer probe glusternode1 #添加節點 gluster peer status #將節點的brick重新加入 gluster volume add-brick iso replica 2 glusternode1:/storage force gluster volume status
以上是“Gluster集群高可用性配置和節點增刪的示例分析”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。