From 8677c570e06796a2b8bc2a68c19d3fd25563ce9f Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 11 Aug 2021 12:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=EF=BC=9A=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=BC=8F=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- game-server/config/master.ts | 4 ++-- game-server/config/servers.ts | 42 +++++++++++++++++------------------ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 7f8c28896..527374bee 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,5 @@ 6.扩容脚本./pm2StarterDistribute.sh 7.手输命令示例如下: `pm2 start ./dist/app.js --name="activity-server-2" -x -- env=dev id=activity-server-2 host=172.26.145.171 port=9061 serverType=activity` -`pm2 start ./dist/app.js --name="connector-server-4" -x -- env=dev id=connector-server-4 host=172.26.145.171 port=9062 clientHost=121.89.211.172 clientPort=3050 serverType=connector frontend=true` +`pm2 start ./dist/app.js --name="connector-server-4" -x -- env=alpha id=connector-server-4 host=172.26.145.171 port=9062 clientHost=121.89.211.172 clientPort=3050 serverType=connector frontend=true` +8.主机部分的server.ts内的server如果需要做rpc remote,host需要从127.0.0.1改为私网地址 \ No newline at end of file diff --git a/game-server/config/master.ts b/game-server/config/master.ts index 3d764382b..b264c77f9 100644 --- a/game-server/config/master.ts +++ b/game-server/config/master.ts @@ -11,7 +11,7 @@ module.exports = { }, 'alpha': { 'id': 'master-server-1', - 'host': '127.0.0.1', + 'host': '172.26.145.159', 'port': 3005 }, 'dev': { @@ -31,7 +31,7 @@ module.exports = { }, 'distribute': { 'id': 'master-server-1', - 'host': '172.26.145.161', + 'host': '172.26.145.159', 'port': 3005 } }; \ No newline at end of file diff --git a/game-server/config/servers.ts b/game-server/config/servers.ts index 09cf6ae5a..4608ae991 100644 --- a/game-server/config/servers.ts +++ b/game-server/config/servers.ts @@ -99,53 +99,53 @@ module.exports = { }, 'alpha': { 'connector': [ - { 'id': 'connector-server-1', 'port': 4050, 'clientHost': 'zyz_web.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3050, 'frontend': true }, - { 'id': 'connector-server-2', 'port': 4051, 'clientHost': 'zyz_web.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3051, 'frontend': true }, - { 'id': 'connector-server-3', 'port': 4052, 'clientHost': 'zyz_web.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3052, 'frontend': true } + { 'id': 'connector-server-1', 'port': 4050, 'clientHost': 'zyz_web.trgame.cn', 'host': '172.26.145.159', 'clientPort': 3050, 'frontend': true }, + { 'id': 'connector-server-2', 'port': 4051, 'clientHost': 'zyz_web.trgame.cn', 'host': '172.26.145.159', 'clientPort': 3051, 'frontend': true }, + { 'id': 'connector-server-3', 'port': 4052, 'clientHost': 'zyz_web.trgame.cn', 'host': '172.26.145.159', 'clientPort': 3052, 'frontend': true } ], 'chat': [ - { 'id': 'chat-server-1', 'host': '127.0.0.1', 'port': 6050 }, - { 'id': 'chat-server-2', 'host': '127.0.0.1', 'port': 6051 }, - { 'id': 'chat-server-3', 'host': '127.0.0.1', 'port': 6052 } + { 'id': 'chat-server-1', 'host': '172.26.145.159', 'port': 6050 }, + { 'id': 'chat-server-2', 'host': '172.26.145.159', 'port': 6051 }, + { 'id': 'chat-server-3', 'host': '172.26.145.159', 'port': 6052 } ], 'role': [ - { 'id': 'role-server-1', 'host': '127.0.0.1', 'port': 6053 } + { 'id': 'role-server-1', 'host': '172.26.145.159', 'port': 6053 } ], 'battle': [ - { 'id': 'battle-server-1', 'host': '127.0.0.1', 'port': 6054 } + { 'id': 'battle-server-1', 'host': '172.26.145.159', 'port': 6054 } ], 'gate': [ - { 'id': 'gate-server-1', 'host': '127.0.0.1', 'clientHost': 'zyz_web.trgame.cn', 'clientPort': 3014, 'frontend': true }, + { 'id': 'gate-server-1', 'host': '172.26.145.159', 'clientHost': 'zyz_web.trgame.cn', 'clientPort': 3014, 'frontend': true }, { 'id': 'gate-server-2', - 'host': '127.0.0.1', + 'host': '172.26.145.159', 'clientHost': 'zyz_web.trgame.cn', 'clientPort': 3015, 'frontend': true } ], 'gm': [ - { 'id': 'gm-server-1', 'host': '127.0.0.1', 'port': 6055 } + { 'id': 'gm-server-1', 'host': '172.26.145.159', 'port': 6055 } ], 'systimer': [ - { 'id': 'systimer-server-1', 'host': '127.0.0.1', 'port': 6056 } + { 'id': 'systimer-server-1', 'host': '172.26.145.159', 'port': 6056 } ], 'guild': [ - { 'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239" }, - { 'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240" } + { 'id': 'guild-server-1', 'host': '172.26.145.159', 'port': 6057, "args": " --inspect=9239" }, + { 'id': 'guild-server-2', 'host': '172.26.145.159', 'port': 6058, "args": " --inspect=9240" } ], 'activity': [ - { 'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241" }, + { 'id': 'activity-server-1', 'host': '172.26.145.159', 'port': 6059, "args": " --inspect=9241" }, ], 'order': [ - { 'id': 'order-server-1', 'host': '127.0.0.1', 'port': 6060, "args": " --inspect=9242" }, + { 'id': 'order-server-1', 'host': '172.26.145.159', 'port': 6060, "args": " --inspect=9242" }, ] }, 'dev': { 'connector': [ - { 'id': 'connector-server-1', 'port': 4050, 'clientHost': 'zyzdev.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3050, 'frontend': true, "args": " --inspect=9237" }, - { 'id': 'connector-server-2', 'port': 4051, 'clientHost': 'zyzdev.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3051, 'frontend': true, "args": " --inspect=9229" }, - { 'id': 'connector-server-3', 'port': 4052, 'clientHost': 'zyzdev.trgame.cn', 'host': '127.0.0.1', 'clientPort': 3052, 'frontend': true, "args": " --inspect=9238" } + { 'id': 'connector-server-1', 'port': 4050, 'clientHost': 'zyzdev.trgame.cn', 'host': '172.26.145.161', 'clientPort': 3050, 'frontend': true, "args": " --inspect=9237" }, + { 'id': 'connector-server-2', 'port': 4051, 'clientHost': 'zyzdev.trgame.cn', 'host': '172.26.145.161', 'clientPort': 3051, 'frontend': true, "args": " --inspect=9229" }, + { 'id': 'connector-server-3', 'port': 4052, 'clientHost': 'zyzdev.trgame.cn', 'host': '172.26.145.161', 'clientPort': 3052, 'frontend': true, "args": " --inspect=9238" } ], 'chat': [ { 'id': 'chat-server-1', 'host': '172.26.145.161', 'port': 6050, "args": " --inspect=9234" }, @@ -159,10 +159,10 @@ module.exports = { { 'id': 'battle-server-1', 'host': '172.26.145.161', 'port': 6054, "args": " --inspect=9230" } ], 'gate': [ - { 'id': 'gate-server-1', 'host': '127.0.0.1', 'clientHost': 'zyzdev.trgame.cn', 'clientPort': 3014, 'frontend': true, "args": " --inspect=9227" }, + { 'id': 'gate-server-1', 'host': '172.26.145.161', 'clientHost': 'zyzdev.trgame.cn', 'clientPort': 3014, 'frontend': true, "args": " --inspect=9227" }, { 'id': 'gate-server-2', - 'host': '127.0.0.1', + 'host': '172.26.145.161', 'clientHost': 'zyzdev.trgame.cn', 'clientPort': 3015, 'frontend': true,