我做了网络搜索但没有发现任何问题.我在群集上运行redis并想知道哪台机器连接到redis(特别是当没有机器应该连接时,但redis仍然说连接了一些机器).
提前致谢.
使用MONITOR,只会显示实际向Redis发送流量的客户端.如果您只需要获取已连接客户端的列表,则可以使用CLIENT LIST命令.
$ redis-cli client list
Run Code Online (Sandbox Code Playgroud)
它将返回一个表,其字段在那里描述:
您是否尝试过 MONITOR 命令?
http://redis.io/commands/monitor
$ redis-cli monitor
1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
1339518087.877697 [0 127.0.0.1:60866] "dbsize"
1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
1339518096.506257 [0 127.0.0.1:60866] "get" "x"
1339518099.363765 [0 127.0.0.1:60866] "del" "x"
1339518100.544926 [0 127.0.0.1:60866] "get" "x"
Use SIGINT (Ctrl-C) to stop a MONITOR stream running via redis-cli.
# OR
$ telnet localhost 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
MONITOR
+OK
+1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
+1339518087.877697 [0 127.0.0.1:60866] "dbsize"
+1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
+1339518096.506257 [0 127.0.0.1:60866] "get" "x"
+1339518099.363765 [0 127.0.0.1:60866] "del" "x"
+1339518100.544926 [0 127.0.0.1:60866] "get" "x"
QUIT
+OK
Connection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)