CentOS/Linux Redis cluster installation, centosredis
In this article, only the installation steps of the redis cluster are described. For detailed procedures, see the following articles:
Redis cluster _ 1. Install redis
Redis cluster _ 2. redis master-slave Configuration
Redis cluster _ 3. redis master-slave automatic switch Sentinel
Redis cluster _ 4. redis Startup Script
System Environment: CentOS 6.5 mini
Software Version: redis-2.8.19
IP Address:
Node 1: 192.168.100.211
Node 2: 192.168.100.212
Node 3: 192.168.100.213
Redis installation (three nodes)
1: Install related dependency packages
# Yum-y install gcc make
2: Install redis (three nodes)
Upload software to the/main directory
# Cd/main/
# Tar zxvf redis-2.8.19.tar.gz
# Music redis-2.8.19/redis/
# Cd redis/
# Make & make install
3: modify the configuration file (three nodes)
# Mkdir/main/redis/logs
# Vi/main/redis. conf
Daemonize yes
Logfile "/main/redis/logs/redis. log"
4: Specify the Slave (configured on the Slave node)
# Vi/main/redis. conf
Slaveof 192.168.100.211 6379
5: Start redis (three nodes)
#/Main/redis/src/redis-server/main/redis. conf
6: Listener Master (three nodes)
# Vi/main/redis/sentinel. conf
Port 26379
Daemonize yes
Sentinel monitor mymaster 192.168.100.211 6379 2
Sentinel down-after-milliseconds MySQL master 30000
Sentinel parallel-syncs mymaster 1
Sentinel failover-timeout MySQL master 900000
Logfile "/main/redis/logs/sentinel. log"
7. Start sentinel (three nodes ):
#/Main/redis/src/redis-sentinel/main/redis/sentinel. conf
8: Disable the firewall (three nodes)
# Service iptables stop
# Chkconfig iptables off
9: Set startup (three nodes)
# Echo "/main/redis/src/redis-server/main/redis. conf">/etc/rc. local
# Echo "/main/redis/src/redis-sentinel/main/redis/sentinel. conf">/etc/rc. local
Note: The Master must be started first when it is started for the first time.
The redis installation is complete.