connect to sentinel without auth but use password when connecting to redis instance?

261 views
Skip to first unread message

cngd...@gmail.com

unread,
Jan 19, 2017, 4:17:18 AM1/19/17
to lettuce-redis-client-users
Hi, i'm using redis 3.2, and set "requirepass" in my redis instance config.

If I set password in RedisURI, it would use it when connecting to sentinel server. Since sentinel does not support command 'AUTH', exception will be thrown "ERR unknown command 'AUTH'"

If I do not set password in RedisURI, It can't connect to redis instance.

So how could deal with it?

RedisURI.builder().withSentinelMasterId(masterId)
    .withPassword("test") // set it or not? Both will not work.

cngd...@gmail.com

unread,
Jan 19, 2017, 4:33:20 AM1/19/17
to lettuce-redis-client-users, cngd...@gmail.com
I find how to fix this, after I disable pingBeforeActivateConnection every thing works fine. 

If I enable pingBeforeActivateConnection, It will send a auth ping to sentinel server with password.

see channelActive() in PlainChannelInitializer.initChannel()

Mark Paluch

unread,
Jan 19, 2017, 7:39:25 AM1/19/17
to lettuce-redis-client-users, cngd...@gmail.com
Thanks on investigating the issue.
Do you care to file a bug report at https://github.com/mp911de/lettuce/issues?
Reply all
Reply to author
Forward
0 new messages