3
我们试图使用使用Jedis lib在本地运行的Java客户端访问de ElasticCache(Redis)。我们可以按照步骤here在本地使用redis-cli访问redis。无法使用Jedis Lib在aws上本地连接到ElasticCache集群
问题是,当我们尝试使用Jedis lib连接到aws Redis时,NAT公共地址正在被转换为redis专用IP以计算插槽(initializeSlotsCache)。我们无法找到禁用此功能的方法。有没有解决方法?
下面我们连线了如何使用Jedis:
factory = new JedisConnectionFactory(new RedisClusterConfiguration(this.clusterProperties.getNodes()));
factory.setUsePool(true);
factory.setPoolConfig(this.jedisPoolConfig());
factory.afterPropertiesSet();
return factory;
我们使用NAT映射IPS每个节点。但是Jedis lib将私有ips保存在缓存中,因此我们得到以下例外:
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
任何建议都会很棒!我们没有选择。先谢谢你。