欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

heartbeat+ipvs+keepalived

1.高可用Heartbeat

興寧ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)的ssl證書(shū)銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書(shū)合作)期待與您的合作!

Server1和server4安裝資源包

   heartbeat-3.0.4-2.el6.x86_64.rpm

   heartbeat-devel-3.0.4-2.el6.x86_64.rpm

   heartbeat-libs-3.0.4-2.el6.x86_64.rpm

   ldirectord-3.9.5-3.1.x86_64.rpm

yum install -y heartbeat-*

[root@server1 ha.d]# cd /usr/share/doc/heartbeat-3.0.4/

[root@server1 heartbeat-3.0.4]# cp ha.cf authkeys haresources /etc/ha.d/

[root@server1 heartbeat-3.0.4]# cd /etc/ha.d

[root@server1 ha.d]# vim ha.cf

heartbeat+ipvs+keepalived

heartbeat+ipvs+keepalived

heartbeat+ipvs+keepalived

heartbeat+ipvs+keepalived

[root@server1 ha.d]# vim authkeys

heartbeat+ipvs+keepalived

[root@server1 ha.d]# chmod 600 authkeys 

[root@server1 ha.d]# vim haresources 

heartbeat+ipvs+keepalived

[root@server1 ha.d]# scp ha.cf authkeys haresources server4:/etc/ha.d

[root@server1 ha.d]# /etc/init.d/heartbeat start

Server4做相同的操作

[root@server4 ha.d]# /etc/init.d/heartbeat start

測(cè)試:

heartbeat+ipvs+keepalived

[root@server1 ha.d]# /etc/init.d/heartbeat stop

heartbeat+ipvs+keepalived

[root@server1 ha.d]# /etc/init.d/heartbeat start

heartbeat+ipvs+keepalived

 

1.ipvs負(fù)載均衡

首先停掉server1和server4上的heartbeat

Server1上的操作,并且server1做調(diào)度器

[root@server1 ~]# yum install -y ldirectord-3.9.5-3.1.x86_64.rpm

[root@server1 ~]# cd /usr/share/doc/ldirectord-3.9.5/

[root@server1 ldirectord-3.9.5]# cp ldirectord.cf /etc/ha.d

[root@server1 ~]# yum install -y ipvsadm

[root@server1 ~]# ipvsadm -L  

[root@server1 ~]# ipvsadm -C   ##清除規(guī)則

[root@server1 ~]# ipvsadm -A -t 172.25.6.100:80 -s rr    ##rr表示采用輪詢調(diào)度算法,添加新的虛擬ip

[root@server1 ~]# ip addr add 172.25.6.100/24 dev eth0

[root@server1 ~]# ip addr

heartbeat+ipvs+keepalived

[root@server1 ~]# ipvsadm -a -t 172.25.6.100:80 -r 172.25.6.2:80 -g   ##添加新規(guī)則

[root@server1 ~]# ipvsadm -a -t 172.25.6.100:80 -r 172.25.6.3:80 -g

[root@server1 ~]# /etc/init.d/ipvsadm save   ##保存添加的規(guī)則

 [root@server1 ~]# ipvsadm -L      ##顯示內(nèi)核中虛擬服務(wù)器列表

heartbeat+ipvs+keepalived

[root@server1 ~]# /etc/init.d/httpd restart

Server2上的操作

[root@server2 ~]# ip addr add 172.25.6.100/32 dev eth0

[root@server2 ~]# ip addr

heartbeat+ipvs+keepalived

[root@server2 ~]# yum install -y arptables_jf

[root@server2 html]# arptables -A IN -d 172.25.6.100 -j DROP

[root@server2 html]# arptables -A OUT -s 172.25.6.200 -j mangle --mangle-ip-s 172.25.6.2

[root@server2 html]# /etc/init.d/arptables_jf  save

[root@server2 html]# /etc/init.d/httpd restart

Server3上的操作

[root@server3 ~]# /etc/init.d/httpd start

[root@server3 ~]# ip addr add 172.25.6.100/32 dev eth0   ##給內(nèi)網(wǎng)網(wǎng)卡添加ip

[root@server3 ~]# ip addr

heartbeat+ipvs+keepalived

[root@server3 ~]# yum install -y arptables_jf

[root@server3 html]# arptables -A IN -d 172.25.6.100 -j DROP  ##給這個(gè)地址追加策略

[root@server3 html]# arptables -A OUT -s 172.25.6.100 -j  mangle --mangle-ip-s 172.25.6.3  ##追加策略,由100源地址跳到3上

[root@server3 ~]# /etc/init.d/arptables_jf save  ##保存添加的策略

[root@server3 ~]# /etc/init.d/arptables_jf start 

[root@server3 ~]# /etc/init.d/httpd restart

 

測(cè)試:

heartbeat+ipvs+keepalived 

2.高可用與負(fù)載均衡

[root@server1 ~]# yum install -y ldirectord-3.9.5-3.1.x86_64.rpm

[root@server1 ~]# cd /etc/ha.d/

