美文网首页
redis sentinel集群搭建

redis sentinel集群搭建

作者: engineer_tang | 来源:发表于2020-07-13 11:25 被阅读0次

    redis sentinel搭建

    主sentinel配置

    port 6310
    dir "/tmp"
    logfile "/usr/local/src/redis-6.0.5/logs/sentinel-6310.log"
    daemonize yes
    sentinel monitor mymaster  192.168.128.101  6300  2
    sentinel auth-pass mymaster 123456
    sentinel down-after-milliseconds mymaster  15000
    sentinel failover-timeout mymaster 120000
    sentinel parallel-syncs mymaster 1
    #发生切换之后执行的一个自定义脚本:如发邮件、vip切换等
    #sentinel notification-script <master-name> <script-path>
    

    从sentinel配置

    port 6310
    dir "/tmp"
    logfile "/usr/local/src/redis-6.0.5/logs/sentinel-26380.log"
    daemonize yes
    sentinel monitor mymaster 192.168.128.101 6100 2
    sentinel down-after-milliseconds mymaster 15000
    sentinel failover-timeout mymaster 120000
    sentinel auth-pass mymaster linlin
    sentinel config-epoch mymaster 0
    #发生切换之后执行的一个自定义脚本:如发邮件、vip切换等
    #sentinel notification-script <master-name> <script-path>
    

    创建日志目录

    cd /usr/local/src/redis-6.0.5/
    mkdir logs
    

    开启sentinel端口

    firewall-cmd --add-port=6310/tcp
    
    

    运行sentinel

    ./redis-sentinel  /usr/local/src/redis-6.0.5/sentinel_6310.conf 
    ps -aux|grep sentinel
    

    参考:https://www.cnblogs.com/lin1/p/10403981.html

    相关文章

      网友评论

          本文标题:redis sentinel集群搭建

          本文链接:https://www.haomeiwen.com/subject/kskacktx.html