gateway-worker 分布式部署容器中 Address not available

小叽叽叽叽

问题描述

我运行在服务器的容器中 进行分布式的部署 出现报错stream_socket_server(): Unable to connect to tcp://172.16.12.123:1236 (Address not available) in file /var/www/rbac/vendor/workerman/workerman/Worker.php on line 2360

Fatal error: Uncaught Exception: Address not available

程序代码


return [
    'gateway' => [
        'handler' => Gateway::class,
        'listen' => 'websocket://0.0.0.0:7272',
        'count' => cpu_count(),
        'reloadable' => false,
        'constructor' => ['config' => [
            'lanIp' => '172.16.12.122', # 127.0.0.1:1236
            'startPort' => 2300,
            'pingInterval' => 25,
            'pingNotResponseLimit' => 0,
            'pingData' => '{"type":"ping","code":10000}',
            'registerAddress' => ['172.16.12.122:1236', '172.16.12.124:1236', '172.16.12.123:1236'],# 127.0.0.1:1236
            'onConnect' => function () {
            },
        ]]
    ],
    'worker' => [
        'handler' => BusinessWorker::class,
        'count' => cpu_count() * 2,
        'constructor' => ['config' => [
            'eventHandler' => plugin\webman\gateway\Events::class,
            'name' => 'ChatBusinessWorker',
            'registerAddress' => ['172.16.12.122:1236', '172.16.12.124:1236', '172.16.12.123:1236'], # 127.0.0.1:1236 1号机器-172.16.12.123
        ]]
    ],
    'register' => [
        'handler' => Register::class,
        'listen' => 'text://172.16.12.122:1236', # 127.0.0.1:1236
        'count' => 1, // Must be 1
        'constructor' => []
    ],
];

报错信息

截图

407 0 0
0个回答

×
🔝