Score:1

Programmatically (SH Script) check which server is traffic routed too by HA Proxy

sz flag

I have 2 HA Proxy servers with Keepalived configured with them, and have 2 backend servers to which traffic is routed by HA Proxy, am writing a shell script that will sync a directory between backend servers based on which server is currently set as active using osync (I dont want activity status about the HA Proxy servers but the backend servers) (HA is configured as Active-Passive, switches to available server when current one goes down). The problem is I cannot find any resource or way that could programmatically tell me which server is currently actively accepting traffic.

asktyagi avatar
in flag
I think you can get it through keepalived log itself or you can write endpoint to show you active ip.
MoonLight avatar
sz flag
@asktyagi can you elaborate a bit more ?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.