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.

Redisson complains about multiple masters when two replicated address nodes resolve to the same IP

See original GitHub issue

We are working through issues with using Redisson with AWS Elasticache during upgrade/failover/etc.

We currently have a replicated cluster of size 2: 1 master and 1 replicated node. AWS Elasticache provides us with two DNS endpoints to use:

  1. master.<redacted>.cache.amazonaws.com:6379
  2. replica.<redacted>.cache.amazonaws.com:6379

During normal operation both of these DNS entries will resolves to different IP addresses, however during upgrade/failover it is possible that only one cluster node is available and the DNS entries will resolve to the same IP addresses.

Even when operating the cluster with 1 node I think this should be allowed. This allows infrastructure teams to easily to scale up/down underlying cluster nodes load balanced by DNS without having to modify the application config to include/exclude certain hostnames.

Expected behavior

Redisson should tolerate when more than one node address resolves to the same IP address, that happens to be a master in the cluster.

Actual behavior

org.redisson.connection.ReplicatedConnectionManager.<init>(ReplicatedConnectionManager.java:80) org.redisson.Redisson.<init>(Redisson.java:67) org.redisson.config.ConfigSupport.createConnectionManager(ConfigSupport.java:199) org.redisson.Redisson.create(Redisson.java:108) <redacted>.main(Application.kt:97) Exception in thread “main” org.redisson.client.RedisException: Multiple masters detected

Steps to reproduce or test case

Initialize replicated configuration with two DNS entries that resolve to the same IP address.

Redis version

6+

Redisson version

3.15.2

Redisson configuration

final Config config = new Config();
final ReplicatedServersConfig replicatedConfig = config.useReplicatedServers();
replicatedConfig.addNodeAddress("AWS Elasticache primary endopoint");
replicatedConfig.addNodeAddress("AWS Elasticache replica endpoint");

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mrnikocommented, Aug 12, 2021

dnsMonitoring will be disabled, since host name resolution is always executed in config check scheduler. Next release will compare resolved ip and not host name as before to detect master change.

0reactions
manjeetsingh87commented, Aug 11, 2021

Thank you

I had one more question regarding this change.

Will the dnsMonitoring feature be available for replicated mode in the next release ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

2. Configuration · redisson/redisson Wiki - GitHub
Redisson idle connections are remain for elected slave as master. Because this node remains in slave connection pool but in non-active state. These...
Read more >
Redis multi master proof of concept (instead of cluster ...
The concept was multi master async replication. Initial tests seem to work quite well, with pretty decent performance. Node1, Node2, Node3.
Read more >
Redisson tries to connect to internal redis IP instead of floating ...
1 Answer 1 ... In cluster mode you don't need to specify all Redis nodes. Only one node is required. Redisson fetches cluster...
Read more >
High availability with Redis Sentinel
Since each master set has a different name, Sentinel can monitor different sets of masters and replicas at the same time. The quorum...
Read more >
Freshworks - SEC.gov
In the business software world, companies are struggling with multiple tools for sales, marketing, customer support across multiple channels, bots, and much ...
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