Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting io.vertx.core.impl.NoStackTraceThrowable: Cannot connect to any of the provided endpoints Error while trying to connect to redis in replication mode #401

Open
vasusethia1 opened this issue Jul 26, 2023 · 4 comments
Labels

Comments

@vasusethia1
Copy link

vasusethia1 commented Jul 26, 2023

Version

I am facing issue for the redis version 4.4.0

Context

Getting io.vertx.core.impl.NoStackTraceThrowable: Cannot connect to any of the provided endpoints Error while trying to connect to redis in replication mode. I am defining a bean to return RedisApi. I am using aws redis

This is how I have configured my redis options

@Bean
public RedisAPI redisAPI() throws IOException {
		if(System.getenv("environment").equals("prod")){
			ConfigConstants.APPLICATION_JSON_PATH = "conf/application-prod.json";
		}
		if(configuration == null) configuration = new JsonObject(new String(Files.readAllBytes(Paths.get(ConfigConstants.APPLICATION_JSON_PATH))));
		List<String> serverList = (List<String>) configuration.getJsonObject("redisServer").getJsonArray("serverList")
				.getList();

		RedisOptions redisOptions = new RedisOptions()
				.setType(RedisClientType.REPLICATION)
				.setMaxWaitingHandlers(32)
				.addConnectionString("redis://ip.ng.0001.aps1.cache.amazonaws.com:6379")
				.addConnectionString("redis://ip2reader.ng.0001.aps1.cache.amazonaws.com:6379");

		Redis redisClient = Redis.createClient(vertx, redisOptions);
		return RedisAPI.api(redisClient);
	}
@vietj
Copy link
Contributor

vietj commented Jul 26, 2023

why are the connection string twice the same value ?

@vasusethia1
Copy link
Author

Hi, by mistake I did that while editing my issue, but in reality those are the different connection strings, I have changed the value for the same

@colinchilds
Copy link

colinchilds commented Aug 15, 2023

I'm running into the same issue trying to connect to an Elasticache cluster (cluster mode disabled) with one master and one slave. I was hoping to leverage the slave for reads.

@colinchilds
Copy link

I believe my issue was actually that Elasticache requires SSL, so I changed the scheme to rediss:// and now it's working for me. It looks like you may be making the same mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants