
目录
安装gcc
查看gcc版本
gcc -v
如果没有安装gcc,需要安装gcc
yum install -y gcc
下载redis安装包



找到要安装的版本
解压redis安装包
tar -zxvf redis-7.0.15.tar.gz
编译redis
进入解压后的Redis目录,使用make
命令进行编译:
cd redis-7.0.15
make
安装redis
编译完成后,使用make install命令进行安装,并指定安装目录。例如,将Redis安装到/usr/local/redis目录:
make install PREFIX=/usr/local/redis
启动redis服务
前台启动
cd /usr/local/redis/bin/
./redis-server
后台启动
1.从Redis的源码目录中复制redis.conf配置文件到Redis的安装目录:
cp /path/to/redis-7.0.15/redis.conf /usr/local/redis/bin/
其中/path/to/redis-7.0.15/是Redis解压后的目录路径。
2.修改redis.conf配置文件,将daemonize no改为daemonize yes,使Redis以守护进程方式运行。

3.把bind 127.0.0.1 修改为 0.0.0.0

4.把protected-mode yes修改为protected-mode no

5.启动redis服务
./redis-server redis.conf
验证redis是否能正常工作
./redis-cli

如果使用命令ping,能够得到pong响应,说明redis能够正常工作。