question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redis Multilevel Master Slave Replication

See original GitHub issue

Bug Report

Current Behavior

Hi, I’m not sure if it’s even a bug or I’m missing something. I have a multilevel master-level redis setup, where I have got a single master at level 0, then it has multiple slaves (level 1), and nodes on level 1 have got there own slaves and two more such levels. This whole thing was done due to some reasons which I’m not aware of. Issue 1 In order to create LettuceConnectionFactory for this setup, it suffices to pass RedisStandaloneConfiguration of master/slave and along with that LettucePoolingClientConfiguration where I set ReadFrom to NEAREST. But when I pass host: port of any node below level 1 it doesn’t work, it gives following error when I hit actuator/health endpoint

myLettuceConnectionFactory": { "status": "DOWN", "details": { "error": "org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: Cannot determine a node to read (Known nodes: []) with setting io.lettuce.core.ReadFromImpl$ReadFromNearest@72b18351" } }

But it works really fine when I put any node from level 0 or level 1 as a seed. Putting host of any node after level 1 fails.

Issue 2 Considering the above example here also, even if I give host: port of the ultimate master as initial seed, Lettuce wasn’t able to discover the whole topology and missed out on nodes below level 1.

In the dump below: Level 2 node: 172.24.200.33 Level 1 node: 172.16.201.146 Level 0 node: 172.16.201.145

I’ve added the topology discovery dump here

  • Lettuce version: 5.1.6.RELEASE
  • Redis version: 4.0.1

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mp911decommented, May 27, 2019

Wanted to know if this is the right way to do it

This is the appropriate way. Alternatively, if you have just a single node, then you could also connect directly to that node via RedisClient assuming that this is a standalone node.

1reaction
mp911decommented, May 24, 2019

Lettuce does not support discovery with multi-level replication. It supports only a single level (master-replica).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis replication
Redis uses asynchronous replication, with asynchronous replica-to-master acknowledges of the amount of data processed. A master can have multiple replicas.
Read more >
How to Setup Redis Master and Slave Replication? - eduCBA
Guide to Redis Master Slave. Here we discuss the introduction, redis master slave multiple replications, architecture, setup installing.
Read more >
How to setup Redis master and slave replication
It's very simple to setup a master-slave Redis replication that allows the slave Redis server to keep an exact backup copy of a...
Read more >
Redis Master-Slave Replication - Redisson
Redis Master -Slave Replication. Master-slave replication is an important technique for ensuring the performance and availability of your data. In this article, ...
Read more >
4.2.3 Master/slave chains
To alleviate such issues, we may want to set up a layer of intermediate Redis master/slave nodes that can help with replication duties...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found