Search code examples
javaredisredis-clusterredisson

Redisson ERR command is not allowed


While connecting to Redis using Redisson (3.23.4) getting following error:

Caused by: org.redisson.client.RedisException: ERR command is not allowed. channel: [id: 0x7ecad0a8, L:/Redis_IP:51736 - R:Redis_IP/Redis_IP:15000] command: (CLUSTER NODES), promise: java.util.concurrent.CompletableFuture@4b777e86[Not completed, 1 dependents], params: []
    at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:381)
    at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:205)
    at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
    at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)

Redisson config is following:

config.useClusterServers()
                .addNodeAddress("rediss://" + redisHost + ":" + redisPort)
                .setUsername(UserName)
                .setPassword(redisPassword)
                .setKeepAlive(true)
                .setRetryAttempts(3)
                .setRetryInterval(3000)
                .setConnectTimeout(15000)
                .setIdleConnectionTimeout(30000)
                .setScanInterval(1000)
                .setPingConnectionInterval(60000)
                .setSslEnableEndpointIdentification(true);

Code works fine when connecting to Single Redis node using "useSingleServer"

Redis cluster has single entry point and internally has Master Slave where data is synced between the Nodes.


Solution

  • "useSingleServer" should be used as Redis Enterprise is configired in such away, even with multi-node Redis cluster, End-point behaves same as single node.