0

I'm using Redisson with below configuration to connect to Sentinel servers:

Config config = new Config();
config.useSentinelServers().setMasterName("local")
            .addSentinelAddress("redis://localhost:26379", "redis://localhost:26380", "redis://localhost:26381");
RedissonClient client = Redisson.create(config);

How ever when I run this code I get the below error creating the client:

Caused by: java.lang.IllegalArgumentException: port out of range:-1
    at java.net.InetSocketAddress.checkPort(InetSocketAddress.java:143)
    at java.net.InetSocketAddress.<init>(InetSocketAddress.java:224)
    at org.redisson.client.RedisClient.<init>(RedisClient.java:105)
    at org.redisson.connection.MasterSlaveConnectionManager.createClient(MasterSlaveConnectionManager.java:354)
    at org.redisson.connection.SentinelConnectionManager.<init>(SentinelConnectionManager.java:74)
    at org.redisson.config.ConfigSupport.createConnectionManager(ConfigSupport.java:258)
    at org.redisson.Redisson.<init>(Redisson.java:115)
    at org.redisson.Redisson.create(Redisson.java:154)

I wanted to know if I'm missing any thing in the redisson config or my sentinel servers are not configured well.

Madhav Maddi
  • 1
  • 1
  • 1

2 Answers2

1

Apologies for the confusion I have caused in editing the wiki. I should have stated that was in reflection to the latest version.

From 2.9.3 and 3.4.3 above, we have introduced the support for SSL, it is then required to specify the URI scheme to inform the type of connection that is requires.

Redisson_RuiGu
  • 1,012
  • 10
  • 13
0

It is working now if I change the original configuration as below:

Config config = new Config();
config.useSentinelServers().setMasterName("local")
            .addSentinelAddress("localhost:26379", "localhost:26380", "localhost:26381");
RedissonClient client = Redisson.create(config);

It is misleading in the documentation as it does suggests otherwise. https://github.com/redisson/redisson/wiki/2.-Configuration#271-sentinel-settings

Madhav Maddi
  • 1
  • 1
  • 1