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

Updating server address through admin API when current address is empty

$
0
0

@aitorpazos wrote:

Hi community,

I’m facing an issue where HAProxy refuses to update backend servers target address when their current address is empty.

The target address is empty in my case because in some situations the backend services may not be deployed and therefore not resolvable as they haven’t been registered in consul.

My resolvers config is as follow:

defaults
[…]
default-server init-addr last,libc,none

resolvers dns
# Uses default resolution
parse-resolv-conf
resolve_retries 3
[…]

and backend are defined using server-template:

listen listen-name
bind “${LISTEN_BIND}”

server-template my-server- 1-6 “${BACKEND_ENDPOINT}” check resolvers dns resolve-prefer ipv4

When BACKEND_ENDPOINT resolves, I get up to 6 servers configured that I can update, but when it doesn’t resolve at start, all servers are set with empty address and I am unable to update their address through the API, getting the following message:

Update for the current server address family is only supported through configuration file

I see in server.c:3801 it is checked if the current address is AF_INET or AF_INET6 but in this situations that condition doesn’t match as current address is empty. However, wouldn’t it be possible to set it also if current_addr is empty?
E.g.:

if ((sizeof(current_addr) != 0) && (ret != AF_INET) && (ret != AF_INET6)) {

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4717

Trending Articles



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