Home >Database >Redis >What is the installation method of Redis6 under Centos7?

What is the installation method of Redis6 under Centos7?

WBOY
WBOYforward
2023-06-03 19:19:252130browse

Installation environment:centos7.9, redis 6.0.8

Nanny-level installation tutorial

1. Download the Redis compressed package from the Internet

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

2. Unzip

tar -xf  redis-6.0.8.tar.gz

3. Enter the decompressed folder

cd redis-6.0.8

4. Compile redis

make#编译redis

If you find that the final compilation fails
What is the installation method of Redis6 under Centos7?
Check the version of gcc
What is the installation method of Redis6 under Centos7?
Execute the following commands in sequence to check gcc Upgrade the version

yum -y install centos-release-scl

yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

scl enable devtoolset-9 bash#修改环境变量echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile

gcc -v

What is the installation method of Redis6 under Centos7?
Execute the make command again, and find that the compilation is successful

5. Install Redis

mkdir  /usr/local/mysoftwares/redis -p	#创建安装目录make PREFIX=/usr/local/mysoftwares/redis/ install#安装并指定安装目录

Installation successful:
What is the installation method of Redis6 under Centos7?

6. Copy the redis configuration file to the redis installation directory

cp redis.conf /usr/local/mysoftwares/redis/ls /usr/local/mysoftwares/redis/

What is the installation method of Redis6 under Centos7?
7. Switch to the installation directory

cd /usr/local/mysoftwares/redis/

8. Start the project (Method 1: Front Desk Method)

./bin/redis-server redis.conf

What is the installation method of Redis6 under Centos7?
8. Start the project (Method 2:Background method)

Modify the redis.conf file& #xff0c;Change the guard mode to true

vim redis.conf

What is the installation method of Redis6 under Centos7?
What is the installation method of Redis6 under Centos7?

##9. Test
What is the installation method of Redis6 under Centos7?

The above is the detailed content of What is the installation method of Redis6 under Centos7?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete