Because the server is a version of servers, it is difficult to visually see Mnesia data. So it's very confusing for beginners.
Specifically in the QQ group to consult others. Others say that as long as the pong through the line, you can use RPC to operate the remote Mnesia database. Beginners too understand this meaning. Then specifically search for a bit, and finally found someone else about the two Erl node Server ping Pass article.
OK, then connect the Ejabber Mnesia database remotely.
Ejabberd default node is [email protected], this node is not normal ping pass. I also try to modify the Ejabberdctl.cfg configuration file, hosts and other files to modify the Ejabberd node. Although successful, Ejabberd can start, but the Stop command is not valid. I didn't delve into the question. Want to connect directly to Ejabberd's Mnesia. Regardless of the Ejabberd node problem.
So...
Start Erlang, and specify the directory for the Mnesia database.
I operate on the virtual machine as follows:
- $ Erl-name ' [email protected] '-mnesia dir ' "/var/lib/ejabberd" ' (IP for native IP, must, otherwise not ping pass)
- ([email protected]) >
- ([email protected]) > Auth:get_cookie (). (Get Cookie)
- ([email protected]) > ' Absdvfhtfsh '
Copy the cookie and then operate on this computer:
- $ Erl-name ' [email protected] '-setcookie ' absdvfhtfsh '
- ([email protected]) >
- ([email protected]) >net_adm:ping (' [email protected] ').
- ([email protected]) >pong
Pong said, Pang said there was no pass
Then you can operate the Mnesia remotely. For example: Observer:start ().
Remote connection to the Ejabberd Mnesia database