8000 Support Redis Sentinel mode when using phpredis/phpredis extension · Issue #39362 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Support Redis Sentinel mode when using phpredis/phpredis extension #39362
Closed
@renan

Description

@renan

Description

The version 5.2.0 of the Redis PHP extension, released back in March 2020, added support for Redis Sentinel mode with the help of the RedisSentinel class.

A connection to the elected master can be created as such:

$sentinel = new RedisSentinel($address, $port);
$master = $sentinel->getMasterAddrByName($masterName);

$connection = new Redis(sprintf('redis://%s:%d', $master[0], $master[1]));

Example

Usage of the Symfony/Cache RedisAdapter can continue to be the same, thus relying on the $options['redis_persistent'] option to both enable and define the master name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0