请先参考我的另一篇文章安装yum CentOS7下安装yum ,完成后使用yum安装需要的依赖
1.yum安装GCC依赖
yum install cpp
yum install binutils
yum install glibc
yum install glibc-kernheaders
yum install glibc-common
yum install glibc-devel
yum install gcc
yum install make
2.更新GCC
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
3.安装redis
wget http://download.redis.io/releases/redis-6.0.6.tar.gz
tar xzf redis-6.0.6.tar.gz
cd redis-6.0.6
make
4.配置后台启动
cd redis-6.0.6
vim redis.conf
把daemonize的值改为yes
5.启动redis
src/redis-server
6.测试
src/redis-cli
redis> set a 111
OK
redis> get a
"111"