Sitelet https://github.com/phpredis/phpredis/issues/2132
Skip to content

Support for multiple Redis Sentinels #2132

Description

@taai

My knowledge about the Redis Sentinel is very limited right now, so, this is probably going to be just a question about how to use this package properly...

I have 3 Sentinel nodes (as there should be by recommendations), but in the README I see only how to use a single Sentinel node... The RedisSentinel() class accepts only single host (IP address or hostname).

Am I supposed to manage the connections to Sentiinel nodes myself? For example, should I connect to first Sentinel node (that is down) with class RedisSentinel(), catch an exception and try the next Sentinel node until no Sentinel nodes are left to try? At least. I think that Predis does exactly that.

Are there any drawbacks why multiple multiple Sentinels are not (yet) supported (the management is not built-in)?

Expected behaviour

Should be able to use multiple sentinels and use another sentinel when one is down.

Actual behaviour

Only single host can be used.

I'm seeing this behaviour on

  • OS: Ubuntu 22.04
  • Redis: 6.2
  • PHP: 8.1
  • phpredis: 5.3.7

Steps to reproduce, backtrace or example script

Just fallow the instructions in dedicated README.

I've checked

  • There is no similar issue from other users
  • Issue isn't fixed in develop branch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions