lua-resty-redis icon indicating copy to clipboard operation
lua-resty-redis copied to clipboard

Cluster

Open misiek08 opened this issue 10 years ago • 13 comments

Hi! Is it possible to implement cluster functionality to core of this library? I'm not sure if I am able to do it myself, I tried, but code looks bad and it fails sometimes.

misiek08 avatar May 01 '14 23:05 misiek08

@misiek08 I don't have the time to look into this and I'll rely on contributions :)

agentzh avatar May 01 '14 23:05 agentzh

So we need to wait, right? :)

misiek08 avatar May 02 '14 07:05 misiek08

Yes. I have put this into my TODO list. This is indeed a good thing to have.

agentzh avatar May 02 '14 17:05 agentzh

come on misiek08 :100:

fengpeiyuan avatar May 03 '14 15:05 fengpeiyuan

come on

wbdu avatar Apr 03 '15 23:04 wbdu

Maybe i'm wrong, but doesn't redis have builtin clustering functionality since version 3.0? Can't we rely on that?

bjoe2k4 avatar Apr 03 '15 23:04 bjoe2k4

@bjoe2k4 yes it have, but client need to implement few responses from Redis to fully support cluster. Redis have built in only semi-routing which tells client where to ask for data if client connected to wrong node at first.

misiek08 avatar Apr 04 '15 00:04 misiek08

Guys, there are two pull requests implementing cluster-related features on the client side. Have you checked them out? See

https://github.com/openresty/lua-resty-redis/pulls

agentzh avatar Apr 04 '15 01:04 agentzh

I see only one is totally cluster-related but I don't understand a part of code there.... Looks like there are 2 hard-coded limits for cluster count (20) and nodes count in cluster (500). It looks like this pull is using one object for many cluster and I think that one "client" should be one cluster. About node count limit I think it should be done on dynamically sized array if possible.

Or Lua is better than I think and my comment it's useless :) I had half-year break in Lua and nginx-related development...

misiek08 avatar Apr 04 '15 12:04 misiek08

I will add this to here as a reminder that implementing a cluster support is not something that can be done ligthly, many questions needs to be answered, a lot of design decisions need to be made: https://github.com/xetorthio/jedis/issues/990#issuecomment-103393965

bungle avatar May 20 '15 13:05 bungle

+1

alu avatar Sep 16 '15 09:09 alu

+1

vkozubal avatar Sep 16 '17 13:09 vkozubal

Actually there are some unofficial clients offer part of the redis-cluster support. For example, like this one: https://github.com/steve0511/resty-redis-cluster

spacewander avatar Sep 16 '17 14:09 spacewander