1.默认情况下Erlang的集群访问是全授权的,只要cookie认证过了后,新加入的节点可以访问集群里面的任何机器,这给运维带来很大风险。目前erlang有二种方法可以限制 1. IP网段限制 2. 节点名称限制。这个是通过net_kernel:allow来实现的,参看:

cmd 开启允许链接的节点名
werl -name  [email protected] -setcookie YYYYYY

2. 判断当前是不是longname

([email protected])2> net_kernel:longnames().
true
 

3. 如果不知道node跟cookie可以,

在linux环境运行的erlang程序中获取cookie和node,方法很简单,输入erlang:get_cookie()和node()。
([email protected])3> node().
'[email protected]'
([email protected])4> erlang:get_cookie().
'YYYYYY'

4. 修改erlang vm的cookie,只有与要连接的进程cookie相同时才能进行连接加入集群
  erlang:set_cookie(node(), Cookie).
    net_adm:ping(Node()).
([email protected])4> erlang:set_cookie(node(),'YYYYYY').
true
([email protected])5> net_adm:ping('[email protected]').
pong

5. 启动observer:start(),成功后可以在Nodes选项中查看需要的一些信息

([email protected])6> observer:start().

windows界面启动linux下的observer:start()

windows界面启动linux下的observer:start()

添加 [email protected]

 

相关文章:

  • 2021-08-10
  • 2022-12-23
  • 2021-12-19
  • 2022-03-04
  • 2021-07-30
  • 2021-09-14
  • 2022-12-23
猜你喜欢
  • 2021-11-02
  • 2021-12-28
  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
  • 2022-03-03
  • 2022-12-23
相关资源
相似解决方案