日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 综合教程 >内容正文

综合教程

双心跳线

發(fā)布時(shí)間:2023/12/13 综合教程 44 生活家
生活随笔 收集整理的這篇文章主要介紹了 双心跳线 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

雙心跳線

心跳線就是兩臺(tái)服務(wù)器之間再搭一個(gè)內(nèi)網(wǎng)進(jìn)行通信,保障主線斷了,兩臺(tái)服務(wù)器還能通過(guò)內(nèi)網(wǎng)線路通信。雙心條線就在內(nèi)網(wǎng)內(nèi)某一個(gè)節(jié)點(diǎn)出現(xiàn)問(wèn)題而其他節(jié)點(diǎn)不知道的時(shí)候就會(huì)通過(guò)另一條心跳線發(fā)出警告并將該節(jié)點(diǎn)提掉。

現(xiàn)在搭建怎么創(chuàng)建2個(gè)心跳線,這里準(zhǔn)備多臺(tái)PC:[root@foundation0 ~] 為真機(jī)
[root@nodea ~]、[root@nodeb ~]、[root@nodec ~]為3個(gè)節(jié)點(diǎn)
首先我們安裝一個(gè)集群pcs包。
[root@nodea ~]# yum -y install pcs ;systemctl stop firewalld.service ;systemctl disable firewalld.service ;systemctl restart pcsd ;systemctl enable pcsd ; echo redhat |passwd --stdin hacluster *****nodea、nodeb、nodec都需要這樣裝

將nodea、nodeb、nodec授權(quán)給pcs并指定在hacluster用戶下
[root@nodea ~]# pcs cluster auth nodea.cluster0.example.com nodeb.cluster0.example.com nodec.cluster0.example.com
Username: hacluster
Password:
nodea.cluster0.example.com: Authorized
nodeb.cluster0.example.com: Authorized
nodec.cluster0.example.com: Authorized

在真實(shí)機(jī)輸入下面網(wǎng)站訪問(wèn)集群
[root@foundation0 ~]# firefox https://nodea.cluster0.example.com:2224



1.png

1、添加
2、集群名:cluster-1
3-5、將nodea、nodeb、noddec主機(jī)名加入其中

點(diǎn)擊進(jìn)入集群cluster-1



2.png

用下面命令查看當(dāng)前心跳線的個(gè)數(shù)及IP地址
[root@nodea corosync]# corosync-cfgtool -s
Printing ring status.
Local node ID 1
RING ID 0
id = 172.25.0.10
status = ring 0 active with no faults

進(jìn)入到/etc/corosync/會(huì)發(fā)現(xiàn)當(dāng)前有幾個(gè)配置文件
[root@nodea ~]# cd /etc/corosync/
[root@nodea corosync]# ls
corosync.conf corosync.conf.example.udpu uidgid.d
corosync.conf.example corosync.xml.example

首先我們需要將corosync.conf.example內(nèi)的內(nèi)容當(dāng)模版
[root@nodea corosync]# vim corosync.conf.example



3.png

1、將多余的文字去掉留下當(dāng)前黑色范圍內(nèi)的內(nèi)容復(fù)制

[root@nodea corosync]# vim corosync.conf



4.png

1、增加一個(gè)active模式
2、心跳模版指定的IP地址為172.25.0.0網(wǎng)段
3、心跳模版指定的IP地址為192.168.0.0網(wǎng)段
*****由于真機(jī)和節(jié)點(diǎn)內(nèi)的網(wǎng)卡IP都屬于這2個(gè)網(wǎng)段

上面的配置文件做完后
[root@nodea corosync]# pcs cluster stop --all
nodea.cluster0.example.com: Stopping Cluster (pacemaker)...
nodeb.cluster0.example.com: Stopping Cluster (pacemaker)...
nodec.cluster0.example.com: Stopping Cluster (pacemaker)...
nodeb.cluster0.example.com: Stopping Cluster (corosync)...
nodec.cluster0.example.com: Stopping Cluster (corosync)...
nodea.cluster0.example.com: Stopping Cluster (corosync)...
[root@nodea corosync]# pcs cluster sync
nodea.cluster0.example.com: Succeeded
nodeb.cluster0.example.com: Succeeded
nodec.cluster0.example.com: Succeeded
[root@nodea corosync]# pcs cluster start --all
nodeb.cluster0.example.com: Starting Cluster...
nodec.cluster0.example.com: Starting Cluster...
nodea.cluster0.example.com: Starting Cluster...

先關(guān)掉集群使集群同步,后開(kāi)啟集群就可以看到有2個(gè)心跳線了
[root@nodea corosync]# corosync-cfgtool -s
Printing ring status.
Local node ID 1
RING ID 0
id = 172.25.0.10
status = ring 0 active with no faults
RING ID 1
id = 192.168.0.10
status = ring 1 active with no faults

總結(jié)

以上是生活随笔為你收集整理的双心跳线的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。