This is just a summary of the installation stepsIf you want to understand the principle of high availability of Redis cluster, it is recommended to carefully look over the configuration file example http://download.redis.io/redis-stable/redis.conf, the source package also has, the inside of the notes are dry, read will be very helpful.
1. Installationwget Http://download.redis.io/releases/redis-2.8.18.tar.gztar XF REDIS-2.8.18.TAR.GZCD redis-2.8.18.tar.gzmake Mkdir/usr/local/redis-bin #创建redis安装目录 # Copy the compiled bin file to the installation directory CP src/redis-*/usr/local/redis-bin# Copy the default configuration file to the installation directory CP REDIS.CONF/USR/LOCAL/REDIS-BINCP Sentinel.conf/usr/local/redis-bin
2, configuration (Redis service one master one from, failure election service three)VI redis.conf #配置redis, two daemonize yes #redis在后台执行logfile "/usr/local/redis-bin/redis.log" #redis日志输出slaveo F 192.168.166.131 6379 #slave节点需要配置主master节点的信息 #redis要求的, kernel parameter modification, restart effective Vim/etc/sysctl.confvm.overcommi T_memory = 1net.core.somaxconn = 511 vi sentinel.conf #配置故障选举服务, three additions: Daemonize yeslogfile "/usr/local/redis-bin/sent Inel.log "Modify Sentinel Monitor MyMaster 192.168.166.131 6379 2
3. Start offRedis start:/usr/local/redis-bin/redis-server/usr/local/redis-bin/redis.conf off:/usr/local/redis-bin/redis-cli Shutdownsentinel start:/usr/local/redis-bin/redis-sentinel/usr/local/redis-bin/sentinel.conf off:/usr/local/ Redis-bin/redis-cli-p 26379 shutdown
Redis High-availability cluster setup for production environments