当前位置: 首页 > 工具软件 > pomelo-cli > 使用案例 >

pomelo分布式部署记录

司空修贤
2023-12-01

所有参与分布式部署的机器:
必须为同类操作系统
必须都有一个同名的用户
Node.js的安装版本必须完全相同, 安装的绝对路径也必须完全相同
在所有参与分布式部署的机器上配置ssh免密登录使得各个机器之间可以进行顺畅的ssh登录.
把域名绑到负载均衡服务器上

配置好服务器与外网ip映射

 

{
  "development":{
    "gate": [
      {"id": "gate-test-1", "host": "192.168.0.5", "clientPort": 11001, "port": 11002, "frontend": true}
    ],
    "auth": [
      {"id": "auth-test-1", "host": "192.168.0.5", "port": 11003}
    ],
    "datanode": [
      {"id": "datanode-test-1", "host": "192.168.0.5", "port": 11004}
    ],
    "match": [
      {"id": "match-test-1", "host": "192.168.0.5", "port": 11005}
    ],
    "brecord": [
      {"id": "brecord-test-1", "host": "192.168.0.5", "port": 18001}
    ],
    "pay": [
      {"id": "pay-test-1", "host": "192.168.0.5", "port": 19001}
    ],
    "league": [
      {"id": "league-test-1", "host": "192.168.0.5", "port": 11006}
    ],
    "slog": [
      {"id": "slog-test-1", "host": "192.168.0.5", "port": 20001}
    ],
    "gconnector": [
      {"id": "gconnector-test-1", "host": "192.168.0.5", "port": 13001, "clientPort": 12001, "frontend": true},
      {"id": "gconnector-test-2", "host": "192.168.0.8", "port": 13002, "clientPort": 12002, "frontend": true},
      {"id": "gconnector-test-3", "host": "192.168.0.8", "port": 13003, "clientPort": 12003, "frontend": true},
      {"id": "gconnector-test-4", "host": "192.168.0.8", "port": 13004, "clientPort": 12004, "frontend": true}
    ],
    "bconnector": [
      {"id": "bconnector-test-1", "host": "192.168.0.5", "port": 15001, "clientPort": 14001, "frontend": true},
      {"id": "bconnector-test-2", "host": "192.168.0.8", "port": 15002, "clientPort": 14002, "frontend": true},
      {"id": "bconnector-test-3", "host": "192.168.0.8", "port": 15003, "clientPort": 14003, "frontend": true},
      {"id": "bconnector-test-4", "host": "192.168.0.8", "port": 15004, "clientPort": 14004, "frontend": true}
    ],
    "game": [
      {"id": "game-test-1", "host": "192.168.0.5", "port": 16001},
      {"id": "game-test-2", "host": "192.168.0.8", "port": 16002},
      {"id": "game-test-3", "host": "192.168.0.8", "port": 16003},
      {"id": "game-test-4", "host": "192.168.0.8", "port": 16004}
    ],
    "battle": [
      {"id": "battle-test-1", "host": "192.168.0.5", "port": 17001},
      {"id": "battle-test-2", "host": "192.168.0.8", "port": 17002},
      {"id": "battle-test-3", "host": "192.168.0.8", "port": 17003},
      {"id": "battle-test-4", "host": "192.168.0.8", "port": 17004}
    ]
  }

 

两台服务器选一个主服务器
对外开放端口
协议    service01端口    service02端口
tcp            6622    
tcp            11001    
tcp            12001    
tcp                                  12002
tcp                                  12003
tcp                                  12004
tcp            14001    
tcp            14002
tcp            14003
tcp            14004


支付对接问题
分布式部署需要打通各服务器网络 不然支付会有问题

pomelo运维管理工具  pomelo-cli

 类似资料: