How to check Redis Cluster Status ? From command LIne

  Aug 19, 2015

I want to know if all my redis cluster servers are running fine or not, please suggest a command.

Solved 0
3 years ago 2 Answer 17 views

Answers ( 2 )

  1. 8 months ago

    First connect to the local instance, running by default on port 6379. In case you've changed the port, modify the command accordingly.

    redis-cli -h 127.0.0.1 -p 6379
    

    Now issue following command:

    127.0.0.1:6379> INFO
    

    You will see something like this:

    . . .

    # Replication
    role:master
    connected_slaves:1
    slave0:ip=111.111.111.222,port=6379,state=online,offset=407,lag=1
    master_repl_offset:407
    repl_backlog_active:1
    repl_backlog_size:1048576
    repl_backlog_first_byte_offset:2
    repl_backlog_histlen:406
    

    . . .

  2. 3 years ago

    This can be done using following command, go to your installation directory and apply following command append any one of the server ip and port in cluster:

    src/redis-trib.rb check 127.0.0.1:7000

    You will see, something like this output as atatus of all your servers and cluster health:

    Connecting to node 127.0.0.1:7000: OK
    Connecting to node 127.0.0.1:7003: OK
    Connecting to node 127.0.0.1:7002: OK
    Connecting to node 127.0.0.1:7004: OK
    Connecting to node 127.0.0.1:7005: OK
    Connecting to node 127.0.0.1:7001: OK
    >>> Performing Cluster Check (using node 127.0.0.1:7000)
    M: 86576c275441bf256533e5c707778850ffecd28b 127.0.0.1:7000
    nbsp; nbsp;slots:0-5460 (5461 slots) master
    nbsp; nbsp;1 additional replica(s)
    S: a2910ab1c07856af261789b44a42981945b5a196 127.0.0.1:7003
    nbsp; nbsp;slots: (0 slots) slave
    nbsp; nbsp;replicates 86576c275441bf256533e5c707778850ffecd28b
    M: b8c35626a8fc6294e0be52175499f3f4cae167cc 127.0.0.1:7002
    nbsp; nbsp;slots:10923-16383 (5461 slots) master
    nbsp; nbsp;1 additional replica(s)
    S: c335b7e69679dd5552b0720dcb7f5e8301e31e09 127.0.0.1:7004
    nbsp; nbsp;slots: (0 slots) slave
    nbsp; nbsp;replicates 043cd1621dad2fed16eaa7a6a8bfb9988a9456a6
    S: 3c915d034516eb2522e32066824e188eaf3bf952 127.0.0.1:7005
    nbsp; nbsp;slots: (0 slots) slave
    nbsp; nbsp;replicates b8c35626a8fc6294e0be52175499f3f4cae167cc
    M: 043cd1621dad2fed16eaa7a6a8bfb9988a9456a6 127.0.0.1:7001
    nbsp; nbsp;slots:5461-10922 (5462 slots) master
    nbsp; nbsp;1 additional replica(s)
    [OK] All nodes agree about slots configuration.
    >>> Check for open slots...
    >>> Check slots coverage...
    [OK] All 16384 slots covered.

    nbsp;

    Thats It !

Your Answer