ShivRaj Nag
ShivRaj Nag

Reputation: 13

Redisson cluster configuration when set of Master servers are down

I have Redisson cluster configuration below in yaml file,

subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 50
slaveConnectionMinimumIdleSize: 32
slaveConnectionPoolSize: 64
masterConnectionMinimumIdleSize: 32
masterConnectionPoolSize: 64
readMode: "SLAVE"
subscriptionMode: "SLAVE"
nodeAddresses:
- "redis://X.X.X.X:6379"
- "redis://Y.Y.Y.Y:6379"
- "redis://Z.Z.Z.Z:6379" 

I understand it is enough to give one of master node ip address in the configuration and Redisson automatically identifies all the nodes in the cluster, but my questions are below,

1 Are all nodes identified at the boot of the application and used for future connections?

2 what if one of the master node goes down, when the application is running, the request to the particular master will fail and the redisson api automatically tries contacting the other nodes(master) or does it try to connect to same master node repeatedly and fail?

3 Is it a best practice to give DNS instead of server ip's?

Upvotes: 1

Views: 2746

Answers (1)

Nikita Koksharov
Nikita Koksharov

Reputation: 10783

Answering to your questions:

  1. That's correct, all nodes are identified at the boot process. If you use Config.readMode = MASTER_SLAVE or SLAVE (which is default) then all nodes will be used. If you use Config.readMode = MASTER then only master node is used.

  2. Redisson tries to reach master node until the moment of Redis topology update. Till that moment it doesn't have information about elected new master node.

  3. Cloud services like AWS Elasticache and Azure Cache provides single hostname bounded to multiple ip addresses.

Upvotes: 0

Related Questions