doc: 阅读redis cluster replcia文档
This commit is contained in:
@@ -225,6 +225,7 @@
|
||||
- [Client connections and redirection handling](#client-connections-and-redirection-handling)
|
||||
- [CLUSTER SLOTS](#cluster-slots)
|
||||
- [Multi-keys operations](#multi-keys-operations)
|
||||
- [Scaling reads using replica nodes](#scaling-reads-using-replica-nodes)
|
||||
|
||||
|
||||
# redis
|
||||
@@ -3586,3 +3587,14 @@ MSET {user:1000}.name Angela {user:1000}.surname White
|
||||
|
||||
当指定hash slots的迁移完成后,关于该hash slot所有的`multi-key operations`都允许被执行。
|
||||
|
||||
#### Scaling reads using replica nodes
|
||||
通常来讲,replica nodes在接收到命令时,都会将其重定向给负责该hash slot的master node。但是,对于readonly命令,client可以使用replicas来对读操作进行扩展。
|
||||
|
||||
`READONLY`会告知redis cluster replica node如下信息:当前client`接收读取可能过时的数据`,并且`不会发送写请求`。
|
||||
|
||||
当connection处于readonly模式时,cluster只会在`the operation involves keys not served by the replica's master node`时,才会向client发送重定向。造成该问题的原因可能如下:
|
||||
- the client sent a command about hash slots never served by the master of this replica
|
||||
- the cluster was reconfigured and the replica is no longer able to serve commands for a given hash slot
|
||||
|
||||
当发生该场景时,replica会向client发送重定向,而client则应该更新其`hash slot map`。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user