Get the App
SLTechnology News&Howtos  ›  Database  › 

How to view redis cluster information

Shulou Source: shulou.com Published: 2022-06-01 00:04:14 10月08日 Update

This article will explain in detail how to view redis cluster information. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Tip:

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

View cluster-related information

1. Cluster status

Redis-cli-h ip-p 9379-a password cluster info

two。 Cluster node information

Redis-cli-h ip-p 9379-a password cluster nodes

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

Redis-cli-h ip-p 9379-a password info

4. View the key from the redis cluster (just connect to the master node to see)

a. View all key of this node

Redis-cli-h ip-p 9379-a password keys *

b. Check the value of key

Redis-cli-h ip-p 9379-a password-c get key

c. Check the validity period of key

Redis-cli-h ip-p 9379-a password-c ttl key

View the data stored in redis

1.ssh root@ip

2.Password: password

3.keys *

4. View the remaining expiration time of the stored data

Ttl key

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

Type key

5. View the value of key (string type)

Get key

6. View the value of key (set type)

Scard key / / get the number of elements in the set collection smembers key / / View the contents of the set

7. View the value of key (hash type)

Hlen key / / get the number of fields of the key key hgetall key / / return all fields of the key key and their values hkeys key / / get the names of all fields in the key key hvals key / / get the values of all fields in the key key, this is the end of the article on "how to view redis cluster information", I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good Please share it for more people to see.

Tags: Cluster information node field type quantity article content data more good practical valid element memory name password article time validity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno vpn Redmi Linux MariaDB