LVS deployment

# 1 topology to 5G project as an example
                                              | - realserver1 (Master1 18.16)
Directory (Barria 18.19) - | - realserver2 (node2 18.24)
                                       | - realserver3 (node1 18.22)
Configuration # 2
## 2.1 Directory (Barria)
 (. 1) the Add-Server IP
is named net.ipv4.ip_forward and forwarding = ipv4. 1 Set #
ip addr add 172.16.18.13/24 dev p7p1 # add service IP network card
(2)add server
#for rtmp live
ipvsadm -A -t 172.16.18.13:8090 -s rr     #add virtual service,ip:port即为LVS服务器ip:port
ipvsadm -a -t 172.16.18.13:8090 -r 172.16.18.16:8090 -g    #添加real server的ip:port
ipvsadm -a -t 172.16.18.13:8090 -r 172.16.18.22:8090 -g
ipvsadm -a -t 172.16.18.13:8090 -r 172.16.18.24:8090 -g
#for hls live
ipvsadm -a -t 172.16.18.13:8190 -r 172.16.18.16:8090 -g
ipvsadm -a -t 172.16.18.13:8190 -r 172.16.18.22:8090 -g
ipvsadm -a -t 172.16.18.13:8190 -r 172.16.18.24:8090 -g
#for vod
ipvsadm -A -t 172.16.18.13:80 -s rr
ipvsadm -a -t 172.16.18.13:80 -r 172.16.18.16:80 -g
ipvsadm -a -t 172.16.18.13:80 -r 172.16.18.22:80 -g
ipvsadm -a -t 172.16.18.13:80 -r 172.16.18.24:80 -g
ipvsadm -S # save
2.2 Real Server ##
(. 1) performed on each Server Real
Master1: the ifconfig EM1: 172.16.18.13 Netmask 255.255.255.0. 1 # Configure alias
node1: the ifconfig EM1: 172.16.18.13 Netmask 255.255.255.0. 1
node2: the ifconfig EM2:. 1 172.16.18.13 netmask 255.255.255.0

# 3 other common commands
the ipvsadm -Ln
the ipvsadm -D -t 172.16.18.13:8090 #delete Virtual Service

Guess you like

Origin www.cnblogs.com/yajun2019/p/11613389.html