主頁 > 知識庫 > centos中l(wèi)vs安裝配置方法詳解

centos中l(wèi)vs安裝配置方法詳解

熱門標簽:陽江智能電銷機器人 江蘇客服外呼系統(tǒng)怎么樣 南寧銷售電銷機器人廠家 省份地圖標注 科研地圖標注 灰谷地圖標注 辦理400電話怎么劃傷 平頂山手機自動外呼系統(tǒng)違法嗎 地圖標注軌跡

一、lvs-nat模式

網(wǎng)絡配置:

復制代碼
代碼如下:

lvs-server eth0 :host-only adapter 192.168.56.101
lvs-server eth1 :Internal 192.168.0.1
real-server-1 eth0:Internal 192.168.0.2
real-server-2 eth0:Internal 192.168.0.3

 
lvs-server:
1、安裝ipvsadm軟件

復制代碼
代碼如下:

yum -y install ipvsadm*
echo 1 > /proc/sys/net/ipv4/ip_forward 路由器功能,ip轉(zhuǎn)發(fā)
ipvsadm -C
ipvsadm -At 192.168.56.101:80 -s rr 輪叫模式
ipvsadm -at 192.168.56.101:80 -r 192.168.0.2 -m
ipvsadm -at 192.168.56.101:80 -r 192.168.0.3 -m
ipvsadm -L -n

2、real-server-1:

復制代碼
代碼如下:

ifconfig eth0 192.168.0.2 netmask 255.255.255.0
route add default gw 192.168.0.1

3、real-server-2

復制代碼
代碼如下:

ifconfig eth0 192.168.0.3 netmask 255.255.255.0
route add default gw 192.168.0.1
route -n 查看路由表

 
二、lvs-ipturn

網(wǎng)絡配置:

復制代碼
代碼如下:

lvs-server eth0:host-only adapter 192.168.56.101
real-server-1 eth0:host-only adapter 192.168.56.102
real-server-2 eth0:host-only adapter 192.168.56.103

lvs-server:
配置虛擬ip即vip

復制代碼
代碼如下:

ifconfig tunl0 192.168.56.10 netmask 255.255.255.255 up
route add -host 192.168.56.10 dev tunl0/p> p>ivsadm -C
ipvsadm -At 192.168.56.10:80 -s rr
ipvsadm -at 192.168.56.10:80 -r 192.168.56.102 -i
ipvsadm -at 192.168.56.10:80 -r 192.168.56.103 -i
ipvsadm -L -n

real-server-1:

復制代碼
代碼如下:

ifconfig tunl0 192.168.56.10 netmask 255.255.255.255 up
route add -host 192.168.56.10 dev tunl0
echo 1 > /proc/sys/net/ipv4/conf/tunl0/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/tunl0/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

real-server-2:

復制代碼
代碼如下:

ifconfig tunl0 192.168.56.10 netmask 255.255.255.255 up
route add -host 192.168.56.10 dev tunl0
echo 1 > /proc/sys/net/ipv4/conf/tunl0/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/tunl0/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

 
三、lvs-dr

網(wǎng)絡配置:

復制代碼
代碼如下:

lvs-server eth0:host-only adapter 192.168.56.101/p> p>real-server-1 eth0:host-only adapter 192.168.56.102/p> p>real-server-2 eth0:host-only adapter 192.168.56.103/p> p>lvs-server:/p> p>ifconfig eth0:0 192.168.56.10 netmask 255.255.255.255/p> p>route add -host 192.168.56.10 dev eth0:0

ipvs:

復制代碼
代碼如下:

ipvsadm -C ipvsadm -At 192.168.56.10:80 -s rr ipvsadm -at 192.168.56.10:80 -r 192.168.56.102 -g ipvsadm -at 192.168.56.10:80 -r 192.168.56.103 -g ipvsadm -L -n/p> p>real-server-1: ifconfig lo:0 192.168.56.10 netmask 255.255.255.255 route add -host 192.168.56.10 dev lo:0 echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce/p> p>real-server-2: ifconfig lo:0 192.168.56.10 netmask 255.255.255.255 route add -host 192.168.56.10 dev lo:0 echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

標簽:臨汾 泰安 蕪湖 瀘州 玉樹 通化 玉溪 儋州

巨人網(wǎng)絡通訊聲明:本文標題《centos中l(wèi)vs安裝配置方法詳解》,本文關(guān)鍵詞  centos,中,lvs,安裝,配置,方法,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《centos中l(wèi)vs安裝配置方法詳解》相關(guān)的同類信息!
  • 本頁收集關(guān)于centos中l(wèi)vs安裝配置方法詳解的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章