I have an application that I want to run distributed on two nodes (one main and one failover).
I have two config files for each node.
Now I am running my application on the two nodes using:
rebar3 shell --sname a --config a
rebar3 shell --sname b --config b
The problem is that the application starts on both nodes since I suppose they are not pre-connected when I am issuing the rebar
command.
Config files
[
{kernel,[{distributed,[{ex_banking,['a@AdrianB-LAPTOP','b@Adrian-LAPTOP']}]},
{sync_nodes_timeout,3000}]},
{ex_banking,[{port,3000}]}].
[
{kernel,[{distributed,[{ex_banking,['a@AdrianB-LAPTOP','b@Adrian-LAPTOP']}]},
{sync_nodes_mandatory,['a@AdrianB-LAPTOP'},
{sync_nodes_timeout,3000}]},
{ex_banking,[{port,3000}]}].
What is the strategy to connect the nodes when/after using rebar shell
? Is there any way to create scripts or something?
I just want the nodes connected but only the main one starting witht the application started,while the second one takes on when the first crashes.