我使用以下redis.conf进行Redis群集设置:
bind 127.0.0.1
bind 10.0.0.20
port 7000
cluster-enabled yes
cluster-config-file nodes.7000.conf
cluster-node-timeout 15000
appendonly yes
appendfilename "appendonly.7000.aof"
timeout 0
tcp-keepalive 60
databases 1
stop-writes-on-bgsave-error no
loglevel warning
logfile "serverlog.7000.txt"
群集中的每台机器都有2个Redis实例正在运行;端口7000上有一个,端口7001上有一个。
即使我的loglevel是warning
,我仍然每秒都会收到几个日志语句。 serverlog.7000.txt
看起来像这样:
[1112] 09 Apr 06:44:28.623 # WSA_IO_PENDING writing to socket fd 14
[1112] 09 Apr 06:44:28.623 # clusterWriteDone written 2520 fd 14
[1112] 09 Apr 06:44:28.842 # WSA_IO_PENDING writing to socket fd 27
[1112] 09 Apr 06:44:28.842 # clusterWriteDone written 2520 fd 27
[1112] 09 Apr 06:44:28.936 # WSA_IO_PENDING writing to socket fd 23
[1112] 09 Apr 06:44:28.936 # clusterWriteDone written 2520 fd 23
[1112] 09 Apr 06:44:29.717 # WSA_IO_PENDING writing to socket fd 17
[1112] 09 Apr 06:44:29.717 # clusterWriteDone written 2520 fd 17
[1112] 09 Apr 06:44:29.748 # WSA_IO_PENDING writing to socket fd 21
[1112] 09 Apr 06:44:29.748 # clusterWriteDone written 2520 fd 21
[1112] 09 Apr 06:44:30.607 # WSA_IO_PENDING writing to socket fd 10
[1112] 09 Apr 06:44:30.607 # clusterWriteDone written 2520 fd 10
[1112] 09 Apr 06:44:30.811 # WSA_IO_PENDING writing to socket fd 11
[1112] 09 Apr 06:44:30.811 # clusterWriteDone written 2520 fd 11
[1112] 09 Apr 06:44:31.795 # WSA_IO_PENDING writing to socket fd 13
[1112] 09 Apr 06:44:31.795 # clusterWriteDone written 2520 fd 13
[1112] 09 Apr 06:44:31.904 # WSA_IO_PENDING writing to socket fd 12
[1112] 09 Apr 06:44:31.904 # clusterWriteDone written 2416 fd 12
[1112] 09 Apr 06:44:32.217 # WSA_IO_PENDING writing to socket fd 23
[1112] 09 Apr 06:44:32.217 # clusterWriteDone written 2520 fd 23
[1112] 09 Apr 06:44:32.779 # WSA_IO_PENDING writing to socket fd 16
[1112] 09 Apr 06:44:32.779 # clusterWriteDone written 2520 fd 16
[1112] 09 Apr 06:44:32.858 # WSA_IO_PENDING writing to socket fd 29
[1112] 09 Apr 06:44:32.858 # clusterWriteDone written 2520 fd 29
[1112] 09 Apr 06:44:32.998 # WSA_IO_PENDING writing to socket fd 11
[1112] 09 Apr 06:44:32.998 # clusterWriteDone written 2520 fd 11
[1112] 09 Apr 06:44:34.092 # WSA_IO_PENDING writing to socket fd 17
[1112] 09 Apr 06:44:34.092 # clusterWriteDone written 2520 fd 17
[1112] 09 Apr 06:44:35.186 # WSA_IO_PENDING writing to socket fd 14
[1112] 09 Apr 06:44:35.186 # clusterWriteDone written 2520 fd 14
[1112] 09 Apr 06:44:35.186 # WSA_IO_PENDING writing to socket fd 117
[1112] 09 Apr 06:44:35.186 # clusterWriteDone written 2416 fd 117
[1112] 09 Apr 06:44:35.404 # WSA_IO_PENDING writing to socket fd 27
[1112] 09 Apr 06:44:35.404 # clusterWriteDone written 2520 fd 27
[1112] 09 Apr 06:44:35.483 # WSA_IO_PENDING writing to socket fd 19
[1112] 09 Apr 06:44:35.483 # clusterWriteDone written 2520 fd 19
[1112] 09 Apr 06:44:36.076 # WSA_IO_PENDING writing to socket fd 10
[1112] 09 Apr 06:44:36.076 # clusterWriteDone written 2520 fd 10
[1112] 09 Apr 06:44:36.279 # WSA_IO_PENDING writing to socket fd 13
[1112] 09 Apr 06:44:36.279 # clusterWriteDone written 2520 fd 13
[1112] 09 Apr 06:44:37.295 # WSA_IO_PENDING writing to socket fd 21
[1112] 09 Apr 06:44:37.295 # clusterWriteDone written 2520 fd 21
[1112] 09 Apr 06:44:37.373 # WSA_IO_PENDING writing to socket fd 12
[1112] 09 Apr 06:44:37.373 # clusterWriteDone written 2520 fd 12
[1112] 09 Apr 06:44:37.686 # WSA_IO_PENDING writing to socket fd 23
[1112] 09 Apr 06:44:37.686 # clusterWriteDone written 2520 fd 23
这每天创建几百兆的日志数据,这有点难以理解,还需要我们更仔细地观察磁盘空间。这个日志事件对我来说似乎不是警告。有没有办法关闭它们或解决问题?我已经尝试了所有其他记录的日志级别,但似乎没有任何东西可以让它们消失。
我在Windows 2012上使用Redis 3.2.100。
更新:我注意到这些也完全充斥着Windows事件日志。
答案 0 :(得分:1)
由于日志记录语句使用最高LL_WARNING
级别,因此无法在3.2.100中专门关闭这些“警告”。这个问题已经在我没有维护的MSOpenTech的repo(我更新到Redis 4.0.2)的分支中报告,并且通过将该级别降低到LL_DEBUG
来修复。更多详情:https://github.com/tporadowski/redis/issues/14
此更改将包含在下一个版本(4.0.2.3)中,您也可以获取最新的源代码并自行构建。
目前的版本可以在这里找到:https://github.com/tporadowski/redis/releases