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

Getting MOVED errors from redis client when using a redis cluster #1

Open
prkirby opened this issue Jan 20, 2022 · 3 comments
Open

Comments

@prkirby
Copy link
Contributor

prkirby commented Jan 20, 2022

Using the Redis Cache Adapter with a redis cluster is failing when setting against a node other than the master node provided in configuration:

ReplyError: MOVED 15303 10.227.15.44:6379
    at parseError (/Users/pkirby/WebDev/chegg/contentful-mlp/landing-pages-contentful-ui/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/Users/pkirby/WebDev/chegg/contentful-mlp/landing-pages-contentful-ui/node_modules/redis-parser/lib/parser.js:302:14) {
  command: {
    name: 'set',
    args: [
      'payload:/pkirby-test-2/en-US/desktop/paul_kirby_test_2/DeFault_var_2/:ttl',
      '1642717815.486',
      'EX',
      '86400'
    ]
  }
}

Is there support for redis cluster configuration? Or did I mis-interpret this line in the next-boost documentation for server cluster, not redis cluster:

@next-boost/redis-cache
For using within a cluster
Check .next-boost.redis.js for sample config
@rjyo
Copy link
Contributor

rjyo commented Jan 21, 2022

The redis-cache uses ioredis as its redis client. You can check the doc to see how to handle this in a cluster.

redis/ioredis@8599981

Feels like it'll automatically retry.

@prkirby
Copy link
Contributor Author

prkirby commented Jan 22, 2022

@rjyo I created a PR for cluster support. Let me know if this is something you'd be willing to merge or if anything needs cleanup.

I added a link to the docker container for the redis cluster that I used in testing. I had a slight headache getting it running on Mac cause Monterey is taking up port 7000 with airplay, so let me know if you run into any issues there.

@electriccode
Copy link

#2 here is the link @rjyo . ioredis is initialised differently for cluster. Please see https://github.com/luin/ioredis#cluster

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

No branches or pull requests

3 participants