Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change configuration to allow config values required for redis sentinel #274

Closed
wants to merge 1 commit into from

Conversation

pascal-hofmann
Copy link

This allows for supplying the required values for redis sentinel (supported by Predis 1.1.x, out soon). See predis/predis#131 (comment) . Unfortunately the password is somehow not used when connecting to the redis master. After hours of debugging I worked around this by creating a very hacky custom connection factory (at the moment I simply have no time for a proper solution. Maybe someone else has...):

class ConnectionFactory extends \Snc\RedisBundle\Client\Predis\Connection\ConnectionFactory
{
    private $masterPassword = null;

    public function create($parameters)
    {
        if (isset($parameters['parameters']['password'])) {
            $this->masterPassword = $parameters['parameters']['password'];
        }
        if ((int) $parameters['port'] === 6379) {
            $parameters['password'] = $this->masterPassword;
        }

        return parent::create($parameters);
    }

}

@AlexC
Copy link

AlexC commented Jul 20, 2016

@phofmann-trust What was your snc_redis config to allow support for Sentinels? From what I can see, whilst Predis now supports Sentinel, SncRedisBundle does not

@pascal-hofmann
Copy link
Author

Did this for my old job. Don't have access to working configuration/source code anymore. Sorry :(

I remember that I had to do some other magic to get fully working Sentinel support with SncRedisBundle (some kind of config provider hack? Hm...)

thumbtyped, please excuse brevity and typos

Am 20.07.2016 um 17:32 schrieb Alex Cartwright notifications@github.com:

@phofmann-trust What was your snc_redis config to allow support for Sentinels? From what I can see, whilst Predis now supports Sentinel, SncRedisBundle does not


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@ivoba
Copy link

ivoba commented Sep 21, 2016

+1 for sentinel support

i worked around this with overriding the predis client service definitions in production since the main benefit of this bundle for me is logging & webprofiler, thus dev things which can be omitted in production.

snc_redis.default:
        class: Predis\Client
        arguments: ['%live.redis.sentinels%', '%live.default.redis.options%']

@asev
Copy link

asev commented Nov 16, 2016

+1 for redis sentinel support

@pascal-hofmann
Copy link
Author

Closing this because it is now supported with version 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants