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

    redis哨兵模式配置教程

    1、版本

    redis_version:5.0.7

    2、系统IP

     10.211.55.3(一主)
     10.211.55.4(二从)

    3、配置主从复制

    3.1 主机redis.conf配置

    daemonize yes
    
    pidfile "/var/run/redis.pid"
    
    port 6379
    
    tcp-backlog 511
    
    timeout 0
    
    tcp-keepalive 0
    
    loglevel notice
    
    logfile "/usr/local/redis/redis.log"
    
    databases 16
    
    save 900 1
    
    save 300 10
    
    save 60 10000
    
    stop-writes-on-bgsave-error yes
    
    rdbcompression yes
    
    rdbchecksum yes
    
    dbfilename "dump.rdb"
    
    dir "/usr/local/redis"
    
    slave-serve-stale-data yes
    
    slave-read-only yes
    
    repl-diskless-sync no
    
    repl-diskless-sync-delay 5
    
    repl-disable-tcp-nodelay no
    
    slave-priority 100
    
    requirepass "tlogin"
    
    appendonly yes
    
    appendfilename "appendonly.aof"
    
    appendfsync everysec
    
    no-appendfsync-on-rewrite no
    
    auto-aof-rewrite-percentage 100
    
    auto-aof-rewrite-min-size 64mb
    
    aof-load-truncated yes
    
    lua-time-limit 5000
    
    slowlog-log-slower-than 10000
    
    slowlog-max-len 128
    
    latency-monitor-threshold 0
    
    notify-keyspace-events ""
    
    hash-max-ziplist-entries 512
    
    hash-max-ziplist-value 64
    
    list-max-ziplist-entries 512
    
    list-max-ziplist-value 64
    
    set-max-intset-entries 512
    
    zset-max-ziplist-entries 128
    
    zset-max-ziplist-value 64
    
    hll-sparse-max-bytes 3000
    
    activerehashing yes
    
    client-output-buffer-limit normal 0 0 0
    
    client-output-buffer-limit slave 256mb 64mb 60
    
    client-output-buffer-limit pubsub 32mb 8mb 60
    
    hz 10
    
    aof-rewrite-incremental-fsync yes
    
    masterauth "tlogin"
    
    protected-mode yes

     3.2 从机redis.conf配置

    daemonize yes
    
    pidfile "/var/run/redis.pid"
    
    port 6379
    
    tcp-backlog 511
    
    timeout 0
    
    tcp-keepalive 0
    
    loglevel notice
    
    logfile "/usr/local/redis/redis.log"
    
    databases 16
    
    save 900 1
    
    save 300 10
    
    save 60 10000
    
    stop-writes-on-bgsave-error yes
    
    rdbcompression yes
    
    rdbchecksum yes
    
    dbfilename "dump.rdb"
    
    dir "/usr/local/redis"
    
    replica-serve-stale-data yes
    
    replica-read-only yes
    
    repl-diskless-sync no
    
    repl-diskless-sync-delay 5
    
    repl-disable-tcp-nodelay no
    
    replica-priority 100
    
    requirepass "tlogin"
    
    appendonly yes
    
    appendfilename "appendonly.aof"
    
    appendfsync everysec
    
    no-appendfsync-on-rewrite no
    
    auto-aof-rewrite-percentage 100
    
    auto-aof-rewrite-min-size 64mb
    
    aof-load-truncated yes
    
    lua-time-limit 5000
    
    slowlog-log-slower-than 10000
    
    slowlog-max-len 128
    
    latency-monitor-threshold 0
    
    notify-keyspace-events ""
    
    hash-max-ziplist-entries 512
    
    hash-max-ziplist-value 64
    
    list-max-ziplist-entries 512
    
    list-max-ziplist-value 64
    
    set-max-intset-entries 512
    
    zset-max-ziplist-entries 128
    
    zset-max-ziplist-value 64
    
    hll-sparse-max-bytes 3000
    
    activerehashing yes
    
    client-output-buffer-limit normal 0 0 0
    
    client-output-buffer-limit replica 256mb 64mb 60
    
    client-output-buffer-limit pubsub 32mb 8mb 60
    
    hz 10
    
    aof-rewrite-incremental-fsync yes
    
    masterauth "tlogin"
    
    protected-mode yes

    3.3 启动主从,并测试

    #启动主(1主)
    cd /usr/local/software/redis-master/src
    ./redis-server ../redis-conf
    
    #启动从(2从)
    cd /usr/local/software/redis-slave1/src
    ./redis-server ../redis-conf
    
    cd /usr/local/software/redis-slave2/src
    ./redis-server ../redis-conf

    写不下去了  

    配置看这个博客

    https://blog.csdn.net/xujiamin0022016/article/details/95397272

    想要理解如何配置请看这个博客

    https://www.cnblogs.com/kreo/p/4423362.html

     

  • 相关阅读:
    如何关闭和打开oracle 10g自动收集统计信息功能
    ORA00600:internal error code,arguments
    ORA01033: ORACLE initialization or shutdown in progress
    ORA01652:unable to extend temp segment by num in tablespace name
    ORA01578:Oracle data block corrupted
    ORA03113:endoffile on communication channel
    ORA01650:unable to extend rollback segment NAME by NUM intablespace NAME
    ORA01628:max # of extents num reached for rollback segment num
    C# 项目中的 bin 目录和 obj 目录的区别,以及 Debug 版本和 Release 版本的区别
    管理 Hadoop 集群的5大工具
  • 原文地址:https://www.cnblogs.com/fooller/p/12402752.html
Copyright © 2011-2022 走看看