question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RedisConnectionException: Unable to init enough connections amount

See original GitHub issue

项目启动时有时候成功有时候失败,各占一半 项目启动报错:

2022-07-13 15:14:57.132 [main] INFO  org.redisson.Version - Redisson 3.16.3
2022-07-13 15:14:57.594 [main] INFO  org.redisson.cluster.ClusterConnectionManager - Redis cluster nodes configuration got from **.**.**.**/**.**.**.**:6379:
d148f0c1b019ecd8b15bf207d3ef188737111708 **.**.**.**:6381@16381 slave 2a3da9cbc3360a6be187477e12d38601c8f7f825 0 1657696489390 27 connected
99497eadb64dee7e6328a0ed0cb948094f5aa1e9 **.**.**.**:6383@16383 slave f564ccc551dd3378658fef692f766b18d624a369 0 1657696489000 28 connected
2a3da9cbc3360a6be187477e12d38601c8f7f825 **.**.**.**:6384@16384 master - 0 1657696489000 27 connected 5461-10922
ac94323e413fb99e7ee8a8dcb8fc075300d505e6 **.**.**.**:6380@16380 master - 0 1657696490393 25 connected 10923-16383
f564ccc551dd3378658fef692f766b18d624a369 **.**.**.**:6382@16382 master - 0 1657696488000 28 connected 0-5460
b24b326be748f470e1871ba09135396362cf110e **.**.**.**:6379@16379 myself,slave ac94323e413fb99e7ee8a8dcb8fc075300d505e6 0 1657696487000 24 connected

2022-07-13 15:15:23.837 [redisson-netty-2-2] INFO  o.r.connection.pool.MasterPubSubConnectionPool - 1 connections initialized for **.**.**.**/**.**.**.**:6382
2022-07-13 15:15:24.280 [redisson-netty-2-18] INFO  o.r.connection.pool.MasterPubSubConnectionPool - 1 connections initialized for **.**.**.**/**.**.**.**:6384
2022-07-13 15:15:24.503 [redisson-netty-2-26] INFO  o.r.connection.pool.MasterPubSubConnectionPool - 1 connections initialized for **.**.**.**/**.**.**.**:6380
2022-07-13 15:15:26.883 [redisson-netty-2-22] ERROR org.redisson.cluster.ClusterConnectionManager - Can't add master: redis://**.**.**.**:6380 for slot ranges: [[10923-16383]]
org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 20 of 24 were initialized. Redis server: **.**.**.**/**.**.**.**:6380
at org.redisson.connection.pool.ConnectionPool$1.lambda$run$0(ConnectionPool.java:158)
at org.redisson.misc.RedissonPromise.lambda$onComplete$0(RedissonPromise.java:183)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:551)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490)
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615)
at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:608)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
at org.redisson.misc.RedissonPromise.tryFailure(RedissonPromise.java:96)
    at org.redisson.misc.RedissonPromise.tryFailure(RedissonPromise.java:96)
    at org.redisson.client.RedisClient$2$1.run(RedisClient.java:242)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: org.redisson.client.RedisTimeoutException: Command execution timeout for command: (AUTH), params: (password masked), Redis client: [addr=redis://**.**.**.**:6380]
    at org.redisson.client.RedisConnection.lambda$async$1(RedisConnection.java:255)
    at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:672)
    at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:747)
    at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:472)
    ... 2 common frames omitted
    2022-07-13 15:15:26.885 [redisson-netty-2-2] INFO  org.redisson.connection.pool.MasterConnectionPool - 24 connections initialized for **.**.**.**/**.**.**.**:6384
    2022-07-13 15:15:27.092 [redisson-netty-2-12] INFO  org.redisson.connection.pool.MasterConnectionPool - 24 connections initialized for **.**.**.**/**.**.**.**:6382
    2022-07-13 15:15:27.348 [redisson-netty-2-21] INFO  org.redisson.connection.pool.PubSubConnectionPool - 1 connections initialized for **.**.**.**/**.**.**.**:6381
    2022-07-13 15:15:27.522 [redisson-netty-2-17] INFO  org.redisson.connection.pool.PubSubConnectionPool - 1 connections initialized for **.**.**.**/**.**.**.**:6383

配置如下

 @Bean(destroyMethod = "shutdown")
    public RedissonClient redisson() throws IOException {
        Config config = null;
        Method clusterMethod = ReflectionUtils.findMethod(RedisProperties.class, "getCluster");
        Method timeoutMethod = ReflectionUtils.findMethod(RedisProperties.class, "getTimeout");
        Object timeoutValue = ReflectionUtils.invokeMethod(timeoutMethod, redisProperties);
        int timeout;
        if (null == timeoutValue) {
            timeout = 10000;
        } else if (!(timeoutValue instanceof Integer)) {
            Method millisMethod = ReflectionUtils.findMethod(timeoutValue.getClass(), "toMillis");
            timeout = ((Long) ReflectionUtils.invokeMethod(millisMethod, timeoutValue)).intValue();
        } else {
            timeout = (Integer) timeoutValue;
        }
        Object clusterObject = ReflectionUtils.invokeMethod(clusterMethod, redisProperties);
        Method nodesMethod = ReflectionUtils.findMethod(clusterObject.getClass(), "getNodes");
        List<String> nodesObject = (List) ReflectionUtils.invokeMethod(nodesMethod, clusterObject);
        String[] nodes = convert(nodesObject);    
        config = new Config();
        ClusterServersConfig clusterServersConfig = config.setCodec(JsonJacksonCodec.INSTANCE).useClusterServers();
        if (!SpringUtil.getBean(RedisKeyConcatComponent.class).isProdOrUat()) {
            clusterServersConfig.setNameMapper(new CustomNameMapper());
        }
        clusterServersConfig
                .addNodeAddress(nodes)
                .setConnectTimeout(timeout)
                .setPassword(redisProperties.getPassword());
        return Redisson.create(config);
    }

/** * 集群模式下优先加载RedissonConfig ,加载lettuceConfig 集群下redis key过期监听失败 */
@Bean
@Order(Ordered.LOWEST_PRECEDENCE - 3)
public RedissonConnectionFactory redissonConnectionFactory(RedissonClient redisson) {   
 return new RedissonConnectionFactory(redisson);
}
    static class CustomNameMapper implements NameMapper {
        @Override
        public String map(String name) {
            return SpringUtil.getBean(RedisKeyConcatComponent.class).concatProfilePrefix(name);
        }
        ...
    }

