问题描述环境:Workerman version:3.5.14 PHP version:7.2.8为了分开部署演练,在同一台机器,我把Register Gateway BusinessWorker 按顺序分开启动,wokerman.log不停的提示:2018-09-24 11:15:18 pid:9978 Gateway: Worker->name conflict. Key:127.0.0.1:MailBusinessWorker:32018-09-24 11:15:18 pid:9966 Gateway: Worker->name conflict. Key:127.0.0.1:MailBusinessWorker:32018-09-24 11:15:18 pid:9926 Gateway: Worker->name conflict. Key:127.0.0.1:MailBusinessWorker:32018-09-24 11:15:18 pid:9966 Gateway: Worker->name conflict. Key:127.0.0.1:MailBusinessWorker:32018-09-24 11:15:18 pid:9954 Gateway: Worker->name conflict. Key:127.0.0.1:MailBusinessWorker:32018-09-24 11:15:18 pid:9978 Gateway: Worker->name conflict. Key:127.0.0.1:MailBusinessWorker:3导致我的磁盘很快就爆满了。问题出现的环境背景及自己尝试过哪些方法我看了一下源码说在一台服务器上businessWorker->name不能相同,但还是没有搞清楚怎么会提示conflict相关代码// bussinessWorker 进程$worker = new BusinessWorker();$worker->name = 'MailBusinessWorker';$worker->count = 6;......请大家帮忙,什么原因导致的conflict?怎么解决?
1 回答
慕尼黑5688855
TA贡献1848条经验 获得超2个赞
问题已解决,
原因:
使用php管理进程:shell_exec("php MailBusinessWorker.php stop"),
但却删除了主进程pid,但是子进程却没同时被删除,导致二次启动BusinessWorker,就会有冲突提示(Gateway: Worker->name conflict),同样GatewayWorker所有进程未删除干净,也一样会有conflict提示。
解决方法:
第一步:shell_exec("php MailBusinessWorker.php stop");
第二步,写了一个Php函数,调用ps 和 kill命令,强制删除所有未删除干净的子进程
总之:删除干净所有相关的worker的进程,就不会报错。
- 1 回答
- 0 关注
- 3418 浏览
添加回答
举报
0/150
提交
取消