redis 主从模式,sentinel 模式配置

编辑 sentinel.xml 和  redis.conf

redis.conf  中核心是配置

bind 192.168.64.144
daemonize yes
protected-mode no
dbfilename redis-6379.rdb #默认dump.rdb
replica-read-only yes # 自动2.6副本默认只读,也就是slave只有只读权限
replicationOf  myapplication  192.168.64.144 6379 2 #有些版本是slaveOf
appendonly yes #开启aof
appendfilename "appendonly-6379.aof"
appendfsync always  #数据同步时间
save 3600 1 #每1小时有1个key 改变
save 300 100 #每5分钟有 100个key改变
save 60 10000 # 每1分钟有10000个key改变
logfile "redis.log"
dir $REDIS_HOME/data

sentinel.conf 核心配置 

port 26381
daemonize yes
sentinel monitor mymaster  192.168.64.144 6379 2
sentinel down-after-milliseconds mymaster 30000 #下线是30s
sentinel auth-pass mymaster 123456 #这个学习的时候完全没有必要配置
sentinel failover-timeout mymaster 30000

bin/redis-server config/redis.conf 

bin/redis-sentinel config/sentinel.conf

配置完成后  bin/redis-cli -h 192.168.64.144 执行info 命令

相关推荐

  1. redis 主从模式sentinel 模式配置

    2024-02-21 05:08:01       54 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-21 05:08:01       91 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-21 05:08:01       97 阅读
  3. 在Django里面运行非项目文件

    2024-02-21 05:08:01       78 阅读
  4. Python语言-面向对象

    2024-02-21 05:08:01       88 阅读

热门阅读

  1. 2402C++,C++26包索引

    2024-02-21 05:08:01       56 阅读
  2. SpringBoot

    2024-02-21 05:08:01       50 阅读
  3. js遇到的问题 --持续更新

    2024-02-21 05:08:01       50 阅读
  4. rust gui fltk

    2024-02-21 05:08:01       54 阅读
  5. Rabbitmq的几种模式的总结

    2024-02-21 05:08:01       52 阅读
  6. 学习数据接构和算法的第11天

    2024-02-21 05:08:01       62 阅读
  7. 【Git】切换分支【2024年2月19日】

    2024-02-21 05:08:01       48 阅读
  8. Spring设计模式之工厂模式创建Bean对象

    2024-02-21 05:08:01       51 阅读
  9. eNSP学习——RSTP基础配置

    2024-02-21 05:08:01       47 阅读
  10. 如何使用阿里云OSS进行前端直传

    2024-02-21 05:08:01       43 阅读