The invention discloses a method for realizing session synchronization by a multi-live load balancing
system based on lvs, and relates to the field of
cloud computing. Comprising the steps of (1) preparing computing resources and deploying load balancing nodes and real
server nodes, (2) configuring a mode of issuing a
route on a
router and realizing an equivalent multi-path
route, (3) configuring the load balancing nodes, selecting lvs as a load balancer and deploying by using a dr mode of the lvs, and (4) performing lvs session synchronization configuration, and after session synchronization configuration is completed, sending the load balancing nodes to the
router. When a user requests to pass through one of the load balancing nodes, if the load balancing node completes TCP three-way
handshake and connection is established, quintuple information of TCP connection and a
session state are packaged into a lightweight synchronization message through the load balancing node. Sending the
broadcast address to all load balancing nodes in the same cluster through the load balancing nodes according to a pre-configured
broadcast address; according to the method, a load balancing node receiving a synchronous message firstly searches whether a connrack table item of the same quintuple exists in the local, if not, a new connection tracking
record is directly inserted, and if yes, a strategy merging state is updated by using a later uncovered or
timestamp, so that the whole cluster is ensured to be completely consistent with a view of the long connection.