Hi all
I use haproxy with keepalive for ES
but I have some concerns
HAproxy config
global
log 127.0.0.1 local0 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
maxconn 4000
defaults
log global
mode http
option httplog
option dontlognull
option redispatch
retries 3
timeout client 35s
timeout server 60s
timeout connect 5s
timeout http-keep-alive 10s
listen stats :9090
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth admin:XXXX
listen elasticsearch 10.XXX.XXX.121:9300
mode tcp
option tcpka
option tcplog
# balance leastconn - The server with the lowest number of connections receives the connection
# balance roundrobin - Each server is used in turns, according to their weights.
# balance source - Source IP hashed and divided by total weight of servers designates which server will receive the request
balance roundrobin
server es-1 10.XXX.XXX.104:9200 check
server es-2 10.XXX.XXX.105:9200 check
keepalived config
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance VI_1 {
interface eth0
state MASTER
virtual_router_id 51
priority 101
virtual_ipaddress {
10.XXX.XXX.144
}
track_script {
chk_haproxy
}
}
HAproxy work but
one ES server appear in haproxy stats