In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "What is the use of Shell tools in Redis". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "What is the use of Shell tools in Redis"!
redis-cli
We know that redis-cli is a client tool for connecting Redis. We have already introduced it in the previous article, so when using the redis-cli tool, there are many important optional parameters that we have not introduced before. Let's look at it in detail below.
-r: This parameter represents the number of times the command is executed. If we specify the-r parameter when using the redis-cli command, the command entered will call the number of times in the parameter.
-i: This parameter represents a command executed every few seconds. - The i parameter must always be used with the-r parameter.
Although the output is the same as the output in the first graph, the information in the top graph is not returned once, but at distinct intervals, the interval specified in-i, that is, 1 second, whereas the content in the first graph is returned once.
-x: This parameter represents reading data from standard input and is the last parameter in redis-cli.
-c: This parameter is used when connecting Redis Cluster nodes. For knowledge about Redis Cluster, we will introduce it in the procedures article. Here we only need to know that there is-c parameter.
-a: The function of this parameter is that if the password is set in the Redis configuration, you can use the-a parameter so that you don't have to output the auth command every time you execute the command.
--scan/--pattern: The function of this parameter is to scan keys for the specified pattern, just like scan command at this point.
--slave: This parameter simulates the current client as the slave node of the current Redis node, so that you can obtain the update operation of the current Redis node. This knowledge will be explained in detail in subsequent articles.
--rdb: This parameter requests Redis to generate an RDB persistence file and save it locally. We can use the--parameter to make persistent copies of Redis.
--pipe: This parameter can encapsulate commands into Redis communication protocol and send them to Redis for execution in batches.
--brigkeys: The purpose of this parameter is to find key values that occupy a large amount of memory in Redis.
--eval: This parameter can specify that Lua scripts run, which we'll cover in a later article.
--latency: There are 3 options for this parameter, namely--latency, --latency-history, latency-dist. They all have the same function, they can detect network delay. Below we will explain in detail the differences between them.
--latency tests network latency from client to target Redis.
--latency-history is the same as--latency, which also detects network delay. The difference is that--latency-history parameter will output network delay information once every 10 seconds.
--latency-dist This parameter outputs network latency information in the form of a statistical chart.
--stat: This parameter can get statistics from Redis in real time.
The--raw/--no-raw: --no-raw parameter is used to return the original format, while the--raw parameter is used to return the formatted result.
redis-server
In addition to starting the Redis service, redis-server also has an optional parameter, namely--test-memory. This parameter checks whether the current system can allocate the specified amount of memory to Redis stably. This parameter can be used to easily detect the crash of Redis caused by system memory problems.
redis-benchmark
The redis-benchmark tool is unfamiliar to us because we haven't introduced it before. In fact, the redis-benchmark tool is for testing. Through this tool, we can test the relevant performance in Redis. The tool parameters are more, we will introduce them in detail below.
-c: This parameter represents the number of clients concurrent (default is 50).
-n: This parameter represents the total number of client requests (default is 100000).
-q: parameter displays requests per second information in redis-benchmark.
-r: The default number of keys in Redis is 0. If we want to insert a lot of keys into Redis, we can use the-r parameter. This parameter randomly inserts many random keys into Redis.
-p: This parameter represents the amount of data per request pipeline (default is 1).
-k: This parameter represents whether the client uses keepalive, 1 is used, 0 is not used, default is 1.
-t: This parameter tests the specified command.
--csv: This parameter outputs the results in csv format.
At this point, I believe that everyone has a deeper understanding of "what is the use of Shell tools in Redis". Let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.