Redis Installation and Deployment
Opening Specified Ports or Disabling Firewall
View the ports that are already open:
firewall-cmd --list-portsOpen a specified port (e.g., port 6379 for Redis):
firewall-cmd --zone=public --add-port=6379/tcp --permanentReload the firewall configuration:
firewall-cmd --reloadConfirm the opened ports:
firewall-cmd --list-portsIf needed, you can stop the firewall:
systemctl stop firewalldCheck the firewall status:
systemctl status firewalld
Installation and Deployment
Extract the Redis installation package:
tar -zxvf redis-4.0.9.tar.gz -C /usr/local/Rename the extracted folder:
mv redis-4.0.9 redisInstall the required dependencies (e.g., GCC):
yum install gcc -yCompile the Redis files:
cd /usr/local/redis make && make install
Edit Configuration File
Edit the Redis configuration file:
vi redis.confSet a password (e.g., "123456"):
# Before # requirepass foobared # After requirepass 123456Enable background daemon mode:
# Before # daemonize no # After daemonize yesAllow remote access:
# Before # bind 127.0.0.1 # After bind 0.0.0.0Save the configuration file and exit the editor.
Start Redis
Start Redis using the modified configuration file:
redis-server /usr/local/redis/redis.confValidate the Redis server is running:
redis-cli
Make sure to adjust paths, passwords, and other configurations as needed for your specific environment.