多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 概述 高可用的主从 ## 主从模式(一主多从) redis.6371.conf ``` port 6371 bind 0.0.0.0 logfile "6371.log" dbfilename 6371dump.rdb ``` redis.6372.conf ``` port 6372 bind 0.0.0.0 logfile "6372.log" dbfilename 6372dump.rdb slaveof 127.0.0.1 6371 ``` 运行 ``` //主 redis-server.exe redis.6371.conf //从,从可起多个 redis-server.exe redis.6372.conf ``` ## 配置 ### 添加redis redis.6371.conf ``` port 6371 bind 0.0.0.0 logfile "6371.log" dbfilename 6371dump.rdb ``` redis.6372.conf ``` port 6372 bind 0.0.0.0 logfile "6372.log" dbfilename 6372dump.rdb ``` redis.6373.conf ``` port 6373 bind 0.0.0.0 logfile "6373.log" dbfilename 6373dump.rdb ``` ### 添加哨兵配置 sentinel6370.conf ``` port 6370 bind 0.0.0.0 logfile "6370.log" dbfilename 6370dump.rdb dir sentinel sentinel monitor mymaster 127.0.0.1 6371 1 sentinel down-after-milliseconds mymaster 60000 sentinel failover-timeout mymaster 180000 sentinel parallel-syncs mymaster 1 ```