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

Migrate from node package "redis" to "ioredis" for redis high availability support. #555

Closed
kashalls opened this issue Jul 28, 2023 · 1 comment · Fixed by #585
Closed
Labels
enhancement New feature or request

Comments

@kashalls
Copy link
Contributor

When connecting to a sentinel-enabled redis cluster, regardless of what node you connect to, you will be met with an error of ReplyError: READONLY You can't write against a read only replica.. This can be solved by disabling sentinel in the config, however this makes the redis cluster much less highly available.

The redis package has had an issue open for sentinel support since 2012 and still has not been resolved.

I recommend switching to ioredis as other open source software has found success switching to it. See immich.

This is highly sought after as deploying a non-sentinel container makes it difficult to provide a high availability database to support this app.

@simlarsen simlarsen added the enhancement New feature or request label Jul 28, 2023
@kashalls kashalls changed the title Migrate from node package "redis" to "ioredis" for sentinel support. Migrate from node package "redis" to "ioredis" for redis high availability support. Jul 29, 2023
@kashalls
Copy link
Contributor Author

kashalls commented Aug 1, 2023

This would also fix issues if the redis instance suddenly disconnects, as if the main connected instance does a rolling update all connected services crash and have to be manually restarted.

{
  level: 'error',
  message: 'Socket closed unexpectedly',
  stack: 'Error: Socket closed unexpectedly\n' +
    '    at Socket.<anonymous> (/usr/src/CommonServer/node_modules/@redis/client/dist/lib/client/socket.js:195:118)\n' +
    '    at Object.onceWrapper (node:events:628:26)\n' +
    '    at Socket.emit (node:events:513:28)\n' +
    '    at Socket.emit (node:domain:489:12)\n' +
    '    at TCP.<anonymous> (node:net:320:12)',
  timestamp: '2023-08-01T20:32:49.759Z'
}

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

Successfully merging a pull request may close this issue.

2 participants