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 install Redis on Linux system

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly shows you "Linux system how to install Redis", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux system how to install Redis" this article.

About redis: redis is an open source, written in C language, supports network interaction, memory-based and persistent Key-Value database.

The official website address of redis, very easy to remember, is redis.io. (specially checked, the domain suffix io belongs to the national domain name, which is british Indian Ocean territory, that is, the British Indian Ocean Territory.)

Currently, Vmware is funding the development and maintenance of redis projects.

Redis features: the Redis read speed is 110000 times / s, the write speed is 81000 times / s

Atoms. All operations of Redis are atomic, and Redis also supports the atomicity of several operations after a full merge.

Support for multiple data structures: string (string); list (list); hash (hash), set (collection); zset (ordered collection)

Persistence, master-slave replication (cluster)

Support expiration time, support transactions, message subscription.

Window is not officially supported, but there is a third-party version.

Redis installation steps: 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

Note: if there is a problem in the compilation process, it is possible that the installation package was downloaded incorrectly. Here you can try to use the installation package downloaded by others or directly use the

Wget http://download.redis.io/releases/redis-4.0.9.tar.gz

If you find that the above reading does not solve the problem, please refer to the link: https://www.cnblogs.com/liu2-/p/6914159.html

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-benchmarkredis-check-aof redis-check-rdb redis-cliredis-server to / usr/local/redis/bin/

Execute command: mv mkreleasehdr.sh redis-benchmarkredis-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.

The above is all the contents of the article "how to install Redis in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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