Install the command line tool: Yum install ipvsadm
Lvsadm:
1. Manage cluster services
Add:-A-T | u | f service-add [-s scheduling algorithm]
-T: TCP Cluster
-U: UDP Cluster
Server-Address: IP: Port
-F: firewallmark
Server-Address: Mark Number
Modify:-e
Delete:-D-T | u | L server-address
For example, add cluster service: ipvsadm-a-t 172.16.100.1: 80-s rr
2. Manage the RS in the cluster service:
Add:-A-T | u | f service-add-r server-add [-G | L | M] [-w-weight]
-T | u | f service-add to implement a defined Cluster Service
-R server-add an RS address. In the NAT model, IP: port can be used to implement port ing [-G | L | M]: LVS model.
-G: Dr
-I: Tun
-M: Nat
Modify:-e
Delete:-d
For example, add RS: ipvsadm-a-t 172.16.100.1: 80-r 192.168.10.10-M.
Ipvsadm-a-t 172.16.100.1: 80-r 192.168.10.11-m
3. View
-L | L
-N: the host address and port number are displayed.
-- Stats: Statistical data
-- Rate: Display rate
-- Timeout: display the Session Timeout of TCP. tcpfin
-C: displays the current s connection status.
4. Delete all cluster services:
-C: Clear ipvs rules
5. Save the rule:
-S ipvsadm-S>/root/filename
6. Load previous rules:
-R ipvsadm-r </root/filename
Use of LVS command tools