You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -671,10 +671,11 @@ but a few so that if one is unreachable the client will try the next one, and th
671
671
672
672
A typical redis cluster contains three or more masters and several slaves for each master. It's possible to scale out redis cluster by sending read queries to slaves and write queries to masters by setting the `scaleReads` option.
673
673
674
-
`scaleReads` is "master" by default, which means ioredis will never send any queries to slaves. There are other two available options:
674
+
`scaleReads` is "master" by default, which means ioredis will never send any queries to slaves. There are other three available options:
675
675
676
676
1. "all": Send write queries to masters and read queries to masters or slaves randomly.
677
677
2. "slave": Send write queries to masters and read queries to slaves.
678
+
3. a custom `function(nodes, command): node`: Will choose the custom function to select to which node to send read queries (write queries keep being sent to master). The first node in `nodes` is always the master serving the relevant slots. If the function returns an array of nodes, a random node of that list will be selected.
0 commit comments