gpt4 book ai didi

linux - Redis 服务器每两分钟重新启动一次,并且每隔几分钟就会丢失 key

转载 作者:太空宇宙 更新时间:2023-11-04 05:46:20 25 4
gpt4 key购买 nike

我在 ubuntu 16.04 中使用 3.2.11 Redis 版本。我们正在从 Redis 写入和读取 key 。每两分钟后,它就会因以下原因关闭。

信号处理程序(1568095246)收到 SIGTERM 调度关闭...

在Windows中,相同版本和相同配置可以完美运行。

以下是我的 Redis-server 配置

“#服务器redis_版本:3.2.11redis_git_sha1:00000000redis_git_dirty:0redis_build_id:c9f2a36594be9567redis_模式:独立操作系统:Linux 4.15.0-1052-azure x86_64拱形位:64多路复用_api:epollgcc_版本:4.9.2进程ID:26959运行 ID:f720ccac1536542b7c6ee84172d4c49fca6b80eetcp_端口:6379正常运行时间秒数:78天数正常运行时间:0赫兹:10lru_时钟:7813869可执行文件:/usr/bin/redis-server配置文件:/etc/redis/redis.conf

客户

已连接客户端:4客户端最长输出列表:0客户端最大输入缓冲区:0被阻止的客户端:0

内存

已用内存:890304使用的_内存_人类:869.44K使用的内存_rss:4530176使用的_内存_rss_人类:4.32M使用内存峰值:930344使用内存峰值人类:908.54K总系统内存:16796553216人类总系统内存:15.64G使用内存lua:37888使用的_内存_lua_人类:37.00K最大内存:268435456人类最大内存:256.00M最大内存策略:无驱逐内存碎片率:5.09mem_allocator:jemalloc-4.0.3

持久性

加载中:0rdb_changes_since_last_save:0rdb_bgsave_in_progress:0rdb_last_save_time:1568094879rdb_last_bgsave_status:确定rdb_last_bgsave_time_sec:-1rdb_current_bgsave_time_sec:-1aof_启用:0aof_rewrite_in_progress:0aof_rewrite_scheduled:0aof_last_rewrite_time_sec:-1aof_current_rewrite_time_sec:-1aof_last_bgrewrite_status:确定aof_last_write_status:确定

统计数据

收到的连接总数:11已处理命令总数:45每秒瞬时操作数:0总净输入字节数:1645总净输出字节数:3040瞬时输入kbps:0.00瞬时输出kbps:0.00拒绝连接:0同步完整:0同步部分确定:0同步部分错误:0过期 key :0被逐出的 key :0键空间点击数:24键空间缺失:1pubsub_ channel :0pubsub_patterns:0最新_fork_usec:0migrate_cached_sockets:0

复制

角色:主人连接的从站:0master_repl_offset:0repl_backlog_active:0repl_backlog_size:1048576repl_backlog_first_byte_offset:0repl_backlog_hiSTLen:0

CPU

使用的CPU系统:0.07使用的CPU用户:0.03使用的_cpu_sys_children:0.00used_cpu_user_children:0.00

集群

启用集群:0

键空间

db0:keys=31,expires=0,avg_ttl=0

下面是我的 Redis 服务器日志

