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 compile and install redis5.0.3 for Linux-centos7

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

Share

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

This article editor for you detailed introduction of "Linux-centos7 how to compile and install redis5.0.3", the content is detailed, the steps are clear, the details are handled properly, I hope this "Linux-centos7 how to compile and install redis5.0.3" article can help you solve your doubts, following the editor's ideas slowly in-depth, let's learn new knowledge together.

1. Get the installation package https://blog.csdn.net/ct_666/article/details/111519155

Get the source package, if there are no special requirements, you must use the new version features, then version 5.0.3 is sufficient.

Cd / usr/local/ & & wget http://download.redis.io/releases/redis-5.0.3.tar.gz2. Decompress, compile

If the server does not have a gcc-c++ compilation environment installed, please refer to https://blog.csdn.net/ct_666/article/details/111519155

Decompress and compile. After the compilation is successful, delete the source package

Tar-zxvf redis-5.0.3.tar.gz & & cd redis-5.0.3/ & & make & & rm-rf.. / redis-5.0.3.tar.gz3. Basic configuration

Configuration file: / usr/local/redis-5.0.3/redis.conf, set on demand

Vi redis.conf

Configuration 1: start in the background

# redis is launched in the foreground by default # find this line daemonize no# change no to yes, and set redis to launch daemonize yes in the background

Configuration 2: set password-free access for all hosts

# redis can only be accessed locally by default # 1. Find this line and comment it out with bind 127. 0. 0. 0. 0. 2. Change this line protected-mode yes# to protected-mode no

Configuration 3: set all hosts to access with password

# redis can only be accessed locally by default # 1. Find this line and comment it out with bind 127. 0. 0. 0. 0. 2. Find this line and add a line of # requirepass foobaredrequirepass yourpassword4 below. Start

Specifies that the configuration file starts. I modified the configuration file to set up all hosts without password access and redis background startup.

Note: the current location of the directory is different, the startup command is also different, do not copy mechanically.

If you start redis from the root directory, the command is: / usr/local/redis-5.0.3/src/redis-server / usr/local/redis-5.0.3/redis.conf

If you start redis in the / usr/local/redis-5.0.3/src/ directory, the command is:. / redis-server.. / redis.conf

As follows, I started redis in the / usr/local/redis-5.0.3 directory, so the startup command is: src/redis-server redis.conf

[root@minio1 redis-5.0.3] # src/redis-server redis.conf 25966:C 16 Jan 2021 16:12:34.760 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo25966:C 16 Jan 2021 16:12:34.760 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=25966, just started25966:C 16 Jan 2021 16:12:34.760 # Configuration loaded5. test

The following is the no password refresh cache test

# Test [root@minio1 redis-5.0.3] # src/redis-cli 127.0.0.1 src/redis-cli 6379 > flushallOK127.0.0.1:6379 > exit [root@minio1 redis-5.0.3] # using the common cache clearing command

The following is the password refresh cache test, the password I set 123456

# in the case of setting a password, enter the redis client to execute flushall directly and report an error. You need to enter the password [root@minio1 redis-5.0.3] # src/redis-cli 127.0.0.1 src/redis-cli 6379 > flushall (error) NOAUTH Authentication required.127.0.0.1:6379 > auth 123456OK127.0.0.1:6379 > flushallOK127.0.0.1:6379 > exit [root@minio1 redis-5.0.3] # read here This "Linux-centos7 how to compile and install redis5.0.3" article has been introduced, want to grasp the knowledge of this article also need everyone to practice and use to understand, if you want to know more about the article, 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