Redis Multilevel Master Slave Replication
See original GitHub issueBug 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:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
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.Lettuce does not support discovery with multi-level replication. It supports only a single level (master-replica).