ratelimit
ratelimit copied to clipboard
REDIS_AUTH does not work with sentinel
trafficstars
as used right now REDIS_AUTH is not used for authentication when using sentinel type, you have to encode password in redis uri in REDIS_URL variable, this should be fixed or mentioned in documentation
Maybe
diff --git a/src/redis/driver_impl.go b/src/redis/driver_impl.go
index 18e213f..272803c 100644
--- a/src/redis/driver_impl.go
+++ b/src/redis/driver_impl.go
@@ -109,7 +109,7 @@ func NewClientImpl(scope stats.Scope, useTls bool, auth string, redisType string
if len(urls) < 2 {
panic(RedisError("Expected master name and a list of urls for the sentinels, in the format: <redis master name>,<sentinel1>,...,<sentineln>"))
}
- client, err = radix.NewSentinel(urls[0], urls[1:], radix.SentinelPoolFunc(poolFunc))
+ client, err = radix.NewSentinel(urls[0], urls[1:], radix.SentinelConnFunc(df), radix.SentinelPoolFunc(poolFunc))
default:
panic(RedisError("Unrecognized redis type " + redisType))
}
What is the syntax to encode the password into the REDIS_URL variable?
redis://:p455w0rd@localhost:9376 apparently..
Indeed, I can also confirm this issue from my side. I also think that current documentation should mention this.
This is an open point. Are PR's welcome in this case for fixing this issue on the radix client side @vsabella?