1.LVS Persistent Connection
Regardless of the algorithm used, the LVS can be persisted for a certain period of time and will be dispatched from the same client request to the previously selected Rs. By saving a persistent connection template in a memory buffer, each client is logged and the RS mapping relationship assigned to him is recorded.
2. Persistent connection type
PPC (Persistent port connection): Requests from the same client for the same cluster service are always directed to the previously selected RS at a certain time;
Ipvsadm-a-T vip:cport-s scheduler-pipvsadm-a-T vip:cport-r rip1-m|-g-w weightipvsadm-a-T vip:cport-r rip2-m|- G-w WEIGHT
PCC (Persistent client connection): Requests from the same client for all ports are always directed to the previously selected RS for a certain amount of time, i.e. all ports are defined as cluster services and forwarded to RS;
Ipvsadm-a-T vip:0-S scheduler-pipvsadm-a-T vip:0-R rip1-m|-g-w weightipvsadm-a-T vip:0-R rip2-m|-g-w WEIGHT
PNMPP (Persistent firewall tag connection): Some ports can be defined as the same cluster service;
Iptables-t mangle-a prerouting-d $VIP-P TCP--dport $CPORT 1-i $INCARD-j MARK--set-mark 10iptables-t mangle-a prer outing-d $VIP-P TCP--dport $CPORT 2-i $INCARD-j MARK--set-mark 10ipvsadm-a-F 10-s scheduler-pipvsadm-a-F 10-r Rip1-m|-g-w weightipvsadm-a-F 10-r rip2-m|-g-w WEIGHT
LVs Persistent Connection