• redis副本集


    1.数据库配置细节:

       a.拷贝多个redis.conf文件;b.开启daemonize yes; c.Pid文件名字; d.指定端口; e.Log文件名字; f:Dump.rdb名字

    2.配置redis.conf文件

      a.daemonize yes ; b.port 6379; c. pidfile /var/run/redis_6379.pid; d.logfile "6379.log" ;

      e. save 900 1

        save 300 10
        save 60 10000

     f. dbfilename dump6379.rdb

    3.命令:info replication, 查看是否是主数据库

    4. redis-server /myredis/redis6379.conf => redis-cli -p 6379 

       redis-server /myredis/redis6380.conf=> redis-cli -p 6380=>slaveof 127.0.0.1 6379

      redis-server /myredis/redis6381.conf=> redis-cli -p 6381=>slaveof 127.0.0.1 6380

    5.反客为主:127.0.0.1 6380>slaveof no one ,6380变为主数据库了

    -------------------------------------------------

    6.哨兵模式配置,生产常用

    配置文件: sentinel.conf:   sentinel monitor host6379 127.0.0.1 6379 1

    启动:

    redis-server /myredis/redis6379.conf => redis-cli -p 6379 

       redis-server /myredis/redis6380.conf=> redis-cli -p 6380=>slaveof 127.0.0.1 6379

      redis-server /myredis/redis6381.conf=> redis-cli -p 6381=>slaveof 127.0.0.1 6379

    redis-sentinel /myredis/sentinel.conf

  • 相关阅读:
    高进度乘法FFT优化
    Activity的四种加载模式
    异步任务AsyncTask
    利用Handler在子线程中更新UI
    Android 屏幕旋转监听
    HDOJ-1698-线段树成段更新
    HDOJ-1671-字典树
    HDOJ-1251 字典树
    python数据结构与算法
    find the lowest number location
  • 原文地址:https://www.cnblogs.com/qiyc/p/9572073.html
Copyright © 2020-2023  润新知