Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4723

Peers configuration to sync stick-table do not work

$
0
0

@Chen wrote:

Hi, I’m trying to use the “peers” to sync stick-table for 2 haproxy processes on 2 servers.

Here is my haproxy.cfg:

global
    daemon
    user nobody
    maxconn 15000
    group nogroup
    log /dev/log local0 debug
    log /dev/log local1 debug
    stats socket /var/lib/lbaas/0afa54db-524e-490a-9625-95515a05404b/sock mode 0666 level admin 
    ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
    ssl-default-bind-ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:AES128-SHA256:AES256-SHA256

defaults
    log global
    retries 3
    option redispatch
    option log-health-checks
    timeout connect 5000
    timeout client 50000
    timeout server 50000
frontend 0afa54db-524e-490a-9625-95515a05404b
    bind 169.62.220.229:80
    mode http
    maxconn 15000
    option forwardfor
    default_backend a697d621-b2b9-4317-80ba-ed47d9b5cd6e

peers 882908
    peer loadbalancer-dal13-323698-773968-862484 10.171.10.166:56503
    peer loadbalancer-dal13-323698-773968-862384 10.73.9.164:56503


backend a697d621-b2b9-4317-80ba-ed47d9b5cd6e
    mode http
    balance roundrobin
    option httpchk GET /
    http-check expect status 200
    timeout check 2s
    default-server inter 5s fall 2
    http-reuse safe
    stick on src
    stick-table type ip size 10k expire 10m peers 882908
    server 1e6f63da-3b41-4380-91ae-634495803e39-10.186.16.195 10.186.16.195:80  check
    server 52f650f4-a8f4-48cb-8ab4-9ad18780e7e7-10.186.16.208 10.186.16.208:80  check
    server 1d73ca0c-c533-493f-9902-5a5028a46954-10.121.218.214 10.121.218.214:80  check
    server a6cc2dca-c504-42f9-8a3e-ccfd22959848-10.142.62.101 10.142.62.101:80  check
    server aed56aca-3ef4-42fd-b0ba-4934c6f2795c-10.94.197.136 10.94.197.136:80  check
    server d157a565-829d-411e-aea9-f1d15d38957f-10.73.9.133 10.73.9.133:80  check
    server a6ee5a39-c01a-4482-95fb-ab933a1c9ebd-10.73.9.147 10.73.9.147:80  check

The 2 servers have exactly the same configuration.
And I have use tcpdump to check network traffic:

root@loadbalancer-dal13-323698-773968-862484:~# tcpdump -i eth0 tcp |grep 10.73.9.164
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:09:39.848310 IP 10.73.9.164.25830 > loadbalancer-dal13-323698-773968-862484.56503: Flags [S], seq 102889503, win 29200, options [mss 1460,sackOK,TS val 861543944 ecr 0,nop,wscale 9], length 0
09:09:41.864381 IP 10.73.9.164.25830 > loadbalancer-dal13-323698-773968-862484.56503: Flags [S], seq 102889503, win 29200, options [mss 1460,sackOK,TS val 861545960 ecr 0,nop,wscale 9], length 0
09:09:43.195781 IP loadbalancer-dal13-323698-773968-862484.60308 > 10.73.9.164.56503: Flags [S], seq 4172748988, win 29200, options [mss 1460,sackOK,TS val 3020580915 ecr 0,nop,wscale 9], length 0
09:09:44.219713 IP loadbalancer-dal13-323698-773968-862484.60308 > 10.73.9.164.56503: Flags [S], seq 4172748988, win 29200, options [mss 1460,sackOK,TS val 3020581939 ecr 0,nop,wscale 9], length 0
09:09:45.992850 IP 10.73.9.164.25894 > loadbalancer-dal13-323698-773968-862484.56503: Flags [S], seq 3116111742, win 29200, options [mss 1460,sackOK,TS val 861550088 ecr 0,nop,wscale 9], length 0
09:09:46.235744 IP loadbalancer-dal13-323698-773968-862484.60308 > 10.73.9.164.56503: Flags [S], seq 4172748988, win 29200, options [mss 1460,sackOK,TS val 3020583955 ecr 0,nop,wscale 9], length 0

I suppose the above means the peers protocol is running, right ?

But, then I did a simple test, visit one server, and then check stick table content.

Here is what I get on server 1:

root@loadbalancer-dal13-323698-773968-862384:~# echo "show table a697d621-b2b9-4317-80ba-ed47d9b5cd6e" | socat stdio /var/lib/lbaas/0afa54db-524e-490a-9625-95515a05404b/sock
# table: a697d621-b2b9-4317-80ba-ed47d9b5cd6e, type: ip, size:10240, used:2
0x5616b172d894: key=34.77.247.179 use=0 exp=576101 server_id=7
0x5616b172d7f4: key=66.249.65.167 use=0 exp=525272 server_id=6

But, on server 2, the table keeps empty.

Anyone can help ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4723

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>