File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,20 @@ RedisClient.cluster(timeout: 3.0).new_client
50
50
RedisClient .cluster(nodes: %w[redis://node1:6379 redis://node2:6379] ).new_client
51
51
```
52
52
53
+ ``` ruby
54
+ # To connect with a subset of auth-needed nodes for startup
55
+
56
+ # User name and password should be URI encoded and the same in every node.
57
+ username = ' myuser'
58
+ password = URI .encode_www_form_component(' !&<123-abc>' )
59
+
60
+ # with URL:
61
+ RedisClient .cluster(nodes: %W[redis://#{ username } :#{ password } @node1:6379 redis://#{ username } :#{ password } @node2:6379] ).new_client
62
+
63
+ # with options:
64
+ RedisClient .cluster(nodes: %w[redis://node1:6379 redis://node2:6379] , username: username, password: password).new_client
65
+ ```
66
+
53
67
``` ruby
54
68
# To connect to single endpoint
55
69
RedisClient .cluster(nodes: ' redis://endpoint.example.com:6379' ).new_client
You can’t perform that action at this time.
0 commit comments