@redis主从和哨兵搭建的坑(主要是搭建后哨兵info报错)
redis主从和哨兵搭建的坑(主要是搭建后哨兵info报错)
1.安装redis
2.复制三个,一个做主 俩个从
3.修改好redis.conf,然后启动
4.redis-server redis.conf
redis-cli -p 修改的端口 -h 修改后的host
连接后查看
5.从改好 slaveof 写主的
6.哨兵模式,修改sentinel.conf
port 26379
dir “/tmp”
protected-mode no
daemonize yes
sentinel deny-scripts-reconfig yes
sentinel monitor mymaster +host +port 2
7.启动后配置的信息就变了 这个不影响。。坑主要是改sentinel.conf的这两配置,protected-mode no 和 daemonize yes
8.redis-sentinel sentinel.conf
9.redis-cli -p -h 连接后即可用info查看