[erlang-questions] Mnesia Replication with local content

Prakash Parmar <>
Wed May 16 14:37:21 CEST 2018


Hello All,

According to my project requirements, I have Two mnesia nodes namely '' and ''. I want to create a Mnesia table with local content and same table name on both nodes.

Here are the Steps I'm following :

In One Terminal  -  $ erl -sname node1 -setcookie abc

On another Terminal - $ erl -sname node2 -setcookie abc

=====================================================================================

()1> net_adm:ping('').
pong

()2> nodes().
[]

()3> mnesia:create_schema(['', '']).
ok

()4> rpc:multicall(['', ''], mnesia, start,[]).
{[ok,ok],[]}

()5> mnesia:create_table( log_count,[{attributes, [counter, value]},{local_content, true},{disc_copies, ['','']}]).
{atomic,ok}

()6> mnesia:info().                                                                                                                      ---> Processes holding locks <---
---> Processes waiting for locks <---
---> Participant transactions <---
---> Coordinator transactions <---
---> Uncertain transactions <---
---> Active tables <---
log_count      : with 0        records occupying 298      words of mem
schema         : with 2        records occupying 530      words of mem
===> System info in version "4.14.3", debug level = none <===
opt_disc. Directory "/home/user/svn/mvpn-1.1/" is used.
use fallback at restart = false
running db nodes   = []
stopped db nodes   = []
master node tables = []
remote             = []
ram_copies         = []
disc_copies        = [log_count,schema]
disc_only_copies   = []
[{,disc_copies}] = [log_count]
[{,disc_copies},{,disc_copies}] = [schema]
4 transactions committed, 2 aborted, 0 restarted, 5 logged to disc
0 held locks, 0 in queue; 0 local transactions, 0 remote
0 transactions waits for other nodes: []
ok
=====================================================================================

Can anyone help me out why Table is not getting created on a 2ndnode?

When I removed option {local_content, true} that table getting created on a 2nd node.

Is there another way to achive this?

/Prakash Parmar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180516/595f211d/attachment.html>


More information about the erlang-questions mailing list