[root@server1 ha.d]# vim ldirectord.cf 

heartbeat+ipvs+keepalived

[root@server1 ha.d]# ipvsadm -C  ##清除策略

[root@server1 ha.d]# ipvsadm -L   ##查看策略

[root@server1 ha.d]# ip addr del 172.25.6.100/24 dev eth0    ##刪除內(nèi)網(wǎng)網(wǎng)卡上的ip

[root@server1 ha.d]# vim haresources 

heartbeat+ipvs+keepalived

[root@server1 ha.d]# scp haresources ldirectord.cf  172.25.6.4:/etc/ha.d/      ##server4上做與server1相同的操作

打開(kāi)server4上的heartbeat替代server1的heartbeat

[root@server1 html]# /etc/init.d/httpd restart

測(cè)試:

如果server2和server3的httpd打開(kāi)

heartbeat+ipvs+keepalived

如果server2和server3  httpd關(guān)閉,則訪問(wèn)heartbeat所在的主機(jī)

heartbeat+ipvs+keepalived

4.keepalived

關(guān)閉server1和server4的heartbeat,打開(kāi)server2和server3的httpd

Server1上的操作

[root@server1 ~]# tar zxf keepalived-1.2.20.tar.gz

[root@server1 ~]#cd keepalived-1.2.20/

[root@server1 keepalived-1.2.20]# ./configure --prefix=/usr/local/keepalived/  ##解譯到指定路徑

[root@server1 keepalived-1.2.20]# make &&  make install

[root@server1 keepalived-1.2.20]# cd /usr/local/keepalived/

[root@server1 local]# scp -r keepalived/ 172.25.6.4:/usr/local/

[root@server1 sbin]#

 ln -s /usr/local/keepalived/sbin/keepalived /sbin/

[root@server1 etc]# ln -s /usr/local/keepalived/etc/keepalived/ /etc/

[root@server1 sysconfig]#

 ln -s /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/

[root@server1 sysconfig]#

 ln -s /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/

[root@server1 init.d]# chmod +x keepalived

[root@server1 init.d]# cd /etc/keepalived/

[root@server1 keepalived]# ls

keepalived.conf  samples

[root@server1 keepalived]# vim keepalived.conf 

heartbeat+ipvs+keepalived

heartbeat+ipvs+keepalived

heartbeat+ipvs+keepalived

[root@server1 keepalived]# /etc/init.d/keepalived start

將修改的配置文件發(fā)送到server4同位置

Server4上的操作

[root@server4 keepalived]#

 ln -s /usr/local/keepalived/sbin/keepalived /sbin/

[root@server4 keepalived]#

 ln -s /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d

[root@server4 keepalived]#

 chmod +x /usr/local/keepalived/etc/rc.d/init.d/keepalived

[root@server4 keepalived]#

 ln -s /usr/local/keepalived/etc/sysconfig/keepalived /

etc/sysconfig/

[root@server4 keepalived]# /etc/init.d/keepalived start

[root@server4 keepalived]# mkdir /etc/keepalived/

將文件中的server1改為server4,state改為backup,

兩者的virtual_router_id一定不同,server4的priority值小于server1的值

將keepalived進(jìn)行重啟

測(cè)試:

heartbeat+ipvs+keepalived

文章標(biāo)題:heartbeat+ipvs+keepalived
轉(zhuǎn)載源于:http://aaarwkj.com/article20/gjgoco.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、網(wǎng)站營(yíng)銷、小程序開(kāi)發(fā)品牌網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)公司電子商務(wù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)
熟女乱熟乱熟妇综合网二区| 欧美亚洲国产精品综合在线| 亚洲欧美日韩一区中文天国| 国产午夜视频在线观看一区| 亚洲日本欧美在线一区| 99热精品免费在线观看| 国产又大又黄又粗的黄色| 亚洲国产日韩精品久久| 国产精品自拍国产精品| 亚洲欧洲av男人的天堂| 成人av久久一区二区三区| 国产精品成人av在线网站| 激情欧美一区二区三区精品| 精品毛片av一区二区三区| 91好色视频在线观看| 亚洲91无专砖码高清观看| 国产一区二区不卡自拍| 天天日天天天干夜夜操| 91麻豆精品在线观看| 亚洲人成免费观看网站| 日本一区二区三在线观看| 日韩在线一区二区三区电影| 夫妻性生活视频全过程| 粉嫩美女精品一区二区| 国产在线观看不卡视频| 精品一区二区视频在线观看网站| 午夜丁香婷婷爽少妇av| 日韩乱码高清一本免费啪| 国产成人精品一二三四区| 亚洲午夜精品日韩乱码| 亚洲丰满毛茸茸毛茸茸| 亚洲第一女人天堂av| 久久热这里只有视频精品| 青青草原天堂在线免费观看| 国产白丝免费在线观看| 日韩欧美国产精品一区二区三区| 午夜精品四季av日日骚| 亚洲成人自拍视频在线观看| 国产亚洲av看码精品永久| 一起草视频在线观看视频| 欧美日韩亚洲国产精品视频 |