Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

单独启动的游戏服务,可以自动加入到集群,但是尝试进入游戏报错fail to forward message:TypeError: Cannot read property 'msgRemote' of undefined #44

Closed
Jasonlbf opened this issue Oct 18, 2018 · 4 comments

Comments

@Jasonlbf
Copy link

用pomelo start -e production -d . 命令启动了一个gate,两个connector,2个游戏。 之后用NODE_ENV=production node app.js host="127.0.0.1" port=6950 frontend=false serverType="game3" id="game3-server-1" 命令启动了另一个游戏。
master发现了这个游戏“master watchdog notify to monitor success, id: game3-server-1 ........”。
game3也收到相关信息“game3-server-1 receive replaceServer signal: {"action":"replaceServer","servers":{"scheduleJ.............”。
但是无法从大厅进入游戏,报错“fail to forward message:TypeError: Cannot read property 'msgRemote' of undefined”
请问:是哪里配置不对吗?

@Jasonlbf
Copy link
Author

pomelo版本2.2.5

@whtiehack
Copy link
Member

因为这个配置的服务器已经启动了。如果需要添加配置文件里没有的服,需要使用 pinus add。

@Jasonlbf
Copy link
Author

@whtiehack 感谢您的回答。
我现在遇到的问题是:配置文件里没有的服,已经通过docker的方式启动,master通过watchdog发现了这个服,但是无法从大厅进入游戏。如果用pinus add命令,底层是调用ssh命令去启动这个服。请问还有其他技术手段吗?或者,将每个服都Docker化(没有在配置文件里)可以实现吗?

@whtiehack
Copy link
Member

理论上你直接改端口,服ID来启动进程,就是一个服。

你既然是用docker启动,那么建议你master进程单独启动比较好。

启动master:

node app.js mode=stand-alone

启动connector:

node app.js env=development  id=connector-server-1  host=127.0.0.1  port=3150  clientHost=192.168.1.10  clientPort=3010  frontend=true  serverType=connector

启动main:

node app.js env=development  id=main-server-1  host=127.0.0.1  port=5100  serverType=main 

其它进程的启动方式可以参考 connector,和main的启动参数,只需要更改 host port, id , 这些进程在配置里是可以不用存在的。

whtiehack added a commit that referenced this issue Dec 6, 2019
Update dependency express to v4.17.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants