I'm trying to configure a proof of concept where a server automatically gets spun up and joins a replication cluster. When the server is no longer needed, it gets spun down, and automatically removed from the cluster.
There is no way of pre-defining IP addresses, nor is there a way of controlling which servers get spun down when less servers are needed. (Amazon Auto-Scaling)
How can I get the server to discover and join the already existent Gluster cluster? I was thinking of running a cron job @reboot, which probes the network to see if there are any servers online running Gluster, and then SSH's into the first it finds, executing the necessary commands. The problem is that I can't seem to find a way to succesfully probe the network.
To make automated shutdowns a not an issue, I was thinking of running a cron job on each of the cluster peers, checking if there are any disconnected peers, and removing those disconnected peers if any are found. This seems quite convoluted. Is there a better/cleaner way of doing this?
I'm rather new to GlusterFS. Any tips and pointers are welcome.