🔧 build(pinus server): 修改sq4和sq7的服务器配置

This commit is contained in:
luying
2022-10-21 11:55:24 +08:00
parent 9b89815f9a
commit 213e8b9c56
13 changed files with 444 additions and 56 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ filePath.CONFIG_DIR = '/config';
const adminfilePath = _pinus.DEFAULT_ADMIN_PATH;
adminfilePath.ADMIN_FILENAME = 'adminUser';
adminfilePath.ADMIN_USER = 'config/adminUser';
const ALL_ENVS = 'stable|development|alpha|dev|isbn|monitor|monitor2|distribute|sq1|sq3|sq4';
const ALL_ENVS = 'stable|development|alpha|dev|isbn|monitor|monitor2|distribute|sq1|sq3|sq4|sq7';
/**
* 替换全局Promise
* 自动解析sourcemap
+6
View File
@@ -66,4 +66,10 @@ module.exports = {
'redis': 'r-8vb9q6zk7bpcvo456g.redis.zhangbei.rds.aliyuncs.com',
'redispw': 'X9j2TKYy@cE6sSQD'
},
'sq7': {
'mongo': 'mongodb://dbop:zyzSQ72022@dds-8vbf3dbcaaeec4441.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vbf3dbcaaeec4442.mongodb.zhangbei.rds.aliyuncs.com:3717/zyz?replicaSet=mgset-512156065',
'gmmongo': 'mongodb://dbop:zyzSQGm2021@dds-8vb5de93552a67941.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb5de93552a67942.mongodb.zhangbei.rds.aliyuncs.com:3717,dds-8vb5de93552a67943.mongodb.zhangbei.rds.aliyuncs.com:3717/zyzgm?readPreference=secondary&replicaSet=mgset-508112742',
'redis': 'r-8vb53gmaww4042b2qb.redis.zhangbei.rds.aliyuncs.com',
'redispw': 'X9j2TKYy@cE6sSQD'
},
};
+15 -5
View File
@@ -59,19 +59,29 @@ module.exports = {
'host': '172.16.4.106',
'port': 3005
},
'sq4': {
'sq4': { // sq6
'id': 'master-server-1',
'host': '172.16.4.107',
'host': '172.16.4.122',
'port': 3005
},
'sq7': {
'id': 'master-server-1',
'host': '172.16.4.126',
'port': 3005
},
'sq5': {
'id': 'master-server-1',
'host': '172.16.4.107',
'host': '172.16.4.126',
'port': 3005
},
'sq6': {
'sq8': {
'id': 'master-server-1',
'host': '172.16.4.107',
'host': '172.16.4.126',
'port': 3005
},
'sq4add': { // sq4=>sq7
'id': 'master-server-1',
'host': '172.16.4.126',
'port': 3005
}
};
+100 -47
View File
@@ -366,92 +366,145 @@ module.exports = {
{ 'id': 'order-server-1', 'host': '172.16.4.106', 'port': 6060 },
]
},
'sq4': {
'sq4': { // sq6
'connector': [
{ 'id': 'connector-server-1', 'port': 4050, 'clientHost': 'sq4-game-sgzzyz.yev242.com', 'host': '172.16.4.107', 'clientPort': 3050, 'frontend': true },
{ 'id': 'connector-server-2', 'port': 4051, 'clientHost': 'sq4-game-sgzzyz.yev242.com', 'host': '172.16.4.107', 'clientPort': 3051, 'frontend': true },
{ 'id': 'connector-server-1', 'port': 4051, 'clientHost': 'sq6-game-sgzzyz.yev242.com', 'host': '172.16.4.122', 'clientPort': 3051, 'frontend': true },
{ 'id': 'connector-server-2', 'port': 4052, 'clientHost': 'sq6-game-sgzzyz.yev242.com', 'host': '172.16.4.122', 'clientPort': 3052, 'frontend': true },
{ 'id': 'connector-server-gm', 'port': 4099, 'clientHost': 'sq6-game-sgzzyz.yev242.com', 'host': '172.16.4.122', 'clientPort': 3099, 'frontend': true, 'isGM': 'true' }
],
'chat': [
{ 'id': 'chat-server-1', 'host': '172.16.4.107', 'port': 6050 },
{ 'id': 'chat-server-1', 'host': '172.16.4.122', 'port': 6071 },
],
'role': [
{ 'id': 'role-server-1', 'host': '172.16.4.107', 'port': 6051 },
{ 'id': 'role-server-2', 'host': '172.16.4.107', 'port': 6052 },
{ 'id': 'role-server-1', 'host': '172.16.4.122', 'port': 6072 },
{ 'id': 'role-server-2', 'host': '172.16.4.122', 'port': 6073 },
{ 'id': 'role-server-3', 'host': '172.16.4.122', 'port': 6074 },
],
'battle': [
{ 'id': 'battle-server-1', 'host': '172.16.4.107', 'port': 6053 },
{ 'id': 'battle-server-2', 'host': '172.16.4.107', 'port': 6054 },
{ 'id': 'battle-server-1', 'host': '172.16.4.122', 'port': 6075 },
{ 'id': 'battle-server-2', 'host': '172.16.4.122', 'port': 6076 },
],
'guild': [
{ 'id': 'guild-server-1', 'host': '172.16.4.122', 'port': 6077 },
{ 'id': 'guild-server-2', 'host': '172.16.4.122', 'port': 6078 },
{ 'id': 'guild-server-3', 'host': '172.16.4.122', 'port': 6079 }
],
'activity': [
{ 'id': 'activity-server-1', 'host': '172.16.4.122', 'port': 6080 },
{ 'id': 'activity-server-2', 'host': '172.16.4.122', 'port': 6081 },
{ 'id': 'activity-server-3', 'host': '172.16.4.122', 'port': 6082 },
],
'order': [
{ 'id': 'order-server-1', 'host': '172.16.4.122', 'port': 6083 },
],
'gm': [
{ 'id': 'gm-server-1', 'host': '172.16.4.122', 'port': 6084 }
],
'systimer': [
{ 'id': 'systimer-server-1', 'host': '172.16.4.122', 'port': 6056 }
],
},
'sq7': {
'connector': [
{ 'id': 'connector-server-1', 'port': 4051, 'clientHost': 'sq7-game-sgzzyz.yev242.com', 'host': '172.16.4.126', 'clientPort': 3051, 'frontend': true },
{ 'id': 'connector-server-2', 'port': 4052, 'clientHost': 'sq7-game-sgzzyz.yev242.com', 'host': '172.16.4.126', 'clientPort': 3052, 'frontend': true },
],
'chat': [
{ 'id': 'chat-server-1', 'host': '172.16.4.126', 'port': 6050 },
],
'role': [
{ 'id': 'role-server-1', 'host': '172.16.4.126', 'port': 6051 },
{ 'id': 'role-server-2', 'host': '172.16.4.126', 'port': 6052 },
],
'battle': [
{ 'id': 'battle-server-1', 'host': '172.16.4.126', 'port': 6053 },
{ 'id': 'battle-server-2', 'host': '172.16.4.126', 'port': 6054 },
],
'gm': [],
'systimer': [
{ 'id': 'systimer-server-1', 'host': '172.16.4.107', 'port': 6055 }
{ 'id': 'systimer-server-1', 'host': '172.16.4.126', 'port': 6055 }
],
'guild': [],
'activity': [
{ 'id': 'activity-server-1', 'host': '172.16.4.107', 'port': 6056 },
{ 'id': 'activity-server-2', 'host': '172.16.4.107', 'port': 6057 },
{ 'id': 'activity-server-3', 'host': '172.16.4.107', 'port': 6058 },
{ 'id': 'activity-server-4', 'host': '172.16.4.107', 'port': 6059 },
{ 'id': 'activity-server-1', 'host': '172.16.4.126', 'port': 6056 },
{ 'id': 'activity-server-2', 'host': '172.16.4.126', 'port': 6057 },
{ 'id': 'activity-server-3', 'host': '172.16.4.126', 'port': 6058 },
],
'order': [
{ 'id': 'order-server-1', 'host': '172.16.4.107', 'port': 6060 },
]
{ 'id': 'order-server-1', 'host': '172.16.4.126', 'port': 6059 },
],
},
'sq5': {
'connector': [
{ 'id': 'connector-server-3', 'port': 4052, 'clientHost': 'sq5-game-sgzzyz.yev242.com', 'host': '172.16.4.121', 'clientPort': 3052, 'frontend': true },
{ 'id': 'connector-server-4', 'port': 4053, 'clientHost': 'sq5-game-sgzzyz.yev242.com', 'host': '172.16.4.121', 'clientPort': 3053, 'frontend': true },
{ 'id': 'connector-server-5', 'port': 4054, 'clientHost': 'sq5-game-sgzzyz.yev242.com', 'host': '172.16.4.121', 'clientPort': 3054, 'frontend': true },
{ 'id': 'connector-server-3', 'port': 4053, 'clientHost': 'sq5-game-sgzzyz.yev242.com', 'host': '172.16.4.121', 'clientPort': 3053, 'frontend': true },
{ 'id': 'connector-server-4', 'port': 4054, 'clientHost': 'sq5-game-sgzzyz.yev242.com', 'host': '172.16.4.121', 'clientPort': 3054, 'frontend': true },
{ 'id': 'connector-server-5', 'port': 4055, 'clientHost': 'sq5-game-sgzzyz.yev242.com', 'host': '172.16.4.121', 'clientPort': 3055, 'frontend': true },
],
'chat': [
{ 'id': 'chat-server-2', 'host': '172.16.4.121', 'port': 6061 },
{ 'id': 'chat-server-2', 'host': '172.16.4.121', 'port': 6060 },
],
'role': [
{ 'id': 'role-server-3', 'host': '172.16.4.121', 'port': 6062 },
{ 'id': 'role-server-4', 'host': '172.16.4.121', 'port': 6063 },
{ 'id': 'role-server-5', 'host': '172.16.4.121', 'port': 6064 },
{ 'id': 'role-server-3', 'host': '172.16.4.121', 'port': 6061 },
{ 'id': 'role-server-4', 'host': '172.16.4.121', 'port': 6062 },
{ 'id': 'role-server-5', 'host': '172.16.4.121', 'port': 6063 },
],
'battle': [
{ 'id': 'battle-server-3', 'host': '172.16.4.121', 'port': 6065 },
{ 'id': 'battle-server-4', 'host': '172.16.4.121', 'port': 6066 },
{ 'id': 'battle-server-3', 'host': '172.16.4.121', 'port': 6064 },
],
'gm': [],
'systimer': [],
'guild': [
{ 'id': 'guild-server-1', 'host': '172.16.4.121', 'port': 6067 },
{ 'id': 'guild-server-2', 'host': '172.16.4.121', 'port': 6068 },
{ 'id': 'guild-server-3', 'host': '172.16.4.121', 'port': 6069 },
{ 'id': 'guild-server-1', 'host': '172.16.4.121', 'port': 6065 },
{ 'id': 'guild-server-2', 'host': '172.16.4.121', 'port': 6066 },
{ 'id': 'guild-server-3', 'host': '172.16.4.121', 'port': 6067 },
],
'activity': [
{ 'id': 'activity-server-4', 'host': '172.16.4.121', 'port': 6068 },
],
'order': [
{ 'id': 'order-server-2', 'host': '172.16.4.121', 'port': 6070 },
{ 'id': 'order-server-2', 'host': '172.16.4.121', 'port': 6069 },
]
},
'sq6': {
'sq8': {
'connector': [
{ 'id': 'connector-server-6', 'port': 4055, 'clientHost': 'sq6-web-sgzzyz.yev242.com', 'host': '172.16.4.122', 'clientPort': 3055, 'frontend': true },
{ 'id': 'connector-server-7', 'port': 4056, 'clientHost': 'sq6-web-sgzzyz.yev242.com', 'host': '172.16.4.122', 'clientPort': 3056, 'frontend': true },
{ 'id': 'connector-server-gm', 'port': 4099, 'clientHost': 'sq6-web-sgzzyz.yev242.com', 'host': '172.16.4.122', 'clientPort': 3099, 'frontend': true, 'isGM': 'true' }
{ 'id': 'connector-server-6', 'port': 4056, 'clientHost': 'sq8-game-sgzzyz.yev242.com', 'host': '172.16.4.127', 'clientPort': 3056, 'frontend': true },
{ 'id': 'connector-server-gm', 'port': 4099, 'clientHost': 'sq8-game-sgzzyz.yev242.com', 'host': '172.16.4.127', 'clientPort': 3099, 'frontend': true, 'isGM': 'true' }
],
'chat': [
{ 'id': 'chat-server-3', 'host': '172.16.4.122', 'port': 6071 },
{ 'id': 'chat-server-3', 'host': '172.16.4.127', 'port': 6070 },
],
'role': [
{ 'id': 'role-server-6', 'host': '172.16.4.122', 'port': 6072 },
{ 'id': 'role-server-7', 'host': '172.16.4.122', 'port': 6073 },
{ 'id': 'role-server-8', 'host': '172.16.4.122', 'port': 6074 },
{ 'id': 'role-server-6', 'host': '172.16.4.127', 'port': 6071 },
{ 'id': 'role-server-7', 'host': '172.16.4.127', 'port': 6072 },
{ 'id': 'role-server-8', 'host': '172.16.4.127', 'port': 6073 },
],
'battle': [
{ 'id': 'battle-server-5', 'host': '172.16.4.122', 'port': 6075 },
{ 'id': 'battle-server-6', 'host': '172.16.4.122', 'port': 6076 },
],
'guild': [
{ 'id': 'guild-server-4', 'host': '172.16.4.122', 'port': 6077 },
{ 'id': 'guild-server-5', 'host': '172.16.4.122', 'port': 6078 },
{ 'id': 'guild-server-6', 'host': '172.16.4.122', 'port': 6079 }
],
'order': [
{ 'id': 'order-server-3', 'host': '172.16.4.122', 'port': 6080 },
{ 'id': 'battle-server-4', 'host': '172.16.4.127', 'port': 6074 },
{ 'id': 'battle-server-5', 'host': '172.16.4.127', 'port': 6075 },
],
'gm': [
{ 'id': 'gm-server-1', 'host': '172.16.4.122', 'port': 6081 }
{ 'id': 'gm-server-1', 'host': '172.16.4.127', 'port': 6076 }
],
'systimer': [],
'guild': [
{ 'id': 'guild-server-4', 'host': '172.16.4.127', 'port': 6077 },
{ 'id': 'guild-server-5', 'host': '172.16.4.127', 'port': 6078 },
{ 'id': 'guild-server-6', 'host': '172.16.4.127', 'port': 6079 }
],
'activity': [],
'order': [
{ 'id': 'order-server-3', 'host': '172.16.4.127', 'port': 6080 },
],
},
'sq4add': { // sq4=>sq7
'connector': [],
'chat': [],
'role': [],
'battle': [],
'gm': [],
'systimer': [],
'guild': [],
'activity': [],
'order': [],
},
};
+177
View File
@@ -0,0 +1,177 @@
module.exports = {
'appenders': {
'console': {
'type': 'console'
},
'con-log': {
'type': 'file',
'filename': '/zyz_logs/log4js/con-log-${opts:serverId}.log',
'pattern': 'connector',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'rpc-log': {
'type': 'file',
'filename': '/zyz_logs/log4js/rpc-log-${opts:serverId}.log',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'forward-log': {
'type': 'file',
'filename': '/zyz_logs/log4js/forward-log-${opts:serverId}.log',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'rpc-debug': {
'type': 'file',
'filename': '/zyz_logs/log4js/rpc-debug-${opts:serverId}.log',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'crash-log': {
'type': 'file',
'filename': '/zyz_logs/log4js/crash.log',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'admin-log': {
'type': 'file',
'filename': '/zyz_logs/log4js/admin.log',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'pinus': {
'type': 'file',
'filename': '/zyz_logs/log4js/pinus-${opts:serverId}.log',
'maxLogSize': 1073741824,
'layout': {
'type': 'basic'
},
'backups': 20
},
'pinus-admin': {
'type': 'file',
'filename': '/zyz_logs/log4js/pinus-admin.log',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'pinus-rpc': {
'type': 'file',
'filename': '/zyz_logs/log4js/pinus-rpc-${opts:serverId}.log',
'maxLogSize': 104857600,
'layout': {
'type': 'basic'
},
'backups': 5
},
'app': {
'type': 'file',
'filename': '/zyz_logs/sls/app.log',
'maxLogSize': 1073741824,
'layout': {
'type': 'basic'
},
'backups': 20
},
'error': {
'type': 'file',
'filename': '/zyz_logs/sls/error.log',
'maxLogSize': 1073741824,
'layout': {
'type': 'basic'
},
'backups': 5
},
'ta': {
'type': 'file',
'filename': '/zyz_logs/ta/log',
'pattern': 'yyyy-MM-dd-hh',
'alwaysIncludePattern': true,
'layout': {
'type': 'pattern',
'pattern': '%m',
},
'backups': 240,
}
},
'categories': {
'default': {
'appenders': ['console', 'pinus'],
'level': 'debug'
},
'con-log': {
'appenders': ['con-log'],
'level': 'debug'
},
'rpc-log': {
'appenders': ['rpc-log'],
'level': 'debug'
},
'forward-log': {
'appenders': ['forward-log'],
'level': 'debug'
},
'rpc-debug': {
'appenders': ['rpc-debug'],
'level': 'debug'
},
'crash-log': {
'appenders': ['crash-log'],
'level': 'debug'
},
'admin-log': {
'appenders': ['admin-log'],
'level': 'debug'
},
'pinus-admin': {
'appenders': ['pinus-admin'],
'level': 'debug'
},
'pinus-rpc': {
'appenders': ['pinus-rpc'],
'level': 'debug'
},
'pinus': {
'appenders': ['pinus'],
'level': 'debug'
},
'info': {
'appenders': ['console', 'app'],
'level': 'debug'
},
'err': {
'appenders': ['console', 'error'],
'level': 'debug'
},
'ta': {
'appenders': ['console', 'ta'],
'level': 'info'
}
},
'replaceConsole': true,
'lineDebug': false,
'errorStack': true
};
+24
View File
@@ -0,0 +1,24 @@
// config
module.exports = {
// I. 必须的配置
server: 'ws://172.16.4.109:9092', // 填写前一节中部署的 xtransit-server 地址
appId: 1, // 创建应用得到的应用 ID
appSecret: 'b65a927ce54c53c2867139b3636f5993', // 创建应用得到的应用 Secret
// II. 比较重要的可选配置
disks: [], // 数组,配置需要监控的 disk 全路径
errors: [], // 数组,配置需要监控的 error 日志全路径
packages: [], // 数组,配置需要监控的项目依赖文件全路径
// III. 不是很重要的可选的配置
logDir: '/zyz_logs/xprofiler', // xprofiler 插件生成性能日志文件的目录,默认两者均为 os.tmpdir()
docker: false, // 默认 false, 系统数据采集会依赖当前是否是 docker 环境而进行一些特殊处理,可以手动强制指定当前实例是否为 docker 环境
ipMode: false, // 默认 false,此时仅使用 hostname 作为 agentId;设置为 true 后 agentId 组装形式为 ${ip}_${hostname}
libMode: false, // 默认 false,此时采集如果收到 shutdown 事件会退出当前进程;如果是以第三方库的形式引用接入应用内,请将此属性设置为 true
errexp: /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/i, // 匹配错误日志起始的正则,默认为匹配到 YYYY-MM-DD HH:mm:ss 时间戳即认为是一条错误日志的起始
logger: console, // 可以传入应用日志句柄方便日志统一管理,需要实现 error, info, warn 和 debug 四个方法
logLevel: 2, // 默认内置 logger 的日志级别,0 error,1 info,2 warning,3 debug,
titles: [], // 数组,如果应用使用了 process.title 自定义了名称,可以通过配置这里上报进程数据
};