I am trying to connect to redis sentinel using JedisSentinelPool
private static final JedisSentinelPool pool = new JedisSentinelPool("mymaster", getSentinels());
private static Set<String> getSentinels(){
Set<String> mysentinels = new HashSet<>();
mysentinels.add(new HostAndPort("localhost", 26379).toString());
return mysentinels;
}
This gives me following error :
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: All sentinels down, cannot determine where is mymaster master is running...
However, I can see that my sentinel is running. So referring to this post: https://github.com/luin/ioredis/issues/64 I tried the below command on my redis master server
./redis-cli -h redis-1 -p 26379
I got following error:
Could not connect to Redis at redis-1:26379: nodename nor servname provided, or not known
What is the issue here?