Day10 Redis组态档设定-LUA SCRIPTING/REDIS CLUSTER/CLUSTER DOCKER/NAT support/SLOW LOG/LATENCY MONITOR

Redis.config

LUA SCRIPTING

  • lua-time-limit

执行lua script允许执行时间上限,超过则会被删除.(毫秒)

https://ithelp.ithome.com.tw/upload/images/20210925/20111658Zmp0MQdlp0.png

# 预设
lua-time-limit 5000

REDIS CLUSTER

  • cluster-enabled

是否启用Redis Server Cluster模式.

https://ithelp.ithome.com.tw/upload/images/20210925/201116588vT3jBCnFB.png

# 预设
# cluster-enabled yes
  • cluster-config-file

Redis Server Cluster 设定档案名称.

https://ithelp.ithome.com.tw/upload/images/20210925/20111658Sw1Anxcc6d.png

# 预设
# cluster-config-file nodes-6379.conf
  • cluster-node-timeout

设定Redis Server Cluster 节点连接逾时.(毫秒)

https://ithelp.ithome.com.tw/upload/images/20210925/20111658sA4oNX2i7M.png

# 预设
# cluster-node-timeout 15000
  • cluster-replica-validity-factor

如果设爲0,则一个Replica将总是尝试故障转移一个Master。如果设爲>0,则最大失去连接的时间是node timeout乘以这个factor。

https://ithelp.ithome.com.tw/upload/images/20210925/20111658bqW083OBbz.png

# 预设
# cluster-replica-validity-factor 10
  • cluster-migration-barrier

设定Master和Replica保持连接的最小数量(最少与多少个Replica保持连接),也就是说至少与其它多少Replica保持连接的Replica才有资格成爲Master。

https://ithelp.ithome.com.tw/upload/images/20210925/20111658kmp4XcpbkW.png

# 预设
# cluster-migration-barrier 1
  • cluster-allow-replica-migration

设定是否允许自动切换Replica成为Master.

https://ithelp.ithome.com.tw/upload/images/20210925/201116583M7LljtvLX.png

# 预设
# cluster-allow-replica-migration yes
  • cluster-require-full-coverage

设定yes时,key space没有达到百分之多少时停止接受写请求。如果设置爲no,将仍然接受查询请求,即使它只是请求部分key.

https://ithelp.ithome.com.tw/upload/images/20210925/20111658hXMK95AXXa.png

# 预设
# cluster-require-full-coverage yes
  • cluster-replica-no-failover

设定为yes时,可防止从设备尝试对其进行故障转移Master在主故障期间,除非强制执行手动故障转移。

https://ithelp.ithome.com.tw/upload/images/20210925/20111658GKAr6P6KNh.png

# 预设
# cluster-replica-no-failover no
  • cluster-allow-reads-when-down

是否允许在Cluster机制停止时还可以读取.

https://ithelp.ithome.com.tw/upload/images/20210925/20111658irp7CTmeEp.png

# 预设
# cluster-allow-reads-when-down no

CLUSTER DOCKER/NAT support

  • cluster-announce-ip

设定docker Cluster IP

  • cluster-announce-tls-port

设定docker Cluster TLS Port

  • cluster-announce-port

设定docker Cluster 对外 Port

  • cluster-announce-bus-port

设定docker Cluster Bus Port

https://ithelp.ithome.com.tw/upload/images/20210925/20111658YcbjMbFGGp.png

# cluster-announce-ip 10.1.1.5
# cluster-announce-tls-port 6379
# cluster-announce-port 0
# cluster-announce-bus-port 6380

SLOW LOG

  • slowlog-log-slower-than

设定执行操作超过多少时间时记录起来.(百万分之一秒)

https://ithelp.ithome.com.tw/upload/images/20210925/20111658wUZ6oH4PVW.png

# 预设
# 0.01 秒
slowlog-log-slower-than 10000
  • slowlog-max-len

设定记录操作慢的日志最多保存长度.

https://ithelp.ithome.com.tw/upload/images/20210925/20111658xdMAuXigHF.png

# 预设
slowlog-max-len 128

LATENCY MONITOR

  • latency-monitor-threshold

设定一个延时阈值来开啓延时监控,藉此收集资料确认Redis操作延迟问题。(毫秒)

https://ithelp.ithome.com.tw/upload/images/20210925/20111658cFnUu9mQqn.png

# 预设
latency-monitor-threshold 0

<<:  Day 10 情报收集 - Information Gathering (Maltego)

>>:  [Day13]-函数设计2

Firebase * Realtime Database * Web * Writ

1. 创建 Firebase 专案 步骤一:取个专案名称 步骤二:启用 Google Analyti...

Day 4:建立专案(二):Projucer 操练

本文介绍 Projucer 的基本用法,後续还有一些使用经验分享。 JUCE 是一跨平台开发框架(F...

数据来源身份真实-CBC-MAC

-密码学 问题是关於确保数据本身的完整性和数据来源的真实性,或者所谓的“真实性”,包括这两个概念。...

Day-25 ImageView

ImageView为显示图片, 但在图片显示前, 必须先了解如何插入图片: Step1:於资料夹选取...

Day9|工作区、暂存区、储存库,以及各执行的档案状态

前几篇章节经常提到使用 git add 加至暂存区,git commit 提交到储存库。这些工作区、...