I have mnesia installed on a node a.
I have already defined a schema and a table.
Now i do not know how can i add another node b so that mnesia now can run distributed.
By distributed i mean :
- issue a
insertof a record in mnesia from nodea - be able to fetch the record when querying mnesia of node
b
What i have tried:
- Start node
aand start mnesia create_schemaandcreate_tableon nodeadirty_insertin nodea
Then
Start node
bconnect node
bto nodeafrom node
aissue :mnesia:change_config(extra_db_nodes,[nodes()]).// doesnt matter if i issue this command from nodeaor nodebi get the following error :(a@DESKTOP-GOMS8S8)7> mnesia:change_config(extra_db_nodes,[nodes()]). =ERROR REPORT==== 3-Jul-2021::13:33:16.147000 === Error in process <0.138.0> on node 'a@DESKTOP-GOMS8S8' with exit value: {function_clause, [{gen_server,do_abcast, [[['b@DESKTOP-GOMS8S8']], mnesia_controller, {'$gen_cast',{merging_schema,'a@DESKTOP-GOMS8S8'}}], [{file,"gen_server.erl"},{line,263}]}, {mnesia_controller,connect_nodes2,3, [{file,"mnesia_controller.erl"},{line,486}]}]}
** exception exit: function_clause in function gen_server:do_abcast/3 called as gen_server:do_abcast([['b@DESKTOP-GOMS8S8']], mnesia_controller, {'$gen_cast', {merging_schema,'a@DESKTOP-GOMS8S8'}})
in call from mnesia_controller:connect_nodes2/3 (mnesia_controller.erl, line 486)
I just want any operation i do upon mnesia of a given node to be reflected on the others
nodes()already returns a list, so there is no need to wrap the return value in a list. Try this: