@andrewgricuk wrote:
hi guys!
I want to use haproxy with AWS autoscaling groups. I’m using balancing by ID (hash-consistency). I ran into the following problem:
When autoscaling group UP Haproxy reloaded clear cache (hash tables) and we have a problem with connecting to needed instance. The students pass exam and send request with ID to haproxy -> Haproxy send request to the backend and associate hash with backend -> proctor which should view the exam send the request with same ID and goes to same backend. How i can save hash state when scaling up? Thankshaproxy -v
HA-Proxy version 1.8.13-1ppa1~xenial 2018/08/01
Copyright 2000-2018 Willy Tarreau <willy@haproxy.global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
server-state-file global
server-state-base /run/haproxy/server-state/
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
tune.ssl.default-dh-param 2048
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
node lb
nbproc 1
maxconn 2000000defaults
log global
mode http
option forwardfor
option http-server-close
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
load-server-state-from-file globalfrontend www-http
bind *:80
redirect scheme https code 301 if !{ ssl_fc }
default_backend java
maxconn 2000000frontend www-https
bind *:443 ssl crt /etc/ssl/private/test.pem
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
capture request header origin len 50
default_backend java
maxconn 2000000backend java
balance url_param fid
hash-type consistent
option forwardfor # This sets X-Forwarded-For
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
http-response set-header Access-Control-Allow-Origin %[capture.req.hdr(0)]
option httpchk
default-server inter 3s fall 3 rise 2
option httpchk HEAD /students HTTP/1.0autoscaling group instances will be
dynamically added below
Posts: 1
Participants: 1