Haproxy public IP failover (1x public IP > 3x haproxy web servers)

Hello everyone,
Please I am beginner with haproxy and i would like to ask and clarify if haproxy is capable manipulate with linux IP addresses (exactly i mean in case of server who has set public IP in ethernet and is not longer exist in lan… then automatically through haproxy asign public IP address to new server)…

Assign public IP address with similar command like this “ifconfig eth0”

At the moment i am using some my custom script that checking if we have internet in lan … if not then rewrite IP on all servers and then assign public IP to new server who is on. But it will be great if i could implement this solution directly into haproxy if is possible, because my script has some delay before is evereything sorted out.

Please i have at the moment
1x public IP > 1x switch > 3x haproxy servers with apache (fail over solution)

Also now I am facing problem with websocket that is not go through haproxy (i think but i am not sure)… Please is here anyone who would like help me correctly setup haproxy solution please? I am really lost myself in “frontend, backend, default, global and etc… settings” and now i am facing problem with websocket. :frowning:

If some expert would help i would be really happy pay some friendly fee. Best regards Pavol

this is working cfg what i have right now

mode http
option forwardfor

timeout connect 5000
timeout check 5000
timeout client 30000
timeout server 30000

listen stats
bind *:9999
stats enable
stats hide-version
stats uri /stats
stats auth root:asdf

frontend www-http
bind *:80
#reqadd X-Forwarded-Proto:\ http
default_backend www-backend

backend www-backend
balance hdr(host)
#cookie JSESSIONID prefix nocache
#balance hdr(User-Agent)
#balance roundrobin
#option httpchk HEAD /check.txt HTTP/1.0
server 254 check fall 1 rise 3
server 253 check backup fall 1 rise 3
server 252 check backup fall 1 rise 3

Just to be clear, you are saying you have 3 servers and they have haproxy and apache on them. Your haproxy servers are also your web servers. Yes?

yes sir (web server, haproxy, failover) on the server i need to rewrite apache port on 88 because haproxy take over 80…

webserver works… but now when i want install websocket i think there is some problem because i cant establish connection…

Not sure. My setup is a bit different. I’ve got 2 HAproxy servers running with KeepAliveD (transfers virtual IP for high availability) in front of 4 separate web servers. My thoughts were to keep separate duties separate so I would be able to have more flexibility going forward. Easier to swap out web servers, etc.

To me, sounds like you have a port conflict when you install websockets.