Redis sentinel against clustering

I understand that redis sentinel is a way to configure HA (high availability) among multiple instances of redis. As I can see, there is one instance of redis that actively serves client requests at any given time. There are two additional servers in standby mode (waiting for failure, so one of them can act again).

  • Is it a waste of resources?
  • Is there a better way to take full advantage of the resources available?
  • Is Redis a clustering alternative to Redis sentinel?

I already looked through the redis documentation for sentinel and clustering , can anyone experience please explain.

Master slave configuration in Redis sentinel - before failure

Master fails and slave kicks in to action

UPDATE

OK In my real deployment scenario, I have two servers dedicated to redis. I have another server running a Jboss server. An application running in Jboss is configured to connect to the redis master (M) server.

Failover scenario

Ideally, I think that when the main cache server crashes (either the Redis process crashes or the computer crashes), the application in Jboss should connect to the Slave quest server. How to configure redis server for this?

+--------+ +--------+ | Master |---------| Slave | | | | | +--------+ +--------+ Configuration: quorum = 1 
+79
redis
Jun 30 '15 at 15:59
source share
5 answers

First, let's talk to the sentinels.

Sentinel manages fault tolerance; it does not configure Redis for HA. This is an important distinction. Secondly, the diagram you posted is actually a bad setup — you don't want to run Sentinel on the same node as the Redis nodes it manages. When you lose this host, you lose both.

Regarding "Is it a waste of resources?" it depends on your use case. In this setup, you do not need three Redis nodes, you are only two. Three increase your redundancy, but are not required. If you need additional redundancy, then this is not a waste of resources. If you don’t need redundancy, you just start one instance of Redis and call it good - since starting up will be more “wasteful”.

Another reason to run two slaves is to break the readings. Again, if you need it, it will not be a waste.

As for “Is there a better way to take full advantage of the resources available?” we cannot answer this because it is too dependent on your specific script and code. However, if the amount of data to store is "small" and the command speed is not extremely high, remember that you do not need to allocate a host for Redis.

Now for "Is Redis clustering an alternative to Redis sentinel?". It really depends entirely on your use case. Redis Cluster is not a HA solution - it is a multi-user solution / larger than-ram. If your goal is just HA, then it most likely does not suit you. Redis Cluster comes with restrictions, especially for multi-key operations, so this is not necessarily a simple “just use a cluster” operation.

If you think that the three nodes running Redis (and the three sentinels running) are wasteful, you will most likely be a cluster so that it is even larger, since it requires more resources.

The questions you asked are probably too broad and based on opinions to survive as written. If you have a specific case / problem that you are developing, please clarify this so that we can provide specific assistance and information.

Specific Update:

For proper fault tolerance management in your scenario, I would go with three sentries, one on your JBoss server. If you have 3 JBoss nodes, go one for each. I would have a Redis pod (master + slave) on separate nodes and let the parties control the rollback.

From there, we are talking about connecting JBoss / Jedis to using Sentinel to manage information and connections. Since I don't use those, a quick search reveals that Jedis has support, you just need to configure it correctly. Some examples I found are on Looking for a Jedi example with Sentinel and https://github.com/xetorthio/jedis/issues/725 which talk about JedisSentinelPool , which is the route for using the pool.

When Sentinel moves to another resource, clients will be disconnected, and Jedis will (should?) Handle the reconnection, specifying the Countries to which the current master belongs.

+85
Jun 30 '15 at 16:35
source share

A recommendation everywhere should begin with an odd number of instances, without using two or more of the two. This has been fixed, but can fix some other points.

First, to say that Sentinel provides a switch to another non-HA resource is false. When you migrate to another resource, you have HA with the added benefit of replicating application state. The difference is that you can have HA in the system without replication (this is HA, but it is not fault tolerant).

Secondly, running the gatekeeper on the same computer as its target redis instance is not a “bad setup”: if you lose your sentinel or your redis instance or the whole machine, the results will be the same. This is probably why each example of such configurations shows how it works on the same machine.

+32
Oct 08 '15 at 23:59
source share

This is not a direct answer to your question, but think that this is useful information for Redis newbies like me. Also this question appears as the first link in google when searching in "Redis cluster vs sentinel".

Redis Sentinel is the name of the Redis high-availability solution ... It has nothing to do with Redis Cluster and is intended for use by people who don't need Redis Cluster, but just a way to perform an automatic failure when the master instance does not work correctly.

Adapted from the Redis Sentinel 1.3 Project Project

This is not obviuos when you are new to Redis and implement a fault tolerance solution. The official documents about sentinel and clustering are not compared with each other, so it is difficult to choose the right path without reading a ton of documentation.

+23
Nov 16 '16 at 9:48
source share

This is my understanding after I hit my head on the documentation.

Sentinel is a unique hot-standby solution in which slaves are kept replicated and ready for promotion at any time. However, it does not support multi-node recording. Slaves can be configured for read operations. It is not true that Sentinel does not provide HA, it has all the features of a typical active-passive cluster (although this is the wrong term to use here).

The Redis cluster is a more or less distributed solution that runs on top of segments. Each piece of data is distributed between master and slave nodes. A minimum replication ratio of 2 ensures that you have two active shards available for master and slave. If you know sharding in Mongo or Elasticsearch, it will be easy to catch up with.

+6
Jul 03 '18 at 12:50
source share

Redis can work in a partitioned cluster (with many masters and subordinates from these masters) or in single instance mode (one master with subordinate replicas).
The link here says:

When using Redis in single instance mode, in which a single Redis server manages the entire unpartitioned database, Redis Sentinel is used to control its availability.

It also says:

The Redis cluster, in which data is distributed between several primary instances, independently manages the availability and does not require additional components.

Thus, HA can be provided in the 2 mentioned scenarios. Hope this clears up doubts. Radish cluster and sentries are not an alternative to each other. They are simply used to provide high availability in different cases of a split or non-split master.

0
May 25 '19 at 15:43
source share



All Articles