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

Add support for Redis cluster via eredis_cluster #2116

Open
1 task done
goldyfruit opened this issue Mar 15, 2023 · 6 comments
Open
1 task done

Add support for Redis cluster via eredis_cluster #2116

goldyfruit opened this issue Mar 15, 2023 · 6 comments

Comments

@goldyfruit
Copy link
Contributor

goldyfruit commented Mar 15, 2023

Describe your issue or feature request

The current eredis implementation doesn't support Redis cluster which prevent VerneMQ to retrieve the ACL if eredis is not connected to the correct Redis shard.

According to the eredis documentation, they recommend to use eredis_cluster as client when a connection to a Redis cluster is required.

Describe the solution you'd like

The solution could be to add an option like redis.cluster=on, if on then we should load eredis_cluster and configure the client with the correct arguments, if off we should load the standard eredis client.

Describe alternatives you've considered

No response

Environment

  • VerneMQ Version: master
  • OS: Kubernetes
  • Erlang/OTP version (if building from source): 25.2.3
  • Cluster size/standalone: 3 pods

Add any other context, code samples or screenshots about the issue report here.

No response

Code of Conduct

  • I agree to follow the VerneMQ's Code of Conduct
@ioolkos
Copy link
Contributor

ioolkos commented Mar 15, 2023

@goldyfruit Thanks for the suggestion. Yeah, we should have a look at both libs.
One question that comes to mind immediately is whether eredis_cluster could be enough (ie whether it could handle the single Redis node too).


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

@goldyfruit
Copy link
Contributor Author

goldyfruit commented Mar 15, 2023

One question that comes to mind immediately is whether eredis_cluster could be enough (ie whether it could handle the single Redis node too).

I would say no, it does not support standalone Redis instance (but I might be wrong), I opened an issue to the project to be sure. 👍

@goldyfruit
Copy link
Contributor Author

goldyfruit commented Mar 15, 2023

Answer from the opened issue:

Hi!

I believe there is some code for this, yes. If CLUSTER SLOTS fails, there is a fallback to standalone mode. However, there is a lot of overhead compared to using a simple eredis connection.

Btw, in case you're trying out different solutions, we are now actively working on another more efficient cluster client: https://github.com/Ericsson/ered

@ioolkos
Copy link
Contributor

ioolkos commented Mar 16, 2023

Interesting to see this come out from Ericsson. They clearly label it beta, though.
So, for now, what I would do is a functional test with eredis_cluster and see whether "a lot of overhead" is an issue or not. My guess is not.


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

@goldyfruit
Copy link
Contributor Author

Interesting to see this come out from Ericsson. They clearly label it beta, though.

Nordic is an initiative from Ericsson I think.

@golfvert
Copy link

I'd be also very interested in having the option to use a redis cluster as the auth/auth backend. In my app, along the VerneMQ cluser I already have a redis cluster... Having the option to use a cluster would avoid having a spof.
So, +1 from me :)

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