hyj1991 / easy-monitor

企业级 Node.js 应用性能监控与线上故障定位解决方案
http://www.devtoolx.com
BSD 2-Clause "Simplified" License
3.08k stars 240 forks source link

关于monitor 在pm2的cluster模式下运行如何保证只运行单个monitor服务 #120

Closed liSong5713 closed 4 years ago

hyj1991 commented 4 years ago

具体是什么问题?

liSong5713 commented 4 years ago

sorry 我这边一下操作错了。再重新编辑

hyj1991 commented 4 years ago

如果是单机的话,现在默认 pm2 启动多个进程的状况下, dashboard 会竞争端口因此只会成功启动一个,参见:

https://github.com/hyj1991/easy-monitor/blob/master/src_logic/dashboard/index.js#L41

以及

https://github.com/hyj1991/easy-monitor/blob/master/src_logic/dashboard/index.js#L62

如果你指的是集群部署的话,参考这个 http://47.100.164.242/document/#/?id=-cluser-%e6%a8%a1%e5%bc%8f

hyj1991 commented 4 years ago

先关闭了,如果还有其他问题可以再打开继续在这里讨论。