Six--lvs persistent connections in the Linux cluster series

Source: Internet
Author: User
Tags iptables

DR:

Arp_ignore = 1

Arp_announce = 2

Arrays: Variable Arrays

Array_name= ("" "" "")

DECLARE-A A variable is explicitly declared to be an array

Persistent connection of LVS:
Regardless of the algorithm used, the LVS persistent connection can be distributed from the same client request to the same RS for a certain amount of time.

Persistent connection template (memory buffer):

The mappings between each client and the RS assigned to it:

Ipvsadm-l-C Displays the current number of persistent connections

ipvsadm-a| E ...-p timeout: Specify the length of the connection, default 300 seconds

In SSL-based: A persistent connection is required:

PPC: The request from the same client to the same cluster service is always directed to the previously selected RS; 1-1

IPVSADM-E-T 192.168.10.11:80-s rr-p 600 Specifies the length of the persistent connection


PCC: Requests from the same client for all ports are always directed to the previously selected RS; 1-all

Ipvsadm-c

Ipvsadm-a-T 192.168.1.10:0-s-rr-p 600

Ipvsadm-a-T 192.168.1.10:0-R 192.168.1.12-g-W 2 (0 for all ports requests are Cluster service)

Ipvsadm-a-T 192.168.1.10:0-R 192.168.1.11-g-W 3

All ports are defined as cluster services and are forwarded to RS


PNMPP: Persistent firewall tag Connection 1-n

Preriuting

80:10

23:10

Mark two unrelated ports as a number and define the tag as a Cluster service (integer labeled 0 to 99, as long as the firewall has not been used before)

Iptables-f-T Mangle

Iptables-a prerouting-i eth0-t mangle-p tcp-d 172.16.100.6--dport 80-j MARK--set-mark 1

Iptables-a prerouting-i eth0-t mangle-p tcp-d 172.16.100.6--dport 443-j MARK--set-mark 1

Ipvsadm-a-F 1-s rr-p 3600

Ipvsadm-a-F 1-r 172.16.100.7-g-W 2

Ipvsadm-a-F 1-r 172.16.100.8-g-W 1


This article from "Operation and maintenance Growth Road" blog, declined reprint!

Six--lvs persistent connections in the Linux cluster series

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.