gateway 和businessworker分开部署,其中gateway和register在同一台服务器,
gateway 配置如下:
$gateway->count = 8;
$gateway->lanIp = '0.0.0.0';
$gateway->startPort = 28715;
// 服务注册地址(阿里云公网ip)
$gateway->registerAddress = '47.104.100.155:1236';
businessworker 配置如下:
$worker->count = 20;
// 服务注册地址
$worker->registerAddress = '47.104.100.155:1236';
然后启动businessworker服务,报错
GatewayConnection Error : 1 ,connect 0.0.0.0:28719 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28720 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28721 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28716 fail after 0.0001 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28715 fail after 0.0003 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28717 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28722 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28718 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28719 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28720 fail after 0.0002 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28721 fail after 0.0001 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28716 fail after 0.0001 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28715 fail after 0.0003 seconds
GatewayConnection Error : 1 ,connect 0.0.0.0:28717 fail after 0.0002 seconds
防火墙没开,阿里云安全组已开放端口28715-28722
$gateway->lanIp 不能写0.0.0.0
但是我写成阿里云公网ip,又会报错Exception: Cannot assign requested address in /home/www/games_websocket/vendor/workerman/workerman/Worker.php:1484
写内网ip
我两台服务器ip不是一个网段的,不能用内网ip