How to connect to a registered Node (Erlang) and use it from Ejabberd

主宰稳场 提交于 2019-12-13 17:14:59

问题


I have a server application with a running node, awaits for rpc calls....

(n2@198.XXX.X.XX)>

I have a node started on a different machine in which I have ejabberd running as well

erl -name n2@198.XXX.X.XX -setcookie somecookie

(n1@198.XXX.X.XX)>

And then I have ejabberd server started with ejabberdctl live and I want to be able to ping n2 from n1 (n1@198.XXX.X.XX)>.

I can see that n1 is registered and running with net_adm:names().

I tried to do do directly from code net_adm:ping(n2@198.XXX.X.XX). but it says that system not running with qualified hostname

I need a way to connect/use to n1 and communicate with n2 How to switch to n1 and make the rpc to n2 programatically?


回答1:


Take a look at your particular ejabberdctl and grep for "name" or "sname". It says if node was started with short name or fully qualified. It must match your "erl -name". Identify one way of naming nodes and alter your node or ejabberd script.



来源:https://stackoverflow.com/questions/18187288/how-to-connect-to-a-registered-node-erlang-and-use-it-from-ejabberd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!