chproxy icon indicating copy to clipboard operation
chproxy copied to clipboard

Documentation should make it clear that redis cluster is required for redis mode

Open paulchoi opened this issue 3 years ago • 4 comments

I tried configuring Redis caching and the error message says ERR This instance has cluster support disabled. I brought up Redis instances using redis:7.0.4-alpine Docker container with no custom configuration.

INFO: 2022/07/28 00:29:42 main.go:46: chproxy ver. 1.16.3, rev. fab6ecdb24f30afdafde7b6d4cec4f03eebb5d6a, built at 2022-07-21T11:32:34Z
INFO: 2022/07/28 00:29:42 main.go:47: Loading config: /config/config.yaml
FATAL: 2022/07/28 00:29:42 main.go:53: error while applying config: failed to reach redis: ERR This instance has cluster support disabled

paulchoi avatar Jul 28 '22 00:07 paulchoi

I don't see why redis caching requires a redis cluster. I'll flag this issue as a bug and we'll see if we either change the doc or fix the root cause

mga-chka avatar Jul 28 '22 10:07 mga-chka

Figured out what is triggering the issue.

If just 1 Redis instance is configured under addresses, the error is not triggered. When 2 or more Redis instances are configured under addresses, then the error triggers.

So the workaround is to use just 1 Redis address for now.

paulchoi avatar Jul 29 '22 21:07 paulchoi

Thanks for the update. Just to understand (to see if it's worth to mention your trick in the doc), if you had a non clustered Redis, why did you ended-up with multiple addresses in the conf?

mga-chka avatar Aug 01 '22 08:08 mga-chka

(Sorry, was out of town for a while)

Sometimes you can add multiple Redis instances to a configuration if the application supports a hashing algorithm that utilizes multiple Redis instances - consistent hashing, for example. Since the configuration allows for multiple Redis instances, and there was no mention of requiring Redis Cluster, I wanted to see if chproxy would work.

I think it'd be sufficient to just state in the documentation that one should specify 2 or more Redis instances only if they are part of a Redis Cluster.

paulchoi avatar Aug 12 '22 23:08 paulchoi

FYI the following PR https://github.com/ContentSquare/chproxy/pull/215 will add more description on the documentation on the pb you faced. Once it's merge I'll close this PR (unless you think the description added is not enough)

mga-chka avatar Aug 29 '22 19:08 mga-chka

The PR was merged

mga-chka avatar Aug 31 '22 06:08 mga-chka