yml配置:

spring:
  redis:
    cluster: #集群用这个配置
      nodes: ${summary.redis.cluster.nodes}
      max-redirects: 2 #获取失败 最大重定向次数
    password: ${summary.redis.cluster.password}
    timeout: 60000
    database: 0
    lettuce:
      pool:
        max-active: 10 # 连接池最大连接数(使用负值表示没有限制),如果赋值为-1,则表示不限制;如果pool已经分配了maxActive个jedis实例,则此时pool的状态为exhausted(耗尽)
        max-idle: 8   # 连接池中的最大空闲连接 ,默认值也是8
        max-wait: 100 # # 等待可用连接的最大时间,单位毫秒,默认值为-1,表示永不超时。如果超过等待时间,则直接抛出JedisConnectionException  
        min-idle: 2    # 连接池中的最小空闲连接 ,默认值也是0
      shutdown-timeout: 100ms

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
CRIOCMcommented, Jul 28, 2022

hello ,doesn’t fix the issue anymore.

2022-07-28 17:12:28.257 ERROR [xxxxxx,,,] 6697 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'distributedLock': Unsatisfied dependency expressed through field 'redissonClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonClient' defined in class path resource [com/********/***/autoconfig/cache/***CacheAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: **.***.***.***/**.***.***.***:6379
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:598)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:376)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
	at com.********.meepo.outbound.MeepoOutboundApplication.main(MeepoOutboundApplication.java:31)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonClient' defined in class path resource [com/********/***/autoconfig/cache/***CacheAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: **.***.***.***/**.***.***.***:6379
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1255)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1175)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:595)
	... 18 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: **.***.***.***/**.***.***.***:6379
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
	... 31 common frames omitted
Caused by: org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: **.***.***.***/**.***.***.***:6379
	at org.redisson.connection.pool.ConnectionPool.lambda$createConnection$1(ConnectionPool.java:150)
	at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
	at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
	at org.redisson.connection.pool.ConnectionPool.promiseFailure(ConnectionPool.java:307)
	at org.redisson.connection.pool.ConnectionPool.lambda$createConnection$6(ConnectionPool.java:273)
	at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
	at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
	at org.redisson.client.RedisClient$1$2.run(RedisClient.java:235)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:174)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:167)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.CompletionException: io.netty.channel.ConnectTimeoutException: connection timed out: **.***.***.***/**.***.***.***:6379
	at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326)
	at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:338)
	at java.util.concurrent.CompletableFuture.uniRelay(CompletableFuture.java:911)
	at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:899)
	... 13 common frames omitted
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: **.***.***.***/**.***.***.***:6379
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170)
	... 10 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:XXX', transport: 'socket'

