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

Dynamically Lists Server Backend

$
0
0

@williams.perdana wrote:

Can I dynamically lists all servers backend using lua scripts ? For Example:

Lua Script:

local function choose_backend()
return “server webserver02 lbwebserver-02.perf.lokal:80 check”
end
core.register_fetches(“choose_backend”, choose_backend)

HA Configuration:

global
    .... 
    lua-load /usr/sbin/lua-choose-backend.lua

defaults
    ....

frontend WEBSERVERS
    bind 172.18.69.116:9000
    use_backend WEBSERVER01

backend WEBSERVER01
    %[lua.choose_backend]

I had tried that thing, but haproxy says invalid ‘%’ thing.
I don’t want to use the ‘use_backend’ like internet says, because If I use that way, I would have to add the backends everytime my servers grow. I want to dynamically list those servers on the lua

Is that possible ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4726

Trending Articles



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