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

Stick Table based on IP source and port source both

$
0
0

@cris wrote:

Hi all,

We have an issue with our specific backend configuration. These backend receive a request from a SERVER_ORIGIN with IP Z.Z.Z.Z The backend has connected two internal servers: SERVER_1 (Y.Y.Y.2)
and SERVER_2 (Y.Y.Y.3) We have a schema for a better understanding:

The problem occurs when SERVER_ORIGIN try to establish three simultaneous connections to the FRONTEND (we connect with telnet X.X.X.X 6447) to the frontend.

The HA-Proxy just open a single session to one of the internal servers, when it should be three sessions.

_echo “show table backend_1” | socat stdio /var/run/haproxy.stat _
#table: backend_1, type: ip, size:10485760, used:3
0x25990e4: key=U.U.U.U use=0 exp=3559075 server_id=1

We have enabled stick-table option, but only through source IP (stick on src) and we need do it through source IP and source port both.

backend backend_1
_ mode tcp_
_ source 0.0.0.0 usesrc clientip_
_ balance leastconn_
_ option abortonclose_
_ option persist _
_ option redispatch _
_ option tcplog_
_ stick-table type ip size 10240k expire 60m peers HAPROXYPEERSPRE_
_ stick on src <----_
_ server server_1 Y.Y.Y.2:6447 weight 1 maxconn 2000 check port 6447 inter 3s rise 2 fall 3 on-marked-down shutdown-sessions_
_ server server_2 Y.Y.Y.3:6447 weight 1 maxconn 2000 check port 6447 inter 3s rise 2 fall 3 on-marked-down shutdown-sessions_

We have looked for in HA-Proxy Documentation (Fetching Samples --> Converters section) but we didn’t found with the correct option to establish that kind of sticky session.
Here we are an example which we have tested but we don’t know how to use correctly the function (there’s no any examples)

backend backend_1
_ mode tcp_
_ source 0.0.0.0 usesrc clientip_
_ balance leastconn_
_ option abortonclose_
_ option persist _
_ option redispatch _
_ option tcplog_
_ stick-table type binary len 32 size 30k expire 60m peers HAPROXYPEERSPRE_
_ stick on and(src, src_port) <----_
_ server server_1 Y.Y.Y.2:6447 weight 1 maxconn 2000 check port 6447 inter 3s rise 2 fall 3 on-marked-down shutdown-sessions_
_ server server_2 Y.Y.Y.3:6447 weight 1 maxconn 2000 check port 6447 inter 3s rise 2 fall 3 on-marked-down shutdown-sessions_

Finally, our question is, ¿what is the correct expression of function?¿We need other option or configuration for a correct working?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4714

Trending Articles



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