-
Notifications
You must be signed in to change notification settings - Fork 326
Closed
Labels
enhancementImproves existing functionalityImproves existing functionalityphpredisSpecific to PhpRedisSpecific to PhpRedis
Description
Please correct me if I missed something, but it doesn't look like you can pass any password to a sentinel when using Phpredis.
SncRedisBundle/src/Factory/PhpredisClientFactory.php
Lines 124 to 131 in dc5f443
$address = (new $sentinelClass( | |
$dsn->getHost(), | |
(int) $dsn->getPort(), | |
$connectionTimeout, | |
$connectionPersistent, | |
5, // retry interval | |
$readTimeout, | |
))->getMasterAddrByName($masterName); |
the Phpredis RedisSentinel class allows for an $auth parameter at the end.
https://github.com/phpredis/phpredis/blob/develop/sentinel.md#readme
Took me a bit to figure out why my setup was working with predis and not phpredis. I patched in the parameter for myself to pass the password from the parameters config: $options['parameters']['password'] ?? null
since my cluster setup uses the same password for both. I could see a more robust path, though, in checking the dsn string for a password first in case the the sentinel and the node passwords are different.
Metadata
Metadata
Assignees
Labels
enhancementImproves existing functionalityImproves existing functionalityphpredisSpecific to PhpRedisSpecific to PhpRedis