Is this perhaps the same issue I have, I use aws opsworks and haproxy as a loadbalancer.
In haproxy 1.7 i have this:
backend api
description test api
balance roundrobin
cookie JSESSIONID prefix nocache
option forwardfor
option httpchk get /api/ping
http-check expect status 200
http-response add-header x-backend %s
http-response set-header Access-Control-Allow-Origin "*"
server api1 v-api-s1.xxxx.aws:8080 check cookie s1
server api2 v-api-s2.xxxx.aws:8080 check cookie s2
server api3 v-api-s3.xxxx.aws:8080 check cookie s3
server api4 v-api-s4.xxxx.aws:8080 check cookie s4
server api5 v-api-s5.xxxx.aws:8080 check cookie s5
We have in total 50 servers in that list, and opsworks scales up and down on random times.
and it is so automated that if it shutdown a server it removes it from also from the dns (route53), and adds it back on startup.
I keep getting the error:
[ALERT] 336/141922 (1565) : parsing [/etc/haproxy1.7/haproxy.cfg:58] : ‘server api5’ : could not resolve address ‘v-api-s5.xxxx.aws’.
[ALERT] 336/141922 (1565) : Failed to initialize server(s) addr.
How can I resolve this situation? should it not simply start since I provide a health check and not only look at that?