Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:25:32+00:00 2026-05-30T08:25:32+00:00

I have a mnesia database containning different tables. I want to be able to

  • 0

I have a mnesia database containning different tables.

I want to be able to access the tables from different Linux terminals.

I have a function called add_record, which takes a few parameters, say name and id. I want to be able to call add_record on node1 and add record on node2 but I want to be updating the same table from different locations.

I read a few sources and the only thing i found out was that i should use net_adm:ping (node2). but somehow I cant access the data from the table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:25:34+00:00Added an answer on May 30, 2026 at 8:25 am

    i assume that you probably meant replicated table. Suppose you have your mnesia table on node: nodea@127.0.0.1 with -setcookie mycookie, whether its replicated on another node or not, if i want to access the records from another terminal, then i have to use erlang in this other terminal as well by creating a node, connecting this node to our node with the table (you ensure that they all have the same cookie), then you call a method on the remote node.

    Lets say you want to use a method add_record in module mydatabase.erl on the node nodea@127.0.0.1 which is having the mnesia table, the i open a linux terminal and i enter the following:

    $ erl -name remote@127.0.0.1 -setcookie mycookie
    Eshell V5.8.4  (abort with ^G)
    1> N = 'nodea@127.0.0.1'.
    'nodea@127.0.0.1'
    2> net_adm:ping(N).
    pong
    3> rpc:call(N,mydatabase,add_record,[RECORD]).
    {atomic,ok}
    4> 
    

    with this module (rpc), you can call any method on a remote node, if the two nodes are connected using the same cookie. start by calling this method on the remote node:

    rpc:call('nodea@127.0.0.1',mnesia,info,[]).
    

    It should display everything in your remote terminal. I suggest that probably, you first go through this lecture: Distributed Erlang Programming and then you will be able to see how replicated mnesia tables are managed. Go through that entire tutorial on that domain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have designed a mnesia database with 5 different tables. The idea is to
I have an mnesia database dump from an ejabberd server (DCD, DCL, and DAT
I'm using RabbitMQ on an EC2 instance and I have the Mnesia tables on
I have this function: show_employee_table() -> do(qlc:q([B || B <- mnesia:table(employee)])). What it does
Have you refactored from an ActiveRecord to a DataMapper pattern? What conditions prompted the
I have an mnesia table with fields say f1, f2, f3. Now if I
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in
Have a bunch of WCF REST services hosted on Azure that access a SQL
I want to learn a functional language and Mnesia seems killer app enough for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.