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

Unable to add/change master node #5879

Closed
runnerFeng opened this issue May 17, 2024 · 1 comment
Closed

Unable to add/change master node #5879

runnerFeng opened this issue May 17, 2024 · 1 comment
Labels

Comments

@runnerFeng
Copy link

runnerFeng commented May 17, 2024

ERROR [redisson-netty-1-54] o.r.c.ClusterConnectionManager Unable to add/change master node
java.util.concurrent.CompletionException: org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 14 of 24 were initialized. Redis server: xxx/xxx:6379
at org.redisson.connection.ConnectionsHolder.lambda$createConnection$2(ConnectionsHolder.java:166) ~[redisson-3.29.0.jar!/:3.29.0]
at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930) ~[?:?]
at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907) ~[?:?]
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) ~[?:?]
at org.redisson.connection.ConnectionsHolder.lambda$createConnection$5(ConnectionsHolder.java:179) ~[redisson-3.29.0.jar!/:3.29.0]
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) ~[?:?]
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837) ~[?:?]
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) ~[?:?]
at org.redisson.client.RedisClient$1$1.run(RedisClient.java:295) ~[redisson-3.29.0.jar!/:3.29.0]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[netty-transport-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 14 of 24 were initialized. Redis server: xxx/xxx:6379
at org.redisson.connection.ConnectionsHolder.lambda$createConnection$2(ConnectionsHolder.java:165) ~[redisson-3.29.0.jar!/:3.29.0]
... 18 more
Caused by: java.util.concurrent.CompletionException: io.netty.handler.ssl.SslHandshakeTimeoutException: handshake timed out after 10000ms
at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:367) ~[?:?]
at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:376) ~[?:?]
at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:1019) ~[?:?]
... 11 more
Caused by: io.netty.handler.ssl.SslHandshakeTimeoutException: handshake timed out after 10000ms
at io.netty.handler.ssl.SslHandler$7.run(SslHandler.java:2125) ~[netty-handler-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566) ~[netty-transport-4.1.92.Final.jar!/:4.1.92.Final]
... 4 more
2024-05-17 03:23:23,061 ERROR [redisson-timer-4-1] o.r.c.h.PingConnectionHandler Unable to send PING command over channel: [id: 0x31a77dd8, L:/10.88.148.224:34138 - R:xxx/xxx:6379]
org.redisson.client.RedisTimeoutException: Command execution timeout for command: (PING), params: [], Redis client: [addr=rediss://xxx:6379]
at org.redisson.client.RedisConnection.lambda$async$0(RedisConnection.java:253) ~[redisson-3.29.0.jar!/:3.29.0]
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTimer.java:715) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:34) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:703) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:790) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503) ~[netty-common-4.1.92.Final.jar!/:4.1.92.Final]

my config class:

   `@Bean
    public RedissonClient redissonClient() {
        String protocol = ssl ? "rediss" : "redis";
        Config config = new Config();
        config.setCodec(new JsonJacksonCodec());
        /**
         * https://github.com/redisson/redisson/issues/5726
         * https://github.com/redisson/redisson/wiki/16.-FAQ#q-what-is-the-cause-of-redistimeoutexception
         */
        config.setAddressResolverGroupFactory(new SequentialDnsAddressResolverFactory(2));
        config.setNettyThreads(128);
        if (!ObjectUtils.isEmpty(clusterNodes)) {
            String[] nodesStr = clusterNodes.split(",");
            for (String nodeStr : nodesStr) {
                String address = String.format("%s://%s", protocol, nodeStr);
                config.useClusterServers()
                        .addNodeAddress(address)
                        .setPassword(password)
                        .setPingConnectionInterval(45000)
                        .setTimeout(5000)
                        .setRetryInterval(5000);
            }
        } else {
            config.useSingleServer()
                    .setAddress(String.format("%s://%s:%s", protocol, host, port))
                    .setPassword(password)
                    .setDatabase(database);
        }
        return Redisson.create(config);
}`

Does my configuration need to be adjusted?

@mrniko
Copy link
Member

mrniko commented May 17, 2024

Unable to init enough connections amount! Only 14 of 24 were initialized

It seems like you have a connections amount limit on Redis side. You need to reduce this amount try to set connection pool size to 14.

@mrniko mrniko closed this as completed Jun 6, 2024
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

2 participants