Installation environment:centos7.9, redis 6.0.8
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
Check the version of gcc
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
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:
6. Copy the redis configuration file to the redis installation directory
cp redis.conf /usr/local/mysoftwares/redis/ls /usr/local/mysoftwares/redis/
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
8. Start the project (Method 2:Background method)
Modify the redis.conf file& #xff0c;Change the guard mode to true
vim redis.conf
##9. Test
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!