redis主从配置

redis主从配置sentinel模式springboot访问

…衆ロ難τιáo~ 提交于 2019-12-10 06:18:13
redis主从配置 master:127.0.0.1:6379 slave:127.0.0.1:6378 master配置 redis.conf 默认无需修改 sentinel.conf port 26379 sentinel monitor mymaster 127.0.0.1 6379 1 sentinel monitor <master-name> <ip> <redis-port> <quorum> salve配置 redis.conf port 6378 slaveof 127.0.0.1 6379 sentinel.conf port 26378 sentinel monitor mymaster 127.0.0.1 6379 1 redis启动 redis-server redis.conf redis-server sentinel.conf --sentinel springboot访问配置 import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org