查看redis相干信息
INFO [section]
# 间接输出info将返回以后redis所有相干信息
127.0.0.1:6379> info
当只须要显示其中局部信息的时候,info前面加对应须要查看的信息。例如须要查看redis客户端信息应用 info clients
127.0.0.1:6379> info clients
# Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
# keyspace 提供每个数据库的主字典统计,包含key总数,过期key总数
127.0.0.1:6379> info keyspace
# Keyspace
db0:keys=8,expires=0,avg_ttl=0
db3:keys=2,expires=0,avg_ttl=0
参考:
- http://redis.cn/commands/info…
- https://redis.io/commands/info
连贯相干
AUTH
为redis服务申请设置一个明码
SELECT index
切换数据库,下标从0开始
127.0.0.1:6379> select 2
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
# 通过select命令切换数据库
127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]> get 111
(nil)
参考:
- http://redis.cn/commands.html…
客户端相干
CLIENT LIST
返回所有客户端数据
127.0.0.1:6379[1]> CLIENT LIST
id=19 addr=127.0.0.1:33639 fd=8 name= age=593 idle=0 flags=N db=1 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
参考: http://redis.cn/commands/clie…
CONFIG GET parameter
CONFIG SET parameter value
用户在运行期间设置和读取配置。通过CONFIG GET *能够查看所有可设置的配置
参考
- http://redis.cn/commands/conf…
CLIENT KILL kill链接
具体信息查看文档即可
对于redis的三种模式
- standalone 单机模式
- Sentinel 哨兵模式
- cluster 集群模式
发表回复