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

What are the steps for installing Redis on a Linux system

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Today, I will show you the steps of installing Redis on Linux system. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

I believe everyone has seen the red packet grabbing activity of the 2021 Spring Festival Gala. According to statistics, during the Spring Festival Gala, there were 70.3 billion red packet interactions and 1.221 billion viewers in the Spring Festival Gala live broadcast room. In the face of such a large amount of traffic, the self-developed redis system used by the volcano engine played an important role.

About Redis: Redis is completely open source, complies with the BSD protocol, and is a high-performance key-value database.

Redis and other key-value cache products have the following three features:

Redis supports data persistence. You can save the data in memory on disk and load it again when you restart it.

Redis not only supports simple key-value type data, but also provides storage of data structures such as list,set,zset,hash.

Redis supports data backup, that is, data backup in master-slave mode.

Environmental description of the 1.Linux operating system

This article uses deepin 15.7 distribution, download address: https://www.deepin.org/

2.redis installation package

This article uses redis3.0.0, download address: http://download.redis.io/releases/

3.redis client

This article uses the open source software RedisPlus, download address: https://gitee.com/MaxBill/RedisPlus

Second, installation process 1. Download the redis source code package

We use wget to download or go directly to http://download.redis.io/releases/ to download the source package

two。 Decompress redis source code packet

Use the decompression tool or use the tar-zxvf command to extract

3. Compile redis program

What we just downloaded is the source code of redis, which needs to be compiled before we can use it. Go to the directory of the newly unzipped redis installation package and use the make command to compile.

Wait for the compilation process for a while, and see the following instructions to complete the compilation

4. Install the redis program

After the compilation process, the executable redis program will be generated in the src directory, and then you can install and use it. You can define the installation directory yourself. Here I install it under / opt/redis/.

You can see that the installation was successful, but failed for the first time, because the opt directory requires administrator privileges. We successfully installed here after using sudo to lift the rights.

5. Configure the redis service

It is preferred to copy the redis.conf configuration file in the source code package to the installation directory / etc/

The first choice is to change the redis password. Change the requirepass entry in / opt/redis/redis.conf. The default is annotated, that is, empty. Here we change it to 123456.

Then modify the ip access, which defaults to local access and allows other hosts to access. We modify the bind to 0.0.0.0

Configure redis to start the background service, and modify the daemonize entry. The default is no. Here, change to yes is the background startup mode.

6. Start the redis service

Execute / opt/redis/bin/redis-server / opt/redis/etc/redis.conf on the terminal. For convenience, we can write a sh script. After execution, we telnet 6379 and find that it has been started.

Use ps-ef | grep redis to see if redis is started

Use netstat-lntp | grep 6379 to check whether the redis is started. If it is LISTEN, the start is normal and port 6379 is listening.

7. Use the RedisPlus client to connect to redis

To download and install the RedisPlus client program, click Open to add connection information:

Then double-click the connection, and we see a successful connection to:

View redis data, information, configuration, etc. For the specific use of RedisPlus, please see https://gitee.com/MaxBill/RedisPlus

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

The above is the whole content of the steps for installing Redis on Linux systems. For more information related to the steps for installing Redis on Linux systems, you can search the previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!

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