[erlang-questions] Node not active but is connected

code wiget codewiget95@REDACTED
Wed Jul 26 21:37:01 CEST 2017


Hello,

For background, right now I have two instances of emqtt running on two separate computers on the same network. I have written an Erlang program to create an mnesia instance and a shared table between them, as I need to be able to access an important key value store from both instances.

The problem is that I can use net_kernel:connect_node(‘emqttd@REDACTED’). to connect the nodes, which is successful, but then when I try to use amnesia:create table with disc copies on all of those nodes, I get an error that the nodes I am connecting to are not active. Below I will illustrate the flow:

connect_all_nodes(Nodelist)
nodes() is now = Nodelist
mnesia:create_schema([node()]) — create a scheme on the local, non-emqtt instance (cannot add other nodes as they have their own mnesia DB’s running)
Start mnesia
mnesia:Create_table(device, [{attributes, record_info(fields, device)}, 
						{disc_copies, nodes()},
						{type, set}]).

— this last command fails with the error:{aborted,{not_active,iot_device,’emqttd@REDACTED’}}
—How is it possible that my node thinks this device is not active if I have already connected the nodes, verified that nodes() has been populated, and I’ve even tested using net_admn ping and I get a pong.

How do I get them to truly recognize each other?


Thank you for your help!


More information about the erlang-questions mailing list