gatewayworker日志分类

小W

问题:今天突然遇到ws链接不上。

查看服务:php think xxx status 服务都正常。
查看gateway日志发现,3个周多点,日志量就达到1.2G,没找到问题出现的原因,只好重启服务,重启后正常。

需求:目前框架有没有继承日志分割服务?

1516 7 0
7个回答

walkor 打赏

workerman.log 产生大量日志说明业务出现了问题,要去解决它,解决了就不会产生日志了。
workerman.log没有日期分割功能

  • 小W 2022-08-19

    哦哦,感谢

  • 小W 2022-08-19

    大神,求助这日志输出是啥错误

小W
> pid:6241 think\exception\ErrorException: stream_socket_client(): unable to connect to tcp://192.168.1.28:2301 (Connection refused) in /www/wwwroot/ws.icloudcity.cn/cronjob/vendor/workerman/gateway-worker/src/Lib/Gateway.php:755
Stack trace:
#0 [internal function]: think\initializer\Error->appError(2, 'stream_socket_c...', '//ws...', 755, Array)
#1 /cronjob/vendor/workerman/gateway-worker/src/Lib/Gateway.php(755): stream_socket_client('tcp://192.168.1...', 111, 'Connection refu...', 3)
#2 /cronjob/vendor/workerman/gateway-worker/src/Lib/Gateway.php(700): GatewayWorker\Lib\Gateway::getBufferFromGateway(Array)
#3 /cronjob/vendor/workerman/gateway-worker/src/Lib/Gateway.php(658): GatewayWorker\Lib\Gateway::getBufferFromSomeGateway(Array)
#4 /cronjob/vendor/workerman/gateway-worker/src/Lib/Gateway.php(488): GatewayWorker\Lib\Gateway::select(Array, Array)
#5 /cronjob/app/command/workerHandler/GatewayEvents.php(524): GatewayWorker\Lib\Gateway::getUidByClientId('c0a8011c08fd000...')
#6 /cronjob/app/command/workerHandler/GatewayEvents.php(228): app\command\workerHandler\GatewayEvents::checkMessageParams('c0a8011c08fd000...', Array)
#7 [internal function]: app\command\workerHandler\GatewayEvents::onMessage('c0a8011c08fd000...', '{"moduleName":"...')
#8 /cronjob/vendor/workerman/gateway-worker/src/BusinessWorker.php(408): call_user_func('app\\command\\wor...', 'c0a8011c08fd000...', '{"moduleName":"...')
#9 /cronjob/vendor/workerman/workerman/Connection/TcpConnection.php(638): GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array)
#10 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #197, 2, Resource id #197)
#11 /cronjob/vendor/workerman/workerman/Events/Event.php(193): EventBase->loop()
#12 /cronjob/vendor/workerman/workerman/Worker.php(2418): Workerman\Events\Event->loop()
#13 /cronjob/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#14 /cronjob/vendor/workerman/workerman/Worker.php(1542): GatewayWorker\BusinessWorker->run()
#15 /cronjob/vendor/workerman/workerman/Worker.php(1373): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker))
#16 /cronjob/vendor/workerman/workerman/Worker.php(1347): Workerman\Worker::forkWorkersForLinux()
#17 /cronjob/vendor/workerman/workerman/Worker.php(542): Workerman\Worker::forkWorkers()
#18 /cronjob/app/command/GatewayServer.php(61): Workerman\Worker::runAll()
#19 /cronjob/vendor/topthink/framework/src/think/console/Command.php(210): app\command\GatewayServer->execute(Object(think\console\Input), Object(think\console\Output))
#20 /cronjob/vendor/topthink/framework/src/think/Console.php(655): think\console\Command->run(Object(think\console\Input), Object(think\console\Output))
#21 /cronjob/vendor/topthink/framework/src/think/Console.php(314): think\Console->doRunCommand(Object(app\command\GatewayServer), Object(think\console\Input), Object(think\console\Output))
#22 /cronjob/vendor/topthink/framework/src/think/Console.php(251): think\Console->doRun(Object(think\console\Input), Object(think\console\Output))
#23 /cronjob/think(10): think\Console->run()
#24 {main}#24 {main}
  • 小W 2022-08-19

    是不是分布式部署,1.111主机链接不上导致的?

  • walkor 2022-08-19

    连不上192.168.1.28:2301

  • 小W 2022-08-19

    我从宝塔里看,放行端口:[2300-2303] 正常 2022-01-12 09:53:16 端口开放正常啊

  • 小W 2022-08-19

    而且这是当且服务就运行在192.168.1.28主机上

  • 小W 2022-08-19

    192.168.1.111是分布式服务

  • 小W 2022-08-19

    192.168.1.28 只启动这一台的服务是正常的,当启动192.168.1.111分布式后,28那台服务器上的日志就会出现 stream_socket_client(): unable to connect to tcp://192.168.1.28:2301

  • walkor 2022-08-19

    192.168.1.28 这台服务器执行 php start.php status 截图下

  • 小W 2022-08-19

    第一张是只运行28服务,第二张是两个服务都运行截图

小W

  • walkor 2022-08-19

    现在看没问题

  • 小W 2022-08-19

    竟然不出现这个问题了,难道是我启动的方式不对,php xx start & ,现在都换成php xx start --d

小W

这是开启111那台服务后,28服务的截图

  • 暂无评论
小W

这是111服务上的截图

  • 暂无评论
小W

@walkor 今天出现这个问题unserialize() Error, 导致进程退出。
.1.28服务

.1.111服务

  • 暂无评论
walkor 打赏

可能是有网络探测程序获取其它程序发了不合法的包,如果你是单机部署,start_gateway.php 里lanip用127.0.0.1。

  • 小W 2022-08-22

    两台机器部署的

  • walkor 2022-08-22

    报错有调用栈,你可以自己记录日志,看下导致报错的数据包是什么内容

年代过于久远,无法发表回答
×
🔝