Redis Cluster

Mango milk 2021-02-23 15:38:07
redis cluster


MASTER

yum install -y epel-release
yum install -y redis
vi /etc/redis.conf
<code>
bind 192.168.1.193
protected-mode yes
port 6379
tcp-backlog 65535
syslog-enabled yes
logfile /dev/null
maxclients 51200
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
databases 16
always-show-logo yes
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /var/lib/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
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
appendonly no
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
aof-use-rdb-preamble 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-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
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
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
</code>
redis-sentinel
vi /etc/redis-sentinel.conf
<code>
port 26379
bind LocalhostIP
syslog-enabled yes
dir /tmp
### monitor mymaster master server , Yes 2 individual sentinel Subjectively believe that master down, I agree master Transfer
sentinel monitor mymaster MASTERIP 6379 2
### stay 3000 millisecond (3s) I can't talk to master signal communication (ping perhaps info), Think master down
sentinel down-after-milliseconds mymaster 3000
### This configuration item specifies what is happening failover How many can there be at most during the primary / standby handover slave Simultaneously on the new master To synchronize , The smaller the number , complete failover The longer it takes , But if the number is bigger
### It means the more slave because replication And is not available . You can do this by setting this value to zero 1 To make sure there's only one at a time slave In a state where command requests cannot be processed .
sentinel parallel-syncs mymaster 1
### The same sentinel To the same master two failover The time between
### When one slave From a wrong one master Where the synchronized data starts to calculate the time , until slave Corrected to be correct master Where the data is synchronized
### When you want to cancel an ongoing failover The time required .
### When doing failover when , Configure all slaves Point to the new master Maximum time required . however , Even after this timeout ,slaves It will still be correctly configured to point master, But it won't parallel-syncs Matching
### Here are the rules of the game .
sentinel failover-timeout mymaster 180000
</code>
SLAVE
install redis, modify redis.conf The configuration file , Point to master
Enter cluster execution
slaveof 192.168.1.193 6379
版权声明
本文为[Mango milk ]所创,转载请带上原文链接,感谢
https://javamana.com/2021/02/20210223152228230d.html

  1. docker入门到熟练
  2. Java之HTTP网络编程(一):TCP/SSL网页下载
  3. Introduction to docker
  4. HTTP network programming in Java (1): TCP / SSL web page download
  5. mysql 的ACID以及隔离级别
  6. Acid and isolation level of MySQL
  7. Java序列化对字段名的影响
  8. The influence of Java serialization on field names
  9. Redis 日志篇:系统高可用的杀手锏
  10. Java中把一个对象复制给另外一个对象引发的思考
  11. Java之HTTP网络编程(一):TCP/SSL网页下载
  12. Redis log: the killer of system high availability
  13. Thinking about copying one object to another in Java
  14. HTTP network programming in Java (1): TCP / SSL web page download
  15. 数据库--oracle安装配置(本地安装的步骤及各种问题解决方案)
  16. 从事Java9年,27天熬夜把近年遇到的面试题收录成册全网开源!
  17. Database -- Oracle installation configuration (local installation steps and various problem solutions)
  18. Engaged in Java for 9 years, 27 days stay up late, the interview questions encountered in recent years included into a volume, the whole network open source!
  19. Java序列化 / 调用 Wildfly 服务接口异常:EJBCLIENT000409
  20. docker-compose部署Estack
  21. Redis 日志篇:系统高可用的杀手锏
  22. Java中把一个对象的值复制给另外一个对象引发的思考
  23. Java serialization / call wildfly service interface exception: ejbclient000409
  24. Docker compose deploy stack
  25. Mac下查看已安装的jdk版本及其安装目录
  26. Redis log: the killer of system high availability
  27. mybatis映射xml配置文件报错:<statement> or DELIMITER expected, got ‘id‘
  28. Thinking about copying the value of one object to another in Java
  29. IntelliJ IDEA 还能画思维导图,果然最强 IDE!
  30. vue使用sdk进行七牛云上传
  31. IntelliJ IDEA 还能画思维导图,果然最强 IDE!
  32. Spring原来还可以这么玩!阿里新产Spring全线宝典成功颠覆了我对Spring的认知!
  33. View the installed JDK version and its installation directory under mac
  34. Error in mybatis mapping XML configuration file: < statement > or delay expected, got 'ID‘
  35. IntelliJ IDEA 还能画思维导图,果然最强 IDE!
  36. Javascript性能优化【内联缓存】 V8引擎特性
  37. IntelliJ idea can also draw mind maps. It's really the strongest ide!
  38. Vue uses SDK to upload Qi Niu cloud
  39. IntelliJ idea can also draw mind maps. It's really the strongest ide!
  40. 深入理解 Web 协议 (三):HTTP 2
  41. Spring can still play like this! Ali's new spring product has successfully overturned my understanding of spring!
  42. IntelliJ idea can also draw mind maps. It's really the strongest ide!
  43. JavaScript performance optimization [inline cache] V8 engine features
  44. linux 配置java环境
  45. linux find 查找文件
  46. 深入理解 Web 协议 (三):HTTP 2
  47. IntelliJ IDEA 相关问题记录
  48. Deep understanding of Web protocol (3): http 2
  49. 深入理解 Web 协议 (三):HTTP 2
  50. 腾讯IEG开源AI SDK:自动化测试吃鸡、MOBA类游戏
  51. Mysql Command
  52. Configuring Java environment with Linux
  53. Find files in Linux
  54. docker-Dockerfile 创建镜像
  55. Redis Cluster
  56. 深入理解 Web 协议 (三):HTTP 2
  57. JavaScriptBOM操作
  58. JavaScriptBOM操作
  59. Deep understanding of Web protocol (3): http 2
  60. Record of IntelliJ idea related problems