redis cluster with only 1 shard and not 3 as required

1,448 views
Skip to first unread message

Anirudha Jadhav

unread,
Aug 7, 2014, 4:02:54 PM8/7/14
to redi...@googlegroups.com
Can i have a redis cluster setup with a singe shard and n replicas, as opposed to the default cluster tutorial setup with 3 shards. 

the redis trib tool also errors on this setup. Trying to understand the rationale behind it

Ani

Josiah Carlson

unread,
Aug 7, 2014, 4:51:59 PM8/7/14
to redi...@googlegroups.com
Cluster with 1 shard and n replicas has more restrictions without significant benefit over 1 regular Redis server with n slaves using Redis sentinel.

If you want 1 server and n replicas, use regular Redis with sentinel.

 - Josiah



--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Anirudha Jadhav

unread,
Aug 7, 2014, 5:04:16 PM8/7/14
to redi...@googlegroups.com
I wanted a uniform setup for all my redis clusters (with or without sharding) and dont want to operational overhead of using the sentinel process,


--
Anirudha P. Jadhav

Josiah Carlson

unread,
Aug 7, 2014, 5:23:38 PM8/7/14
to redi...@googlegroups.com
Cluster is defined by the fact that it shards your data across cluster nodes. That's going to be more consistent than trying to force this one cluster to acti differently than your other clusters.

After startup has completed, you can certainly force migrate shards to one server to get what you want, but I wouldn't be all that surprised to discover Redis trying to migrate other shards to other servers to balance the load.

 - Josiah

Anirudha Jadhav

unread,
Aug 7, 2014, 5:34:26 PM8/7/14
to redi...@googlegroups.com

I see your point,  but I am still curious about the number 3 and the need to shard by default.

Sharding is useful to scale wide, but for smaller usecase a single shard should be fine.

Also I am under the assumption that redis cluster replaces redis sentinel,  am I wrong here?

Josiah Carlson

unread,
Aug 7, 2014, 6:24:08 PM8/7/14
to redi...@googlegroups.com
On Thu, Aug 7, 2014 at 2:34 PM, Anirudha Jadhav <anir...@nyu.edu> wrote:

I see your point,  but I am still curious about the number 3 and the need to shard by default.

Having 3 nodes allows 2 of the nodes to have quorum over 1 node being out, so that they can take over management of the keys.

Sharding is useful to scale wide, but for smaller usecase a single shard should be fine.

Redis cluster was created under the design requirements of being used in scenarios where a single master and a few slaves would not be sufficient. So while you are technically right in the "a single shard should be fine for small clusters", the Redis cluster design operates under the assumption that this will never be the case, so doesn't allow for it.

On the operational side of things, the answer for "but I just need one shard and some replicas" is to just use a master, some slaves, and optionally Redis sentinel. Which is why I told you to do that in my first reply.

Also I am under the assumption that redis cluster replaces redis sentinel,  am I wrong here?

As far as I know, you are wrong.

Salvatore has stated previously that standard Redis with or without sentinel will be a fully supported configuration for the foreseeable future. This was stated *years* ago, and I haven't read anything from Salvatore stating the contrary. If you have a tweet or blog post from Salvatore stating that Redis sentinel and standard Redis will be going away any time after Redis cluster is released, I'd love a link, because I must have missed it.

 - Josiah

The Baldguy

unread,
Aug 8, 2014, 4:02:58 PM8/8/14
to redi...@googlegroups.com


On Thursday, August 7, 2014 5:24:08 PM UTC-5, Josiah Carlson wrote:
On Thu, Aug 7, 2014 at 2:34 PM, Anirudha Jadhav <anir...@nyu.edu> wrote:
...

Also I am under the assumption that redis cluster replaces redis sentinel,  am I wrong here?

As far as I know, you are wrong.

Salvatore has stated previously that standard Redis with or without sentinel will be a fully supported configuration for the foreseeable future. This was stated *years* ago, and I haven't read anything from Salvatore stating the contrary. If you have a tweet or blog post from Salvatore stating that Redis sentinel and standard Redis will be going away any time after Redis cluster is released, I'd love a link, because I must have missed it.


I've seen nothing indicating Sentinel is being replaced by cluster. Given they fulfill entirely different use cases it would be a significant mistake to do it. Indeed, Sentinel is still being improved.

Anirudha Jadhav

unread,
Aug 8, 2014, 5:59:04 PM8/8/14
to redi...@googlegroups.com
is the following true?
Redis cluster with a single shard (*with hierarchical replication ) = redis sentinel

*not available yet in cluster, possibly not needed in a clustered setup anyways

I would want to understand why would people still need sentinel and have to manage extra operational overhead to maintain another process, 
what extra does it get you?


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--
Anirudha P. Jadhav

Josiah Carlson

unread,
Aug 8, 2014, 6:40:17 PM8/8/14
to redi...@googlegroups.com
On Fri, Aug 8, 2014 at 2:58 PM, Anirudha Jadhav <anir...@nyu.edu> wrote:
is the following true?
Redis cluster with a single shard (*with hierarchical replication ) = redis sentinel

*not available yet in cluster, possibly not needed in a clustered setup anyways

You need a Redis master and a slave or two, with sentinels running next to all of the servers... but yes, the result is more or less similar.

I would want to understand why would people still need sentinel and have to manage extra operational overhead to maintain another process, 
what extra does it get you?

You don't need to use {tags} in your keys to ensure that keys live on the same shard (last time I checked, there was an ambiguity in the cluster spec regarding multi-key operations that are in different shards, but on the same machine), you get support for multiple databases, and maybe a few other things. But the big benefit is: it's available today, it's been tested heavily in the wild, and the use of sentinel is completely optional.

For many, maybe even most users, Redis cluster is probably the right answer for the future for larger installations. Time will tell whether the two versions differentiate themselves over time. But for now, standard Redis with or without sentinel has a few orders of magnitude more testing "in the wild", so should be considered a more stable product in the short/mid-term.

 - Josiah
Reply all
Reply to author
Forward
0 new messages