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.

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:

  1. Disable auto discovery and use ElastiCache Management Nodes for all request (prefered approach recommendation in aws doc).
  2. Disabling auto discovery by manually registering all nodes in Redisson.
  3. 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:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jackyguruicommented, Jul 16, 2018

Based on the redis document, NAT is currently not supported in cluster mode.

https://redis.io/topics/cluster-tutorial#redis-cluster-and-docker

0reactions
sailsgocommented, May 14, 2019

@soheil-jazayeri I also encountered the same problem,How do you solve this issue? thanks

Read more comments on GitHub >

github_iconTop 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 >

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