Install and configure redis under Linux/centos7

The latest version of redis was installed at the beginning of 6.0.1, which caused gcc version problems to appear for a long time. It is recommended to install the old version

1. Download the redis installation package

wget http://download.redis.io/releases/redis-5.0.8.tar.gz

It is recommended to put the redis installation package in the opt directory

mv redis-5.0.8.tar.gz /opt

After moving, enter the opt directory

cd /opt

Two, unzip the installation package

tar -zxvf redis-5.0.8.tar.gz

Three, enter the decompressed file

cd redis-5.0.8

Fourth, install the gcc environment

Select y in the options that appear later

yum install gcc-c++

Five, complete the installation

make
make install

Six, modify the configuration file

The default installation path of redis is in usr/local/bin. For convenience, we can copy the redis.conf file inside to other folders

cd /usr/local/bin		
mkdir redisconfig		
cp /opt/redis-5.0.8/redis.conf redisconfig

Change daemonize no in redis.conf file to daemonize yes

cd redisconfig
vim redis.conf

(Enter /daemonize and press Enter to quickly locate the location that needs to be modified, enter i to enter the editing mode, after the modification is completed, esc to exit the editing mode, :wq to exit the file)

Seven, start redis

Enter ping to get pong, it means success

redis-server redisconfig/redis.conf
redis-cli -p 6379

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_44042316/article/details/106036769