Deploy Redis Service⚓︎
1 Preparation⚓︎
1.1 Enviroment Information⚓︎
- Information of Redis server:
192.168.100.11
1.2 Configure Repo⚓︎
yum -y install epel-release https://repo.ius.io/ius-release-el7.rpm
2 Install and deploy Redis⚓︎
2.1 Install Redis with Yum⚓︎
yum install -y redis6
2.2 Configure Redis⚓︎
sed -i "s/bind 127.0.0.1/bind 0.0.0.0/g" /etc/redis.conf
sed -i "561i maxmemory-policy allkeys-lru" /etc/redis.conf
sed -i "481i requirepass KXOeyNgDeTdpeu9q" /etc/redis.conf
2.3 Start Redis⚓︎
systemctl enable redis
systemctl start redis
3 Configure Firewall⚓︎
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.0/24" port protocol="tcp" port="6379" accept"
firewall-cmd --reload