zoukankan      html  css  js  c++  java
  • 单台centos7.3 虚拟机实现主从复制和哨兵集群

     环境:

    centos7.3一台

    部署图:

    从服务器配置:

    slaveof 127.0.0.1 6379

    哨兵配置:

    port 26379 
    sentinel monitor m1 127.0.0.1 6379 2 sentinel monitor m1
    127.0.0.1 6389 2 # 2为quorum的数量,主观宕机的数量 sentinel down-after-milliseconds m1 30000 sentinel can-failover m1 yes sentinel auth-pass m1 123456 #如果redis配置了密码,这里必须配置认证,否则不能自动切换 sentinel parallel-syncs m1 1 # 主从切换时,只允许一台一台的的网上连接,防止负载过大 sentinel client-reconfig-script mymaster /var/redis/reconfig.sh

    启动主 master:

    ./src/redis-server redis6379.conf

    启动从slave:

    ./src/redis-server redis6380.conf
    ./src/redis-server redis6381.conf

    启动哨兵sentinel:

    ./src/redis-sentinel sentinel6666.conf 

    另外一个集群,和上面的命令类似,无非是文件名称和端口号不一样。

  • 相关阅读:
    tcl tk lappend
    file join
    [转载]强指针和弱指针
    DisplayHardware
    Android 十大调试方法
    C语言程序的外部变量与函数
    DisplayHardware
    Android 十大调试方法
    wifi连接流程分析
    [转载]强指针和弱指针
  • 原文地址:https://www.cnblogs.com/gaogaoyanjiu/p/10458798.html
Copyright © 2011-2022 走看看