Today I start the spring boot project in MacBook Pro with M1 pro(with 8 performance core and 2 efficient core), shows error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonClient' defined in class path resource [misc/redisson/RedissonConfig.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 10 of 24 were initialized. Redis server: cruise-redis-master.reddwarf-cache.svc.cluster.local/10.108.202.100:6379 at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.19.jar:5.3.19] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.19.jar:5.3.19] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.19.jar:5.3.19] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.19.jar:5.3.19] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.19.jar:5.3.19] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.19.jar:5.3.19] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.19.jar:5.3.19]
the remote redis was a single redis master server with 2 slaves. my redission config look like this:
package misc.redisson;import org.redisson.Redisson;import org.redisson.api.RedissonClient;import org.redisson.config.Config;import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;/** * @author dolphin * @version 1.0 * @date: 2020/9/5 9:50 */@Configurationpublic class RedissonConfig { @Value(value = "${spring.redis.host}") private String redisHost; @Value(value = "${spring.redis.port:6379}") private Integer redisPort; @Value(value = "${spring.redis.timeout:2000}") private Integer redisTimeOut; @Value(value = "${spring.redis.password}") private String redisPwd; @Bean(name = "redissonClient") public RedissonClient redissonClient() { Config config = new Config(); config.useSingleServer() .setAddress("redis://" + redisHost +":" + redisPort) .setPassword(redisPwd) .setTimeout(redisTimeOut) .setDatabase(1); RedissonClient redissonClient = Redisson.create(config); return redissonClient; }}
and the redis server(2Core and 8GB memory in the cloud) max client config:
connected_clients120cluster_connections0maxclients10000
the remote server was a single kubernetes node, and connected local machine and remote server by telepresence. why did this happen? what should I do to fixed this problem?