redis 每隔几天 就会被关闭!
问题描述
用了webman 框架
我使用redis 来作为队列 和缓存用
系统每隔几天就会出现redis自动关闭的情况!
--redis 日志------
356554:M 17 May 2024 17:50:42.563 Ready to accept connections tcp
356554:signal-handler (1715948472) Received SIGINT scheduling shutdown...
356554:M 17 May 2024 17:51:12.852 User requested shutdown...
查看记录
---linux 日志-------
May 13 07:24:12 ip-172-30-2-53 kernel: [8500195.943921] systemd-journald[4114627]: Received SIGINT from PID 357638 (php).
php 有发过关闭redis的命令!
webman 在什么情况会发出关闭redis的命令!
---webman---stdout.log 日志
查看报错日志 都是连接redis失败的记录
Exception: Workerman Redis Connection Failed (0.00021696090698242 seconds) in /www/wwwroot/webman/vendor/workerman/redis/src/Client.php:361
Stack trace:
0 /www/wwwroot/webman/vendor/workerman/workerman/Connection/AsyncTcpConnection.php(284): Workerman\Redis\Client->Workerman\Redis{closure}()
1 /www/wwwroot/webman/vendor/workerman/workerman/Connection/AsyncTcpConnection.php(369): Workerman\Connection\AsyncTcpConnection->emitError()
2 /www/wwwroot/webman/vendor/workerman/workerman/Events/Select.php(321): Workerman\Connection\AsyncTcpConnection->checkConnection()
3 /www/wwwroot/webman/vendor/workerman/workerman/Worker.php(1635): Workerman\Events\Select->loop()
4 /www/wwwroot/webman/vendor/workerman/workerman/Worker.php(1426): Workerman\Worker::forkOneWorkerForLinux()
5 /www/wwwroot/webman/vendor/workerman/workerman/Worker.php(1400): Workerman\Worker::forkWorkersForLinux()
6 /www/wwwroot/webman/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()
7 /www/wwwroot/webman/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
8 /www/wwwroot/webman/start.php(4): support\App::run()
9 {main}Exception: Workerman Redis Connection Failed (0.00023198127746582 seconds) in /www/wwwroot/webman/vendor/workerman/redis/src/Client.php:361
2个回答
执行
php start.php restart/stop
的时候会向webman主进程pid发送SIGINT信号,主进程pid从runtime/webman.pid
文件里读取的。那这不会影响 redis吧!
当我重启redis之后 一会就又被 关了
2024-05-17 17:48:25 pid:356334 Workerman[start.php] is stopping ...
2024-05-17 17:48:25 pid:356154 Workerman[start.php] stopping ...
2024-05-17 17:48:25 pid:356154 Workerman[start.php] has been stopped
2024-05-17 17:48:25 pid:356334 Workerman[start.php] stop success
2024-05-17 17:49:14 pid:356346 Workerman[start.php] start in DAEMON mode
2024-05-17 17:50:00 pid:356456 RedisException: Connection refused in /www/wwwroot/Workerman/vendor/illuminate/redis/Connectors/PhpRedisConnector.php:159
Stack trace:
0 /www/wwwroot/Workerman/vendor/illuminate/redis/Connectors/PhpRedisConnector.php(159): Redis->connect()
1 /www/wwwroot/Workerman/vendor/illuminate/redis/Connectors/PhpRedisConnector.php(88): Illuminate\Redis\Connectors\PhpRedisConnector->establishConnection()
2 /www/wwwroot/Workerman/vendor/illuminate/support/helpers.php(307): Illuminate\Redis\Connectors\PhpRedisConnector->Illuminate\Redis\Connectors{closure}()
3 /www/wwwroot/Workerman/vendor/illuminate/redis/Connectors/PhpRedisConnector.php(129): tap()
4 /www/wwwroot/Workerman/vendor/illuminate/redis/Connectors/PhpRedisConnector.php(34): Illuminate\Redis\Connectors\PhpRedisConnector->createClient()
5 /www/wwwroot/Workerman/vendor/illuminate/redis/Connectors/PhpRedisConnector.php(38): Illuminate\Redis\Connectors\PhpRedisConnector->Illuminate\Redis\Connectors{closure}()
6 /www/wwwroot/Workerman/vendor/illuminate/redis/RedisManager.php(112): Illuminate\Redis\Connectors\PhpRedisConnector->connect()
7 /www/wwwroot/Workerman/vendor/illuminate/redis/RedisManager.php(91): Illuminate\Redis\RedisManager->resolve()
8 /www/wwwroot/Workerman/vendor/workerman/webman-framework/src/support/Redis.php(262): Illuminate\Redis\RedisManager->connection()
9 /www/wwwroot/Workerman/vendor/workerman/webman-framework/src/support/Redis.php(281): support\Redis::connection()
10 /www/wwwroot/Workerman/process/Task.php(52): support\Redis::__callStatic()
11 /www/wwwroot/Workerman/process/Task.php(90): process\Task->calltelmessage()
12 /www/wwwroot/Workerman/process/Task.php(24): process\Task->runtg()
13 /www/wwwroot/Workerman/vendor/workerman/workerman/Events/Select.php(238): process\Task->process{closure}()
14 /www/wwwroot/Workerman/vendor/workerman/workerman/Events/Select.php(299): Workerman\Events\Select->tick()
15 /www/wwwroot/Workerman/vendor/workerman/workerman/Worker.php(1635): Workerman\Events\Select->loop()
16 /www/wwwroot/Workerman/vendor/workerman/workerman/Worker.php(1426): Workerman\Worker::forkOneWorkerForLinux()
17 /www/wwwroot/Workerman/vendor/workerman/workerman/Worker.php(1400): Workerman\Worker::forkWorkersForLinux()
18 /www/wwwroot/Workerman/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()
19 /www/wwwroot/Workerman/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
20 /www/wwwroot/Workerman/start.php(4): support\App::run()
21 {main}
2024-05-17 17:50:00 pid:356349 worker[task:356456] exit with status 64000
当我重启redis之后 再开启webman 一分钟后 redis又连不上了!!!
是不是redis里面保存的数据有问题!!
只能把dump.rdb删除了 系统才能正常运行!!