redisモニタ指標
4840 ワード
1>pingモニタアラーム
2>CPU
3>パケット損失率
二、Redis Server監視データ収集
Redis生存監視
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 ping | grep -c PONG
1
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w "connected_clients" | awk -F":" '{print $2}'
1
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w rejected_connections
rejected_connections:0
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w total_connections_received
total_connections_received:217
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w blocked_clients
blocked_clients:0
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w used_memory
used_memory:2513656
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w used_memory_rss
used_memory_rss:9728000
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w mem_fragmentation_ratio
mem_fragmentation_ratio:3.89
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w keys | awk -F':' '{print $2}' | awk -F',' '{print $1}' | awk -F'=' '{print $2}'
43
./redis-cli -c -p 7000 info | grep -w total_commands_processed| awk -F':' '{print $2}'
./redis-cli -c -p 7000 info | grep -w instantaneous_ops_per_sec | awk -F':' '{print $2}'
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w keyspace_hits | awk -F':' '{print $2}'
354
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w keyspace_misses
keyspace_misses:122
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w latest_fork_usec
latest_fork_usec:315
三、Redisクラスタ監視
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w cluster_enabled
cluster_enabled:1
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info
cluster_state:ok
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_slots_ok
cluster_slots_ok:16384
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_slots_fail
cluster_slots_fail:0
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_known_nodes
cluster_known_nodes:6