bitwalker / libcluster

Automatic cluster formation/healing for Elixir applications
MIT License
1.97k stars 188 forks source link

Accept a list of node_basenames for the DNSPoll strategy #191

Open Qqwy opened 1 year ago

Qqwy commented 1 year ago

I would like to give different basenames to the various machines in my (cross-region) cluster, to make it more obvious which node(s) are running in which region.

This will however not work with the DNSPoll strategy because it expects a single node_basename to be configured.

I think it could easily be adapted to support multiple node_basenames, by allowing the node_basename: field to accept a list of binaries (as well as as single binary as it does now).

bitwalker commented 1 year ago

That's probably fine, if you'd like to put together a PR for that change. The only problem I can see is that you'll need to attempt connecting to each name in the list for every IP returned by the DNS query until you successfully connect. That's probably not a big deal, but something to keep in mind when implementing the change.