37507:signal-handler (1568096332) Received SIGTERM scheduling shutdown...
37507:M 10 Sep 06:18:52.379 # User requested shutdown...
37507:M 10 Sep 06:18:52.379 * Saving the final RDB snapshot before exiting.
37507:M 10 Sep 06:18:52.403 * DB saved on disk
37507:M 10 Sep 06:18:52.404 * Removing the pid file.
37507:M 10 Sep 06:18:52.404 # Redis is now ready to exit, bye bye...
38199:M 10 Sep 06:18:52.804 * Redis 3.2.11 (00000000/0) 64 bit, standalone mode, port 6379, pid 38199 ready to start.
38199:M 10 Sep 06:18:52.804 # Server started, Redis version 3.2.11
38199:M 10 Sep 06:18:52.804 * DB loaded from disk: 0.000 seconds
38199:M 10 Sep 06:18:52.805 * The server is now ready to accept connections on port 6379
38199:signal-handler (1568096422) Received SIGTERM scheduling shutdown...
38199:M 10 Sep 06:20:22.815 # User requested shutdown...
38199:M 10 Sep 06:20:22.815 * Saving the final RDB snapshot before exiting.
38199:M 10 Sep 06:20:22.836 * DB saved on disk
38199:M 10 Sep 06:20:22.836 * Removing the pid file.
38199:M 10 Sep 06:20:22.836 # Redis is now ready to exit, bye bye...
38950:M 10 Sep 06:20:23.333 * Redis 3.2.11 (00000000/0) 64 bit, standalone mode, port 6379, pid 38950 ready to start.
38950:M 10 Sep 06:20:23.335 # Server started, Redis version 3.2.11
38950:M 10 Sep 06:20:23.336 * DB loaded from disk: 0.000 seconds
38950:M 10 Sep 06:20:23.336 * The server is now ready to accept connections on port 6379
38950:signal-handler (1568096513) Received SIGTERM scheduling shutdown...
38950:M 10 Sep 06:21:53.409 # User requested shutdown...
38950:M 10 Sep 06:21:53.410 * Saving the final RDB snapshot before exiting.
38950:M 10 Sep 06:21:53.429 * DB saved on disk
38950:M 10 Sep 06:21:53.429 * Removing the pid file.
38950:M 10 Sep 06:21:53.429 # Redis is now ready to exit, bye bye...
39659:M 10 Sep 06:21:53.808 * Redis 3.2.11 (00000000/0) 64 bit, standalone mode, port 6379, pid 39659 ready to start.
39659:M 10 Sep 06:21:53.808 # Server started, Redis version 3.2.11
39659:M 10 Sep 06:21:53.809 * DB loaded from disk: 0.000 seconds
39659:M 10 Sep 06:21:53.810 * The server is now ready to accept connections on port 6379

Redis 服务器详细日志

