File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,21 @@ $options = ['replication' => 'sentinel', 'service' => 'mymaster'];
230230$client = new Predis\Client($sentinels, $options);
231231```
232232
233+ If the master and slave nodes are configured to require an authentication from clients, a password
234+ must be provided via the global ` parameters ` client option. This option can also be used to specify
235+ a different database index. The client options array would then look like this:
236+
237+ ``` php
238+ $options = [
239+ 'replication' => 'sentinel',
240+ 'service' => 'mymaster',
241+ 'parameters' => [
242+ 'password' => $secretpassword,
243+ 'database' => 10,
244+ ],
245+ ];
246+ ```
247+
233248While Predis is able to distinguish commands performing write and read-only operations, ` EVAL ` and
234249` EVALSHA ` represent a corner case in which the client switches to the master node because it cannot
235250tell when a Lua script is safe to be executed on slaves. While this is indeed the default behavior,
You can’t perform that action at this time.
0 commit comments