1、下载redis

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

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

2、解压到opt目录

tar -zxvf redis-5.0.4.tar.gz -C /opt/

3、安装gcc编译工具

yum install gcc gcc-c++ -y

4、进入安装目录

cd /opt/redis-5.0.4/

5、开始编译安装

make

6、修改redis配置文件

vim /opt/redis-5.0.4/redis.conf

bind 127.0.0.1 192.168.0.57           #redis绑定地址,最好只绑定内网ip

protected-mode no                         #关闭保护模式

port 7843                                        #修改端口

timeout 180                                    #客户端超时时间

daemonize yes                              #后台启动

7、启动redis

/opt/redis-5.0.4/src/redis-server /opt/redis-5.0.4/redis.conf

8、加入开机自启动

echo '/opt/redis-5.0.4/src/redis-server /opt/redis-5.0.4/redis.conf' >> /etc/rc.local

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