Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and deployment of redis under Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "installation and deployment of redis under Linux". In daily operation, I believe many people have doubts about the installation and deployment of redis under Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "installation and deployment of redis under Linux". Next, please follow the editor to study!

1. Basic knowledge

  redis is an open source high performance key-value pair (key-value) database developed in C language. It meets the storage requirements in different scenarios by providing a variety of key data types. So far, the key data types supported by redis are as follows

String, list (lists), sets (sorts sets), ordered set (hashs)

Application scenarios of 2.redis

  caching (data queries, short links, news content, merchandise content, etc.). (most used)

Session separation in   distributed cluster architecture.

Online friend list for   chat rooms.

  task queue. (second kill, rush purchase, 12306, etc.)

Ranking of   applications.

  website visit statistics.

  data expiration processing (can be accurate to milliseconds)

3. Install redis

  below describes the installation and deployment of Redis in the Linux environment, using redis-3.0 stable Edition, because redis has added clustering capabilities since 3.0. I will also share the redis cluster later.

1. You can download it from the official website at http://download.redis.io/releases/redis-3.0.0.tar.gz

# use the linux wget command wget http://download.redis.io/releases/redis-3.0.0.tar.gz# to copy redis-3.0.0.tar.gz to / usr/local cp redis-3.0.0.rar.gz / usr/local# decompress source code tar-zxvf redis-3.0.0.tar.gz # into the decompressed directory to compile Install to a specified directory such as / usr/local/rediscd / usr/local/redis-3.0.0make PREFIX=/usr/local/redis install

Redis.conf is the configuration file for redis, and redis.conf is in the redis source directory.

Copy the configuration file to the installation directory

Enter the source directory, where there is a configuration file redis.conf, and then copy it to the installation path

Cd / usr/local/rediscp / usr/local/redis-3.0.0/redis.conf / usr/local/redis/bin# go to the installation directory cd / usr/local/redis/bin

Current catalog tool:

Redis-benchmark redis performance testing tool

Redis-check-aof AOF File repair tool

Redis-check-rdb RDB File repair tool

Redis-cli redis command line client

Redis.conf redis profile

Redis-sentinal redis cluster management tools

Redis-server redis service process

4. Start redis

1. Front-end mode startup

Running bin/redis-server directly will start in front-end mode. The disadvantage of front-end mode startup is that when the ssh command window closes, the redis-server program ends. This method is not recommended.

. / redis-server

two。 Back-end mode starts

Modify the redis.conf configuration file and start in daemonize yes backend mode

Vim / usr/local/redis/bin/redis.conf

Execute the following command to start redis:

Cd / usr/local/redis./bin/redis-server. / redis.conf

Connect redis

/ usr/local/redis/bin/redis-cli

5. Close redis

Forcibly terminating the redis process may result in loss of redis persistence data. The correct way to stop Redis is to send a SHUTDOWN command to Redis, which is:

Cd / usr/local/redis./bin/redis-cli shutdown

Forcibly terminate redis

Pkill redis-server

Let redis boot automatically

Vim / etc/rc.local// add / usr/local/redis/bin/redis-server / usr/local/redis/etc/redis-conf to this point, the study on "how to install and deploy redis under Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report