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

Working with Redis cluster #12

Closed
danhcc opened this issue Jan 2, 2018 · 12 comments
Closed

Working with Redis cluster #12

danhcc opened this issue Jan 2, 2018 · 12 comments

Comments

@danhcc
Copy link

danhcc commented Jan 2, 2018

I am wondering if this could be use with Redis cluster.
As far as I know, LUA scripts does not work with Redis cluster.
Can someone explain this to me please.

@mokies
Copy link
Owner

mokies commented Jan 2, 2018

In theory LUA script can work on a Redis cluster. Unfortunately at this time I have not tested the implementation against a Redis cluster.

Take a look http://www.dr-josiah.com/2014/11/introduction-to-rate-limiting-with_26.html under the subtitle 'Generating keys in the script' which discusses the requirements for utilising the LUA script with a Redis Cluster. The Redis implementation is largely based on this excellent blog post from Josiah Carlson.

@danhcc
Copy link
Author

danhcc commented Jan 2, 2018

@mokies Thank you, I'll see that post.
But I have imported this dependency to my project and I can not run your example because it needs a StatefulRedisConnection but since I'm using Redis cluster so I only have StatefulRedisClusterConnection.
What should I do for now? Should I cast StatefulRedisClusterConnection to StatefulRedisConnection?

@mokies
Copy link
Owner

mokies commented Jan 3, 2018

@danhcc it looks like we will need to rework some of the interfaces to support a clustered connection. I will give it a shot and get back to you.

@danhcc
Copy link
Author

danhcc commented Jan 3, 2018

@mokies Thanks in advance

@phrinx
Copy link

phrinx commented Apr 24, 2018

@mokies we'd also like to use ratelimitj with cluster support so just making you aware that adding this support would be highly appreciated :)

@Meyy-DL
Copy link

Meyy-DL commented May 7, 2018

@mokies I gave a shot to modify the ratelimitj framework to support redis cluster mode for our application and it seems to work fine so far. Would you mind taking a look if I create a pull request?

@mokies
Copy link
Owner

mokies commented May 7, 2018

Thanks @Meyy-DL I will definitely take a look and merge it into master. Apologies that I haven't got around to support this yet.

@shengnian
Copy link

1

@mokies
Copy link
Owner

mokies commented Aug 13, 2018

Apologies for the delay, my day job has been a little full on these past months

@Meyy-DL appreciate the PR.

I am currently working on a change to support a clustered Redis but want to be sure the change has appropriate test coverage before rolling it out.

@mokies
Copy link
Owner

mokies commented Aug 19, 2018

Redis Cluster support is looking good, see 3b2c0cb
Will be included in the 0.5.0 release.

@mokies mokies closed this as completed Aug 19, 2018
@Meyy-DL
Copy link

Meyy-DL commented Aug 20, 2018

@mokies Thank you! Highly appreciate it!

@mokies
Copy link
Owner

mokies commented Aug 25, 2018

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

5 participants