1) Is there a way to automatically detect when a node fails, from another node?
2) Is there a way to automatically re-start the node which just crashed?
Regarding my second question, I have googled about and I cannot see to find any mention to creating nodes from code/at runtime.
I understand you can do this with processes- creating processes at runtime is trivial and if you want to know when they crash you can create them from a supervisor etc- but I cant find anything relating to node detection/creation.
Need this for a client who wish to design a smaller version of Amazon EDS, but I cannot imagine Amazon manually restarting nodes if they go down!
You can make use of
net_kernel:monitor_nodes(true, [{node_type, visible}])to monitor all visible nodes from inside your erlang application. From man page:I don’t see any straight forward method (from inside your process which receives
nodedownmessage) using which you can start a node on remote machine. You will probably need to write a small module which do this for you automatically.