maxpert / marmot

A distributed SQLite replicator built on top of NATS
https://maxpert.github.io/marmot/
MIT License
1.81k stars 41 forks source link

Adding ability to specify bind address for NATS address #69

Closed maxpert closed 1 year ago

maxpert commented 1 year ago

Reducing down changes to only specify bind address.

Old given that Marmot can now boot embedded NATS with dns://<DNS_ENTRIES:<port>/ to effective nats://<resolved_ip>:<port> for multiple entries, and actually wait for minimum number of nodes to come up before it proceeds, it was very obvious next step to automatically add/remove these entries from NATs server in background. This PR lays down foundation to do that in a dynamic way, so that cluster membership can be elastic based on DNS discovery.

NOTE Turns out the NATS configuration can't be reloaded in disk persistent mode which is core requirement for Marmot flows. In order to keep the good parts I am using this PR to strip extra stuff off and only keep couple of things I fixed while fixing PR.