发表于 2018-11-4 08:13:47

Redis 应用进阶

192.168.1.112:26379> info sentinel  
# Sentinel
  
sentinel_masters:1
  
sentinel_tilt:0
  
sentinel_running_scripts:0
  
sentinel_scripts_queue_length:0
  
sentinel_simulate_failure_flags:0
  
master0:name=mymaster,status=ok,address=192.168.1.112:6379,slaves=2,sentinels=1
  

  
192.168.1.112:26379> SENTINEL masters# 获取所有主节点的详细信息
  
1)1) "name"
  
    2) "mymaster"
  
    3) "ip"
  
    4) "192.168.1.112"
  
    5) "port"
  
    6) "6379"
  
    7) "runid"
  
    8) "64b7b580bb66b3bf757682cff46c2fdab8f8274f"
  
    9) "flags"
  
   10) "master"
  
   11) "link-pending-commands"
  
   12) "0"
  
   13) "link-refcount"
  
   14) "1"
  
   15) "last-ping-sent"
  
   16) "0"
  
   17) "last-ok-ping-reply"
  
   18) "377"
  
   19) "last-ping-reply"
  
   20) "377"
  
   21) "down-after-milliseconds"
  
   22) "5000"
  
   23) "info-refresh"
  
   24) "5155"
  
   25) "role-reported"
  
   26) "master"
  
   27) "role-reported-time"
  
   28) "1581867"
  
   29) "config-epoch"
  
   30) "0"
  
   31) "num-slaves"
  
   32) "2"
  
   33) "num-other-sentinels"
  
   34) "0"
  
   35) "quorum"
  
   36) "1"
  
   37) "failover-timeout"
  
   38) "60000"
  
   39) "parallel-syncs"
  
   40) "1"
  

  
192.168.1.112:26379> SENTINEL slaves mymaster# 获取从服务器信息
  
1)1) "name"
  
    2) "192.168.1.114:6379"
  
    3) "ip"
  
    4) "192.168.1.114"
  
    5) "port"
  
    6) "6379"
  
    7) "runid"
  
    8) "f62c27d585c3ac4c8730c8b578838ca6434e27bf"
  
    9) "flags"
  
   10) "slave"
  
   11) "link-pending-commands"
  
   12) "0"
  
   13) "link-refcount"
  
   14) "1"
  
   15) "last-ping-sent"
  
   16) "0"
  
   17) "last-ok-ping-reply"
  
   18) "809"
  
   19) "last-ping-reply"
  
   20) "809"
  
   21) "down-after-milliseconds"
  
   22) "5000"
  
   23) "info-refresh"
  
   24) "5225"
  
   25) "role-reported"
  
   26) "slave"
  
   27) "role-reported-time"
  
   28) "1742587"
  
   29) "master-link-down-time"
  
   30) "0"
  
   31) "master-link-status"
  
   32) "ok"
  
   33) "master-host"
  
   34) "192.168.1.112"
  
   35) "master-port"
  
   36) "6379"
  
   37) "slave-priority"
  
   38) "100"
  
   39) "slave-repl-offset"
  
   40) "173202"
  
2)1) "name"
  
    2) "192.168.1.113:6379"
  
    3) "ip"
  
    4) "192.168.1.113"
  
    5) "port"
  
    6) "6379"
  
    7) "runid"
  
    8) "489d228990a895ff207aec9f3dda2474cbd1d096"
  
    9) "flags"
  
   10) "slave"
  
   11) "link-pending-commands"
  
   12) "0"
  
   13) "link-refcount"
  
   14) "1"
  
   15) "last-ping-sent"
  
   16) "0"
  
   17) "last-ok-ping-reply"
  
   18) "808"
  
   19) "last-ping-reply"
  
   20) "808"
  
   21) "down-after-milliseconds"
  
   22) "5000"
  
   23) "info-refresh"
  
   24) "5225"
  
   25) "role-reported"
  
   26) "slave"
  
   27) "role-reported-time"
  
   28) "1742587"
  
   29) "master-link-down-time"
  
   30) "0"
  
   31) "master-link-status"
  
   32) "ok"
  
   33) "master-host"
  
   34) "192.168.1.112"
  
   35) "master-port"
  
   36) "6379"
  
   37) "slave-priority"
  
   38) "100"
  
   39) "slave-repl-offset"
  
   40) "173202"


页: [1]
查看完整版本: Redis 应用进阶