zoukankan      html  css  js  c++  java
  • 搭建redis哨兵模式

    搭建redis哨兵模式,一主两从三哨兵
     
    1.从官网下载redis安装包:此处是redis-5.0.7.tar.gz
    2.上传到目录 /utxt/soft
    3.解压
    4.cd /utxt/soft/redis-5.0.7
    5.编译源程序
    make
    cd src
    make test
     
    6.复制配置文件redis.conf和sentinel.conf到 /uloc/redis_conf/6000
     
    7.修改34,35两个从服务器的配置文件redis.conf如下:
    bind 192.168.150.34
    port 6000
    daemonize yes
    pidfile /uloc/redis_conf/6000/redis34.pid
    logfile "/uloc/redis_conf/6000/redis34.log"
    dir /uloc/redis_conf/6000/
    requirepass "czty_tqyb"
    appendonly yes
    appendfilename "appendonly.aof"
    masterauth "czty_tqyb"
    slave-read-only yes
    slaveof 192.168.150.36 6002
     
    8.修改主服务器的配置文件redis.conf如下:
     
    bind 192.168.150.36
    port 6002
    daemonize yes
    pidfile /uloc/redis_conf/6002/redis36.pid
    logfile "/uloc/redis_conf/6002/redis36.log"
    dir /uloc/redis_conf/6002/
    requirepass "czty_tqyb"
    appendonly yes
    appendfilename "appendonly.aof"
    masterauth "czty_tqyb"
    slave-read-only yes
     
    9、修改34,35,36配置文件sentinel_26000.conf和sentinel_26001.conf、sentinel_26002.conf
    port 26002
    daemonize yes
    pidfile "/uloc/redis_conf/6002/redis-sentinel.pid"
    logfile "/uloc/redis_conf/6002/redis-sentinel.log"
    dir "/uloc/redis_conf/6002"
    sentinel monitor master 192.168.150.36 6002 2
    sentinel auth-pass master czty_tqyb
  • 相关阅读:
    [LintCode 614.] 二叉树的最长连续子序列 II
    [LintCode 90.] k数和 II
    [LintCode 1674.] 倒可乐
    [LintCode 797.] 到达一个数字
    [LintCode 1691.] 买卖股票的最佳时机V
    [LintCode 69. 242.] 二叉树的层次遍历
    [LintCode 229.] 栈排序
    [LeetCode 1671.] 玩游戏
    [LintCode 1668.] 区间最小覆盖
    (十)线程同步
  • 原文地址:https://www.cnblogs.com/jinggs/p/12579630.html
Copyright © 2011-2022 走看看