编辑 sentinel.xml 和 redis.conf
redis.conf 中核心是配置
bind 192.168.64.144
daemonize yes
protected-mode no
dbfilename redis-6379.rdb #默认dump.rdb
replica-read-only yes # 自动2.6副本默认只读,也就是slave只有只读权限
replicationOf myapplication 192.168.64.144 6379 2 #有些版本是slaveOf
appendonly yes #开启aof
appendfilename "appendonly-6379.aof"
appendfsync always #数据同步时间
save 3600 1 #每1小时有1个key 改变
save 300 100 #每5分钟有 100个key改变
save 60 10000 # 每1分钟有10000个key改变
logfile "redis.log"
dir $REDIS_HOME/data
sentinel.conf 核心配置
port 26381
daemonize yes
sentinel monitor mymaster 192.168.64.144 6379 2
sentinel down-after-milliseconds mymaster 30000 #下线是30s
sentinel auth-pass mymaster 123456 #这个学习的时候完全没有必要配置
sentinel failover-timeout mymaster 30000
bin/redis-server config/redis.conf
bin/redis-sentinel config/sentinel.conf
配置完成后 bin/redis-cli -h 192.168.64.144 执行info 命令