In this article, only the installation steps of the Redis cluster are described, and if you want to know the detailed procedure, see the following articles:
Redis Cluster _1.redis Installation
Redis cluster _2.redis master-slave configuration
Redis cluster _3.redis master-slave auto-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 dependent packages
# yum-y Install gcc make
2: Installation of Redis (three nodes)
Software uploaded to the/main directory
# cd/main/
# tar ZXVF redis-2.8.19.tar.gz
# MV Redis-2.8.19/redis/
# CD redis/
# make && make install
3: Modify configuration file (three nodes)
# Mkdir/main/redis/logs
# vi/main/redis/redis.conf
Daemonize Yes
LogFile "/main/redis/logs/redis.log"
4: Specify Slave (on slave node configuration)
# vi/main/redis/redis.conf
Slaveof 192.168.100.211 6379
5: Start Redis (three nodes)
#/main/redis/src/redis-server/main/redis/redis.conf
6: Specify listening 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 MyMaster 30000
Sentinel Parallel-syncs MyMaster 1
Sentinel Failover-timeout MyMaster 900000
LogFile "/main/redis/logs/sentinel.log"
7: Launch Sentinel (three nodes):
#/main/redis/src/redis-sentinel/main/redis/sentinel.conf
8: Turn off Firewall (three nodes)
# service Iptables stop
# chkconfig iptables off
9: Set boot boot (three nodes)
# echo "/main/redis/src/redis-server/main/redis/redis.conf" >>/etc/rc.local
# echo "/main/redis/src/redis-sentinel/main/redis/sentinel.conf" >>/etc/rc.local
Note: On first boot, you must first start the master
To this Redis installation is complete
Centos/linux Redis cluster installation