Home > Database > Redis > How to view redis cluster information

How to view redis cluster information

王林
Release: 2020-12-29 09:51:02
forward
15104 people have browsed it

How to view redis cluster information

Tips:

The IP in this article refers to the IP of the server where redis is installed, and password refers to the password of redis.

(Learning video sharing: redis video tutorial)

Cluster related information view

1.Cluster status

redis-cli -h ip -p 9379 -a password cluster info
Copy after login

2. Cluster node information

redis-cli -h ip -p 9379 -a password cluster nodes
Copy after login

3. Node memory, cpu, key number and other information (each node needs to be checked)

redis-cli -h ip -p 9379 -a password info
Copy after login

4. From the redis cluster View the key (only need to connect to the master node to view)
a. View all keys of the node

redis-cli -h ip -p 9379 -a password keys *
Copy after login

b. View the value of the key

redis-cli -h ip -p 9379 -a password -c get key
Copy after login

c .Check the key value validity period

redis-cli -h ip -p 9379 -a password -c ttl key
Copy after login

View the data stored in redis
1.ssh root@ip
2.Password: password
3.keys *
4. Check the remaining expiration time of stored data

ttl key
Copy after login

4. Check the type of key (string, set, list, hash)

type key
Copy after login

5. Check the value of key (string Type)

get key
Copy after login

6. View the value of key (set type)

scard key //获取 set 集合中元素的数量
smembers key //查看 set 中的内容
Copy after login

7. View the value of key (hash type)

hlen key //获取 key 键的字段数量
hgetall key //返回 key 键的所有字段及其值
hkeys key //获取 key 键中所有字段的名字
hvals key //获取 key 键中所有字段的值
Copy after login

Related recommendations: redis database tutorial

The above is the detailed content of How to view redis cluster information. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template