Redisson: Can't create SentinelServersConfig using ip:port configuration

Created on 29 Aug 2017  路  3Comments  路  Source: redisson/redisson

Hello, I'm trying to use redisson 3.5.0 with the same settings where I previously used 3.4.1. However, the steps below don't work anymore.

SentinelServersConfig sentinelConfig = config.useSentinelServers();
sentinelConfig.addSentinelAddress("10.10.10.0:16380");

This code results in the following error messages:
Caused by: java.lang.IllegalArgumentException: Illegal character in scheme name at index 0: 10.10.10.0:16380
at java.net.URI.create(URI.java:852)
at org.redisson.misc.URIBuilder.create(URIBuilder.java:27)
at org.redisson.config.SentinelServersConfig.addSentinelAddress(SentinelServersConfig.java:71)

Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 0: 10.10.10.0:16380
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.checkChar(URI.java:3031)
at java.net.URI$Parser.parse(URI.java:3047)
at java.net.URI.(URI.java:588)
at java.net.URI.create(URI.java:850)

Most helpful comment

@aosti try sentinelConfig.addSentinelAddress("redis://10.10.10.0:16380");

All 3 comments

@aosti try sentinelConfig.addSentinelAddress("redis://10.10.10.0:16380");

@johnou, it worked!

Thank you!

@aosti fyi depending on your requirements rediss:// (secure redis protocol) should also work with a little extra work.

Was this page helpful?
0 / 5 - 0 ratings