Open omjego opened 5 years ago
Lettuce does not support discovery with multi-level replication. It supports only a single level (master-replica).
Are there any plans for implementing this feature in near future ?
Is there any way to find out which nodes it has discovered already on a running server? Probably using something like actuator.
Are there any plans for implementing this feature in near future ?
No. This is something that would increase complexity by orders of magnitude.
You could specify all nodes in a Collection<RedisURI>
. Node discovery is not exposed through the public API.
To be very specific I want to use redis nodes from level 2 in my app. So as a workaround, I'm using StaticMasterSlaveConfig, where I've specified root master node and few of the slave nodes in level 2 as the initial configuration. And it seems to be working. Wanted to know if this is the right way to do it or there is a better solution to this problem?
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.
Is this issue still relevant?
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