0

AWS Elasticache currently does not allow IP-range based access control. Therefore I don't know how to connect AWS ElastiCache cluster to Redsmin Redis GUI.

FGRibreau
  • 7,021
  • 2
  • 39
  • 48

1 Answers1

0

To connect your AWS ElastiCache cluster to Redsmin you will need to add two IPTables rules to one of your EC2 instance so it will be able to act as a proxy.

There are two scenario:

1 - If you have an EC2 instance in the same subnet as your Redis Elasticache

Note:

  • This will only work if the EC2 instance you connect to is in the same subnet as your Elasticache Redis instance.
  • The following example will state that your Elasticache private IP is 172.31.5.13 and is running on port 6379.
  • The following example will state that your EC2 private IP is 172.31.5.14 and its public IP is 52.50.145.87.

Now:

  • Connect to your EC2 instance through SSH
  • Then run (don't forget to change 172.31.5.13:6379 by the ElastiCache IP and port number):

sudo iptables -t nat -A PREROUTING -p tcp --dport 6379 -j DNAT --to-destination 172.31.5.13:6379

  • Then:

run:sudo iptables -t nat -A POSTROUTING -p tcp -d 172.31.5.13 --dport 6379 -j SNAT --to-source 172.31.5.14

  • sudo service iptables save

  • Again don't forget to change 172.31.5.14 with your local EC2 server private IP. Same goes for 172.31.5.13 and 6379, replace them your Elasticache IP and port number.

  • Add a rule in the security group to allow inbound request from Redsmin IP 62.210.222.165, protocol=TCP, port=6379

  • Add a new Direct Server in Redsmin with the connection string: redis://52.50.145.87:6379, done!

If you have any issue or questions with the above steps, don't hesitate, contact us, we are happy to help!

2 - If you don't have an EC2 instance in the same subnet as your Redis ElastiCache

Follow this Amazon tutorial to setup a NAT instance, be sure to setup it on the same subnet as your ElastiCache server. Now follow the steps from the section above.

FGRibreau
  • 7,021
  • 2
  • 39
  • 48
  • When running 'service iptables save', I get this error. Any ideas what is causing this? "The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl." – mliu Apr 25 '19 at 10:28
  • It was an issue with the AWS AMI I was using. I used a different one that had iptables installed. – mliu Apr 27 '19 at 02:18