lua-resty-balancer icon indicating copy to clipboard operation
lua-resty-balancer copied to clipboard

[Question] Is there any way to get the ips from DNS?

Open rjshrjndrn opened this issue 3 years ago • 2 comments
trafficstars

Hi, Thank you for this awesome plugin. I have got a specific scenario. I'm trying to DNS Loadbalance (sticky sessions) a websocket service. I've tried with static IPs, and this plugin works beautifully. Unfortunately, I'm a noob in lua. Is there any way to integrate this solution with the dns queries, rather than giving static ips. Any suggestions are highly appreciated.

Regrads.

rjshrjndrn avatar Feb 24 '22 23:02 rjshrjndrn

maybe you could use https://github.com/openresty/lua-resty-dns

xiaocang avatar Feb 25 '22 02:02 xiaocang

Thank you @xiaocang for your response. I saw this plugin while trying to solve the issue. But I couldn't get my head around how to use the DNS plugin for host queries and return the result to this plugin. My concerns are, each time, If I call the DNS plugin, it's an expensive call. Then I'll have to implement some kind of LRU logic, or resolver timeout something like that. I'm not that expert in Lua, as I mentioned earlier. This library seems like a good solution, But there is no getting started guide or code samples. :confused: :disappointed:

rjshrjndrn avatar Feb 27 '22 23:02 rjshrjndrn