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

How to deploy redis under Linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the relevant knowledge of "how to deploy redis under Linux". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to deploy redis under Linux" can help you solve the problem.

To put it simply, redis is a database, but unlike traditional databases, the data of redis is stored in memory, so the read and write speed is very fast, so redis is widely used in the cache direction. In addition, redis is often used to make distributed locks. Redis provides a variety of data types to support different business scenarios.

Step 1: download the installation package

Visit https://redis.io/download and download it on the official website. Download the latest version 4.0 here.

Step 2: install

1. Copy the compressed package to the Linux server through the remote management tool and perform the decompression operation

Tar-zxf redis-4.0.9.tar.gz

two。 Go to the extracted files directory and use make to compile the extracted Redis files

Figure: because my redis installation directory is in the / usr/locat/ directory, I will do the following

After the compilation is completed, you can see that there are src, conf and other folders in the extracted file redis-3.0.7.

3. After the compilation is successful, go to the src folder and execute make install to install Redis.

The installation is completed as shown below, and the interface is as follows:

Step 3: deploy

1. For ease of management, move the conf configuration file and common commands in the Redis file to the unified file

1), create bin and etc files

As shown in the figure:

2) go back to the directory where you just installed, find redis.conf, and copy it to / usr/local/redis/ect

Execute the command as follows:

Mv redis.conf / usr/local/redis/etc/

Enter the src directory and move mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server to / usr/local/redis/bin/

Execute the command: mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server / usr/local/redis/bin/

View the moved files in turn

2. Execute redis-server to start redis

3. Set the binding ip (Note: this step can be omitted if not needed)

If necessary, you can change the binding ip in the above figure to specify ip.

4. Set the background to start redis.

1) first, edit the conf file and change the daemonize attribute to yes (indicating that it needs to be run in the background)

Cd etc/ vim redis.conf

Change no to yes

2) start the redis service again, and specify the startup service profile

Redis-server / usr/local/redis/etc/redis.conf

The configuration background runs successfully.

This is the end of the introduction on "how to deploy redis under Linux". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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

Development

Wechat

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

12
Report