Unable to init enough connections amount! Only 4 of 5 were initialized
Author: ferozedCreated Sep 2, 2026Updated Sep 6, 2026
Redis version
7.2.4
Redisson version
4.3.1
Redisson configuration
I am trying to connect to a Valkey server running in Master/Slave mode.
When I try to connect, I am getting the following error:
org.redisson.client.RedisConnectionException: java.util.concurrent.ExecutionException: org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 4 of 5 were initialized. Redis server: valkey/10.96.255.100:6379
at org.redisson.connection.MasterSlaveConnectionManager.doConnect(MasterSlaveConnectionManager.java:255)
at org.redisson.connection.MasterSlaveConnectionManager.connect(MasterSlaveConnectionManager.java:190)
at org.redisson.connection.ConnectionManager.create(ConnectionManager.java:98)
at org.redisson.Redisson.<init>(Redisson.java:76)
at org.redisson.Redisson.create(Redisson.java:119)This is the code:
Config config = new Config();
// need to set RESP3 protocol for near cache behavior
config.setProtocol(Protocol.RESP3);
config.setNettyThreads(64);
String slaveAddress = System.getenv("REDIS_READ_HOST");
if (StringUtils.isBlank(slaveAddress)) {
slaveAddress = redisHost;
}
LOGGER.info("Using Replica mode for valkey");
LOGGER.info(String.format("Connecting to Redis Master at: %s://%s:%s", protocolPrefix, redisHost, port));
LOGGER.info(String.format("Connecting to Redis Slave at: %s://%s:%s", protocolPrefix, slaveAddress, port));
config.useMasterSlaveServers()
.setConnectTimeout(CONNECT_TIMEOUT_MILLIS)
.setTimeout(TIMEOUT_MILLIS)
.setMasterAddress(String.format("%s://%s:%s", protocolPrefix, redisHost, redisPort))
.setMasterConnectionMinimumIdleSize(MASTER_CONNECTION_MINIMUM_IDLE_SIZE)
.setMasterConnectionPoolSize(MASTER_CONNECTION_POOL_SIZE)
.setSlaveConnectionPoolSize(SLAVE_CONNECTION_POOL_SIZE)
.setSlaveConnectionMinimumIdleSize(SLAVE_CONNECTION_MINIMUM_IDLE_SIZE)
.setReadMode(ReadMode.MASTER_SLAVE)
.setSlaveAddresses(Collections.singleton(String.format("%s://%s:%s", protocolPrefix, slaveAddress, redisPort)))
;
this.redissonClient = Redisson.create(config);
this.redissonNearCacheClient = this.redissonClient.getClientSideCaching(ClientSideCachingOptions.defaults());I am using the following endpoints:
valkey ClusterIP 10.96.255.100 <none> 6379/TCP 29d
valkey-headless ClusterIP None <none> 6379/TCP 10d
valkey-metrics ClusterIP 10.96.72.100 <none> 9121/TCP 29d
valkey-read ClusterIP 10.96.245.49 <none> 6379/TCP 10dValkey Info:
redis_version:7.2.4
server_name:valkey
valkey_version:8.1.6
valkey_release_stage:ga
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:4772282777498b2d
server_mode:standalone
os:Linux 5.15.0-322.203.3.5.el9uek.x86_64 x86_64
arch_bits:64What is the Expected behavior?
The connection should succeed.
What is the Actual behavior?
Connection failing with exception:
org.redisson.client.RedisConnectionException: java.util.concurrent.ExecutionException: org.redisson.client.RedisConnectionException: Unable to init enough connections amount! Only 4 of 5 were initialized. Redis server: valkey/10.96.255.100:6379
at org.redisson.connection.MasterSlaveConnectionManager.doConnect(MasterSlaveConnectionManager.java:255)
at org.redisson.connection.MasterSlaveConnectionManager.connect(MasterSlaveConnectionManager.java:190)
at org.redisson.connection.ConnectionManager.create(ConnectionManager.java:98)
at org.redisson.Redisson.<init>(Redisson.java:76)
at org.redisson.Redisson.create(Redisson.java:119)Additional information
I am using the valkey-io/valkey-helm chart. I deployed in replica mode with 6 replicas.
Source: redisson/redisson