Process finished with exit code 1

use 3.17.3+ version

image

0reactions
qq502361472commented, Aug 10, 2022

不好意思 没看到邮件 没解决呢 我们公司用的redisson 现在很多人都有这个问题 ------------------ 原始邮件 ------------------ 发件人: “redisson/redisson” @.>; 发送时间: 2022年7月29日(星期五) 下午4:07 @.>; @.@.>; 主题: Re: [redisson/redisson] RedisConnectionException: Unable to init enough connections amount (Issue #4414) hello ,doesn’t fix the issue anymore. 2022-07-28 17:12:28.257 ERROR [xxxxxx,] 6697 — [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘distributedLock’: Unsatisfied dependency expressed through field ‘redissonClient’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘redissonClient’ defined in class path resource [com///autoconfig/cache/CacheAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method ‘redissonClient’ threw exception; nested exception is org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: .../...:6379 at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:598) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:376) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) at com..meepo.outbound.MeepoOutboundApplication.main(MeepoOutboundApplication.java:31) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘redissonClient’ defined in class path resource [com///autoconfig/cache/CacheAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method ‘redissonClient’ threw exception; nested exception is org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: .../...:6379 at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1255) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1175) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:595) … 18 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method ‘redissonClient’ threw exception; nested exception is org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: .../...:6379 at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) … 31 common frames omitted Caused by: org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 1 of 24 were initialized. Redis server: .../...:6379 at org.redisson.connection.pool.ConnectionPool.lambda$createConnection$1(ConnectionPool.java:150) at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760) at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) at org.redisson.connection.pool.ConnectionPool.promiseFailure(ConnectionPool.java:307) at org.redisson.connection.pool.ConnectionPool.lambda$createConnection$6(ConnectionPool.java:273) at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760) at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) at org.redisson.client.RedisClient$1$2.run(RedisClient.java:235) at io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:174) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:167) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) Caused by: java.util.concurrent.CompletionException: io.netty.channel.ConnectTimeoutException: connection timed out: .../...:6379 at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326) at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:338) at java.util.concurrent.CompletableFuture.uniRelay(CompletableFuture.java:911) at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:899) … 13 common frames omitted Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: .../...:6379 at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261) at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) … 10 common frames omitted Disconnected from the target VM, address: ‘127.0.0.1:XXX’, transport: ‘socket’ Process finished with exit code 1 use 3.17.3+ version 你的问题解决了吗?可以教我一下怎么解决吗,再解决不了准备不用redisson了 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.*>

我们也是,官方回复是网络问题。我这里降低了idel出现错误的概率降低了很多。还有修改redis服务端的tcp的keepalive时间短一点。都是会稍微好一些,还是偶尔会报错。崩溃了

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Unable to init enough connections" when ... - GitHub
The problem you are having is caused by redisson is unable to execute a command that's required as part of the connection initialisation...
Read more >
Unable to init enough connections amount - Stack Overflow
Today I start the spring boot project in MacBook Pro with M1 pro(with 8 performance core and 2 efficient core), shows error:
Read more >
org.redisson.client.RedisConnectionException.<init> java ...
Throwable cause = new RedisConnectionException( "Unable to init enough connections amount! Only " + totalInitializedConnections + " from " + minimumIdleSize ...
Read more >
org.redisson.connection.pool.ConnectionPool Maven / Gradle ...
RedisConnectionException; import org.redisson.client.protocol. ... getAddr(); } else { errorMsg = "Unable to init enough connections amount!
Read more >
Unable to init enough connections amount! Only 20 of 24 were ...
RedisConnectionException: Unable to init enough connections amount Only 23 from 32 were initialized. Exception in thread "main" org.redisson. ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found