I did a web search but found nothing on this. I am running redis on a cluster and would like to find out which machine is connecting to redis ( especially when no machine is supposed to be connecting, but redis still says some machine connected).
thanks in advance.
To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command. In the above example, we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.
Redis CLIENT LIST command returns the information and statistics about the client connections server in a human readable format.
By default, redis-cli connects to the server at the address 127.0. 0.1 with port 6379.
If you run the "client list" command against your Redis instance, you should be able to see the entire list of clients connected to your redis instance along with their IP addresses. You can then see which clients (services) have the highest number of connections to your Redis instance.
With MONITOR, only the clients actually sending traffic to Redis will be shown. If you just need to get a list of connected clients, you can use the CLIENT LIST command.
$ redis-cli client list
It will return a table whose fields are described there:
Redis "Client List" purpose and description
Did you try the MONITOR command?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With