How Elixir can read remote node mnesia table
Asked Answered
O

1

6

I am trying use Elixir to write program to access mnesia. I run iex shell in amazon linux. I tried to connect another node using

Node.connect(:'[email protected]')

which return true, then I want to run mnesia command on this remote node, I issue

  :mneisa.info

However, it only returns local node mnesia info. How can I access the connected remote node's mnesia database?

I have tried rpc_call, it works. But is it having more direct method to get the data from remote node mnesia.

Obstetrics answered 15/4, 2015 at 5:31 Comment(0)
W
8

Did you try:

Node.spawn :'[email protected]', fn -> :mneisa.info end 
Winny answered 15/4, 2015 at 8:35 Comment(1)
See elixir-lang.org/docs/stable/elixir and click on Node in the side bar for more useful documentation - glad to assist.Winny

© 2022 - 2024 — McMap. All rights reserved.