44263:M 10 Sep 06:32:27.832 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44263:M 10 Sep 06:32:27.832 - 3 clients connected (0 slaves), 827584 bytes in use
44263:M 10 Sep 06:32:32.844 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44263:M 10 Sep 06:32:32.844 - 3 clients connected (0 slaves), 827584 bytes in use
44263:M 10 Sep 06:32:37.860 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44263:M 10 Sep 06:32:37.861 - 3 clients connected (0 slaves), 827584 bytes in use
44263:M 10 Sep 06:32:42.888 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44263:M 10 Sep 06:32:42.888 - 3 clients connected (0 slaves), 827584 bytes in use
44263:signal-handler (1568097167) Received SIGTERM scheduling shutdown...
44263:M 10 Sep 06:32:47.699 # User requested shutdown...
44263:M 10 Sep 06:32:47.700 * Saving the final RDB snapshot before exiting.
44263:M 10 Sep 06:32:47.718 * DB saved on disk
44263:M 10 Sep 06:32:47.718 * Removing the pid file.
44263:M 10 Sep 06:32:47.718 # Redis is now ready to exit, bye bye...
44978:M 10 Sep 06:32:48.085 * Redis 3.2.11 (00000000/0) 64 bit, standalone mode, port 6379, pid 44978 ready to start.
44978:M 10 Sep 06:32:48.085 # Server started, Redis version 3.2.11
44978:M 10 Sep 06:32:48.085 * DB loaded from disk: 0.000 seconds
44978:M 10 Sep 06:32:48.086 * The server is now ready to accept connections on port 6379
44978:M 10 Sep 06:32:48.086 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:32:48.086 - 0 clients connected (0 slaves), 765984 bytes in use
44978:M 10 Sep 06:32:53.097 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:32:53.097 - 0 clients connected (0 slaves), 765984 bytes in use
44978:M 10 Sep 06:32:58.108 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:32:58.108 - 0 clients connected (0 slaves), 765984 bytes in use
44978:M 10 Sep 06:32:58.744 - Accepted 10.1.0.11:58060
44978:M 10 Sep 06:32:58.744 - Reading from client: Connection reset by peer
44978:M 10 Sep 06:32:58.749 - Accepted 10.1.0.10:54662
44978:M 10 Sep 06:32:58.750 - Reading from client: Connection reset by peer
44978:M 10 Sep 06:32:59.180 - Accepted 10.1.0.8:53212
44978:M 10 Sep 06:33:03.121 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:03.121 - 1 clients connected (0 slaves), 786856 bytes in use
44978:M 10 Sep 06:33:08.132 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:08.132 - 1 clients connected (0 slaves), 786856 bytes in use
44978:M 10 Sep 06:33:13.145 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:13.145 - 1 clients connected (0 slaves), 786856 bytes in use
44978:M 10 Sep 06:33:18.157 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:18.157 - 1 clients connected (0 slaves), 786856 bytes in use
44978:M 10 Sep 06:33:23.168 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:23.168 - 1 clients connected (0 slaves), 786856 bytes in use
44978:M 10 Sep 06:33:28.181 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:28.182 - 1 clients connected (0 slaves), 786856 bytes in use
44978:M 10 Sep 06:33:29.791 - Accepted 10.1.0.10:54812
44978:M 10 Sep 06:33:29.791 - Accepted 10.1.0.11:58242
44978:M 10 Sep 06:33:29.792 - Reading from client: Connection reset by peer
44978:M 10 Sep 06:33:29.792 - Reading from client: Connection reset by peer
44978:M 10 Sep 06:33:30.698 - Accepted 10.1.0.7:45992
44978:M 10 Sep 06:33:30.814 - Accepted 10.1.0.6:44336
44978:M 10 Sep 06:33:33.192 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:33.192 - 3 clients connected (0 slaves), 828600 bytes in use
44978:M 10 Sep 06:33:38.209 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:38.209 - 3 clients connected (0 slaves), 828600 bytes in use
44978:M 10 Sep 06:33:43.221 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:43.221 - 3 clients connected (0 slaves), 828600 bytes in use
44978:M 10 Sep 06:33:48.234 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:48.234 - 3 clients connected (0 slaves), 828600 bytes in use
44978:M 10 Sep 06:33:53.249 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:53.249 - 3 clients connected (0 slaves), 828600 bytes in use
44978:M 10 Sep 06:33:58.261 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:33:58.261 - 3 clients connected (0 slaves), 828600 bytes in use
44978:M 10 Sep 06:34:02.159 - Accepted 10.1.0.10:54950
44978:M 10 Sep 06:34:02.160 - Reading from client: Connection reset by peer
44978:M 10 Sep 06:34:02.161 - Accepted 10.1.0.11:58420
44978:M 10 Sep 06:34:02.161 - Reading from client: Connection reset by peer
44978:M 10 Sep 06:34:03.276 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:34:03.276 - 3 clients connected (0 slaves), 827576 bytes in use
44978:M 10 Sep 06:34:08.292 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:34:08.292 - 3 clients connected (0 slaves), 827576 bytes in use
44978:M 10 Sep 06:34:13.305 - DB 0: 31 keys (0 volatile) in 32 slots HT.
44978:M 10 Sep 06:34:13.306 - 3 clients connected (0 slaves), 827576 bytes in use
44978:signal-handler (1568097258) Received SIGTERM scheduling shutdown...
44978:M 10 Sep 06:34:18.216 # User requested shutdown...
44978:M 10 Sep 06:34:18.216 * Saving the final RDB snapshot before exiting.
44978:M 10 Sep 06:34:18.247 * DB saved on disk
44978:M 10 Sep 06:34:18.247 * Removing the pid file.
44978:M 10 Sep 06:34:18.247 # Redis is now ready to exit, bye bye...
45737:M 10 Sep 06:34:18.557 * Redis 3.2.11 (00000000/0) 64 bit, standalone mode, port 6379, pid 45737 ready to start.
45737:M 10 Sep 06:34:18.559 # Server started, Redis version 3.2.11
45737:M 10 Sep 06:34:18.560 * DB loaded from disk: 0.000 seconds
45737:M 10 Sep 06:34:18.560 * The server is now ready to accept connections on port 6379
45737:M 10 Sep 06:34:18.561 - DB 0: 31 keys (0 volatile) in 32 slots HT.
45737:M 10 Sep 06:34:18.561 - 0 clients connected (0 slaves), 766024 bytes in use
45737:M 10 Sep 06:34:23.573 - DB 0: 31 keys (0 volatile) in 32 slots HT.
45737:M 10 Sep 06:34:23.573 - 0 clients connected (0 slaves), 766024 bytes in use
45737:M 10 Sep 06:34:28.588 - DB 0: 31 keys (0 volatile) in 32 slots HT.
45737:M 10 Sep 06:34:28.589 - 0 clients connected (0 slaves), 766024 bytes in use
45737:M 10 Sep 06:34:33.599 - DB 0: 31 keys (0 volatile) in 32 slots HT.
45737:M 10 Sep 06:34:33.599 - 0 clients connected (0 slaves), 766024 bytes in use

