#安装包方式
mkdir -p /opt/modules
yum install -y gcc-c++
cd /opt/software/
tar zxvf /opt/software/redis-5.0.14.tar.gz
cd /opt/software/redis-5.0.14
make && make install PREFIX=/opt/modules/redis
sed 's/bind 127.0.0.1/bind 0.0.0.0/g' /opt/software/redis-5.0.14/redis.conf >>/redis.conf
sed 's/daemonize no/daemonize yes/g' /redis.conf >>/opt/modules/redis/bin/redis.conf
sh /opt/modules/redis/bin/redis-server /opt/modules/redis/bin/redis.conf
firewall-cmd --zone=public --add-port=6379/tcp --permanent
systemctl restart firewalld