worker[BusinessWorker:3026857] exit with status 14

atie

问题描述

2024-06-07我启动了,一直运行好好的,今天突然报了个错,Unable to connect to tcp://127.0.0.1:2000 导致我现在前端连接不上websocket了,不知道什么原因,下面是我的配置文件,麻烦大佬们看看 我是哪里配置错误了吗?

这里详细描述问题
2024-06-07 19:10:53 pid:3026850 Workerman[think] start in DAEMON mode
2024-06-13 14:50:12 pid:3026857 think\exception\ErrorException: stream_socket_client(): Unable to connect to tcp://127.0.0.1:2000 (Connection refused) in /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/gateway-worker/src/Lib/Gateway.php:755
Stack trace:

0 [internal function]: think\initializer\Error->appError()

1 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/gateway-worker/src/Lib/Gateway.php(755): stream_socket_client()

2 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/gateway-worker/src/Lib/Gateway.php(720): GatewayWorker\Lib\Gateway::getBufferFromGateway()

3 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/gateway-worker/src/Lib/Gateway.php(394): GatewayWorker\Lib\Gateway::getBufferFromAllGateway()

4 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/gateway-worker/src/Lib/Gateway.php(170): GatewayWorker\Lib\Gateway::getClientIdByUid()

5 /www/wwwroot/cn-im-api-produce.files99.com/app/wkman/controller/Events.php(71): GatewayWorker\Lib\Gateway::isUidOnline()

6 [internal function]: app\wkman\controller\Events::onClose()

7 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/gateway-worker/src/BusinessWorker.php(414): call_user_func()

8 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/workerman/Connection/TcpConnection.php(656): GatewayWorker\BusinessWorker->onGatewayMessage()

9 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/workerman/Events/Select.php(292): Workerman\Connection\TcpConnection->baseRead()

10 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/workerman/Worker.php(2423): Workerman\Events\Select->loop()

11 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()

12 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/workerman/Worker.php(1556): GatewayWorker\BusinessWorker->run()

13 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/workerman/Worker.php(1386): Workerman\Worker::forkOneWorkerForLinux()

14 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/workerman/Worker.php(1360): Workerman\Worker::forkWorkersForLinux()

15 /www/wwwroot/cn-im-api-produce.files99.com/vendor/workerman/workerman/Worker.php(547): Workerman\Worker::forkWorkers()

16 /www/wwwroot/cn-im-api-produce.files99.com/vendor/topthink/think-worker/src/command/GatewayWorker.php(108): Workerman\Worker::runAll()

17 /www/wwwroot/cn-im-api-produce.files99.com/vendor/topthink/think-worker/src/command/GatewayWorker.php(77): think\worker\command\GatewayWorker->start()

18 /www/wwwroot/cn-im-api-produce.files99.com/vendor/topthink/framework/src/think/console/Command.php(210): think\worker\command\GatewayWorker->execute()

19 /www/wwwroot/cn-im-api-produce.files99.com/vendor/topthink/framework/src/think/Console.php(649): think\console\Command->run()

20 /www/wwwroot/cn-im-api-produce.files99.com/vendor/topthink/framework/src/think/Console.php(308): think\Console->doRunCommand()

21 /www/wwwroot/cn-im-api-produce.files99.com/vendor/topthink/framework/src/think/Console.php(245): think\Console->doRun()

22 /www/wwwroot/cn-im-api-produce.files99.com/think(10): think\Console->run()

23 {main}

2024-06-13 14:50:12 pid:3026857 Worker[3026857] process terminated
2024-06-13 14:50:42 pid:3026855 worker[BusinessWorker:3026857] exit with status 14

下面是我的配置文件,我用的thinkphp6+workman组合

程序代码

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Workerman设置 仅对 php think worker:gateway 指令有效
// +----------------------------------------------------------------------

$gateway_config = [
    // 扩展自身需要的配置
    'protocol'              => 'websocket', // 协议 支持 tcp udp unix http websocket text
    'host'                  => '0.0.0.0', // 监听地址
    'port'                  => 2348, // 监听端口
    'socket'                => '', // 完整监听地址

    'register_deploy'       => true, // 是否需要部署register
    'businessWorker_deploy' => true, // 是否需要部署businessWorker
    'gateway_deploy'        => true, // 是否需要部署gateway

    // Register配置
    'registerAddress'       => '127.0.0.1:1236',
    // Gateway配置
    'name'                  => 'thinkphp',
    'count'                 => 1,
    'lanIp'                 => '127.0.0.1',
    'startPort'             => 2000,
    'daemonize'             => false,

    // BusinsessWorker配置
    'businessWorker'        => [
        'name'         => 'BusinessWorker',
        'count'        => 1,
        // 'eventHandler' => '\think\worker\Events',
        'eventHandler' => app\wkman\controller\Events::class,
    ],

];
return $gateway_config;
324 0 0
0个回答

×
🔝