有时我在 Redis 服务器中遇到以下错误日志,我正在以独立模式运行 Redis 服务器

104680:S 11 Sep 10:05:13.913 * SLAVE OF 192.3.70.16:12220 enabled (user request from 'id=1600 addr=192.3.70.16:42370 fd=9 name= age=0 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=slaveof')
104680:S 11 Sep 10:05:14.880 * Connecting to MASTER 192.3.70.16:12220
104680:S 11 Sep 10:05:14.881 * MASTER <-> SLAVE sync started
104680:S 11 Sep 10:05:15.092 # Error condition on socket for SYNC: Connection refused
104680:S 11 Sep 10:05:15.883 * Connecting to MASTER 192.3.70.16:12220
104680:S 11 Sep 10:05:15.883 * MASTER <-> SLAVE sync started
104680:S 11 Sep 10:05:16.093 # Error condition on socket for SYNC: Connection refused
104680:S 11 Sep 10:05:16.886 * Connecting to MASTER 192.3.70.16:12220
104680:S 11 Sep 10:05:16.886 * MASTER <-> SLAVE sync started
104680:S 11 Sep 10:05:17.093 * Non blocking connect for SYNC fired the event.
104680:S 11 Sep 10:05:17.300 * Master replied to PING, replication can continue...
104680:S 11 Sep 10:05:17.714 * Partial resynchronization not possible (no cached master)
104680:S 11 Sep 10:05:17.926 * Full resync from master: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ:0
104680:S 11 Sep 10:05:17.926 * MASTER <-> SLAVE sync: receiving 3372687 bytes from master
104680:S 11 Sep 10:05:19.400 * MASTER <-> SLAVE sync: Flushing old data
104680:S 11 Sep 10:05:19.400 * MASTER <-> SLAVE sync: Loading DB in memory
104680:S 11 Sep 10:05:19.400 # Wrong signature trying to load DB from file
104680:S 11 Sep 10:05:19.400 # Failed trying to load the MASTER synchronization DB from disk
104680:S 11 Sep 10:05:19.892 * Connecting to MASTER 192.3.70.16:12220
104680:S 11 Sep 10:05:19.892 * MASTER <-> SLAVE sync started
104680:S 11 Sep 10:05:20.100 * Non blocking connect for SYNC fired the event.
104680:M 11 Sep 10:05:21.184 * MASTER MODE enabled (user request from 'id=1600 addr=192.3.70.16:42370 fd=9 name= age=8 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=slaveof')
104680:S 11 Sep 10:05:22.073 * SLAVE OF 192.3.70.16:51622 enabled (user request from 'id=1605 addr=192.3.70.16:42508 fd=9 name= age=0 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=slaveof')
104680:S 11 Sep 10:05:22.906 * Connecting to MASTER 192.3.70.16:51622
104680:S 11 Sep 10:05:22.906 * MASTER <-> SLAVE sync started
104680:S 11 Sep 10:05:23.117 # Error condition on socket for SYNC: Connection refused

最佳答案

日志显示:44263:M 10 Sep 06:32:47.699 # 用户请求关闭...
尝试重新安装

关于linux - Redis 服务器每两分钟重新启动一次,并且每隔几分钟就会丢失 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57864901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com