Connecting to AWS ElastiCache Redis in cluster mode behind NAT
See original GitHub issue### Expected behavior I want to be able to use Redisson when Redis Cluster is behind NAT. I can think of following solutions:
- Disable auto discovery and use ElastiCache Management Nodes for all request (prefered approach recommendation in aws doc).
- Disabling auto discovery by manually registering all nodes in Redisson.
- Provide customer provide DNS mapping
I am using AWS ElastiCache Redis in cluster mode where AWS creates a management endpoint for whole cluster and separate endpoint for each master node. My whole cluster is behind NAT, so when Redisson tries to discover all the nodes in the cluster it find their local IP not the NAT IP, as a result it fails to connect to clustered nodes.
Actual behavior
Redisson discovers all the nodes in the clusters and tries to connect to them. However it fails because those IP/endpoints are behind NAT.
Steps to reproduce or test case
Create an AWS ElastiCache Redis stack in cluster mode. Create a NAT on top of it and try to connect to the NATed cluster.
Redis version
3.2.10
Redisson version
3.6.5
Redisson configuration
config.useReplicatedServers().addNodeAddress("Cluster Management Endpoint)
.setConnectTimeout(500)
.setMasterConnectionPoolSize(20)
.setReadMode(ReadMode.MASTER);
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Amazon ElastiCache for Redis - AWS Documentation
Accessing an ElastiCache Cluster when it and the Amazon EC2 Instance are in the Same Amazon VPC. The most common use case is...
Read more >Step 4: Connect to the cluster's node - Amazon ElastiCache ...
Log in to an Amazon EC2 instance and connect to a node in the cache cluster.
Read more >Understanding ElastiCache and Amazon VPCs
You can launch an ElastiCache cluster in the subnet. The cache nodes have private IP addresses from the subnet's range of addresses. You...
Read more >Troubleshoot connecting to an ElastiCache for Redis cluster
Verify TCP connectivity between the client and Redis · Security groups must allow outgoing connections to the cluster's IP and port. · Routing ......
Read more >How to work with Cluster Mode on Amazon ElastiCache for ...
ElastiCache allows you to quickly and easily launch a new Redis cluster using the AWS Management Console, CLI, or SDKs. Here, we'll launch...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Based on the redis document, NAT is currently not supported in cluster mode.
https://redis.io/topics/cluster-tutorial#redis-cluster-and-docker
@soheil-jazayeri I also encountered the same problem,How do you solve this issue? thanks