NATS autocluster

Written by
Link to Post

For my home automation system, I’d like to run gnatsd ( as a sidecar to all of the nodes I connect to the network and have each gnatsd automatically cluster with the other nodes present. This way, all of the applications can simply send and receive messages to the local gnatsd instance and be reasonably sure that the applications that need the messages can get them. So far I’ve come up with this short bit of Go: which basically just uses a nats client to try and connect to all of the nodes on the network and then return the IPs of the ones that were successful and shell out a command to start up gnatsd with the other node IPs as command line arguments.

Is there a better way to do this? Any and all suggestions are welcome.

I understand there are potential security issues with this, this is all happening on my local secured network and I’m not concerned about hackers.

submitted by /u/brightam1
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply