2

Im trying to configure my java application to connect to a redis cluster using Redisson. Following is my redisson client config:

Config config = new Config();
    config.useClusterServers()
            .addNodeAddress("redis://IP:6379", "redis://IP:6379", "redis://IP:6379");
    RedissonClient redisClient = Redisson.create(config);
    redisClient.getRemoteService();

** I have also tried by specifying only 1 ip in the above config. The redis cluster is deployed on docker with the following config (6 node clsuter-- 3master 3slave) :

port 6379
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes
protected-mode no
bind <NODE_IP>

** Have also tried without protected-mode and bind However I always face the following exception :

WARN org.redisson.cluster.ClusterConnectionManager - connection timed out: IP/IP:6379|#]

I tried connecting using redis-cli to the my redis nodes from the deployment server and the connection was successful

Redisson version : 3.13.2 Redis image : redis:6

Im not very sure where am I going wrong and would appreciate some help

Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
glitch99
  • 264
  • 2
  • 7
  • Looks like a networking issue, connection time out typically indicates that the host can be reached but the requested port is not open and/or a firewall is configured to ignore (not reject) incoming packets on not specifically allowed ports. – Danilo Tommasina Jul 30 '20 at 08:48
  • 2
    @DaniloTommasina thank you for your reply. I tried connecting from my java application node to the redis node using redis-cli-- it was successful Also, The application is able to connect to a standalone redis deployment – glitch99 Jul 30 '20 at 09:01
  • I'm not familiar with redis, but I see in your connection string you are using rediss (with a double s) is that a 'secure protocol' version of redis protocol? If it is, then it might be some issue with certificates, if it isn't then it's a typo :) – Danilo Tommasina Jul 30 '20 at 09:32
  • Soo incase of an ssl connection the connection string needs to have the double 's'. I have tried both though :p – glitch99 Jul 30 '20 at 09:37
  • I will remove the 's' to avoid confusion – glitch99 Jul 30 '20 at 09:38

0 Answers0