Hi Demis, sorry for the long delay, I was busy releasing a new Version of our software…
Does that mean you fully rely on PUB/SUB? If it is correct, what Bill Anderson in early 2016
writes (see this blog post I referenced earlier)
then Redis seams to have lost the information WHO has subscribed to any channel when the primary is shut down. Don’t know if that is still true in 2019…
But the behaviour when the primary is stopped somehow confirms what Bill writes. I can reproduce this same behaviour all the time:
- Nodes
dbinfra1
…dbinfra5
are up and running. - Node
dbinfra1
is the current master - I shutdown the LINUX server
dbinfra1
- The sentinels immediately recognize this and elect a new master, e.g. it is
dbinfra2
. - ServiceStack.RedisSentinel reports connection failures on
dbinfra1
. - I shutdown my container (
docker container stop <mycontainername>
). So the process running instances of ServiceStack.RedisSentinel is down/stopped/dead. - I restart the container (
docker container start <mycontainername>
). ServiceStack.RedisSentinel reports again connection errors withdbinfra1
!!
- WHY IS IS THIS? IT HAS REBOOTED!
- WHY DOES IT SELECT
DBINFRA1
AGAIN EVEN THOUGH THIS INSTANCE IS STILL SHUT DOWN? WHERE DOES THE MACHINE NAMEDBINFRA1
COME FROM? IS IT CACHED SOMEWHERE?? - WHY DOES IT NOT TRY THE NEXT IP OF THE ARRAY OF SUBMITTED NODES??
- I start the Linux machine
dbinfra1
again and all of a sudden, connection errors disappear and all of a suddenServiceStack.RedisSentine
seems to switch todbinfra2
as new MASTER!!
Other Questions:
- If you write
misconfiguration
then you meanServiceStack.RedisSentinel
or do you meansentinel.conf
on the Linux server?? - Is there a possibility to give ServiceStack.RedisSentinel a hint, to switch the server? (e.g. in my case to tell it use ‘dbinfra2’ and NOT always 'dbinfra1`??
Sorry, but I don’t care what is typical or standard! Redis is a fast key/value store but only if you configure and run it correctly on the server side. “Hello World” samples and configs are usually a bad choice in production deployments… According to many messages on the net, Redis is single threaded. So if you run multiple databases in one redis instance on ONE IP port your performance degrades massively, especially if all your databases are busy. Read for example this post and also this discussion just as two samles… You can find many more…
Hmm, here I showed the process list of ONE of my Linux servers. It clearly shows 6 redis processes and also 6 sentinel processes. So each Redis database instance is monitored by one Sentinel instance. And every redis database instance has also its own master group. I also posted C# containing the App.Configure()
implementation of one of my servers which uses three of the six redis databases. The name of every master group is taken from an input parameter and is passed to your constructor of RedisSentinel
for database 1, database2 and database 3
Thats not an option since our customers NEVER accept a public cloud datastore for privacy reasons!
Forget the geo-redundancy, it has nothing to do with this problem! In the remote backup location I use slave-priority = 0
which means, that these slaves will never become primaries. Read this documentation for details if you are interested in.