1、下载
wget -P 路径 https://download.redis.io/releases/redis-6.2.9.tar.gz
2、解压
tar zxvf redis-6.2.9.tar.gz
3、安装GCC autoconf automake
yum -y install gcc-c++ autoconf automake
4、升级GCC
#安装scl源
yum install -y centos-release-scl scl-utils-build
#安装9版本gcc
yum install -y devtoolset-9-toolchain
#覆盖原有的gcc
scl enable devtoolset-9 bash
#查看版本
gcc -v
5、编译redis
cd cd redis-6.2.9
make
6、安装
mkdir usr/local/redis
make -p usr/local/redis install
7、创建服务启动
vim /etc/systemd/system/redis.service
[Unit]
Description=redis-server
After=network .target
[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start redis.service