2

I've a AWS ElastiCache Redis cluster setup that I wish to manage. Since AWS doesn't let you access ElastiCache outside the VPC, I've setup a micro EC2 instance that carried a copy of the phpRedisAdmin script pointed to this cluster. But AWS has disabled the 'CONFIG' command on the Redis cluster so phpRedisAdmin can't connect and manage the ElastiCache cluster.

I've tried the redis-browser node package but it runs on 0.0.0.0:4567 and I'll need a public IP on this instance to manage the Redis cluster.

Any sugggestions?

4

You may want to give a try to Redsmin.

If you have an EC2 instance in the same subnet as your Redis ElasticCache

Note:

  • This will only work if the EC2 instance you connect to is in the same subnet as your ElasticCache 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 let's do this step by step:

  • Connect to this EC2 instance through SSH
  • run sudo iptables -t nat -A PREROUTING -p tcp --dport 6379 -j DNAT --to-destination 172.31.5.13:6379 don't forget to change your IPs and maybe even the port number
  • run sudo iptables -t nat -A POSTROUTING -p tcp -d 172.31.5.13 --dport 6379 -j SNAT --to-source 172.31.5.14
  • run sudo service iptables save
  • if the previous command did not work, try:

    • on Debian/Ubuntu => iptables-save > /etc/iptables/rules.v4
    • on RHEL/CentOS => iptables-save > /etc/sysconfig/iptables
  • 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 don't have an EC2 instance in the same subnet as your Redis ElasticCache

  • Follow this amazon tutorial to setup a NAT instance, setup it on the same subnet as your ElastiCache server.
  • Now follow the previous section above.

If you simply want to connect Redsmin to an EC2 Redis

  • Add a rule in the security group to allow inbound request from Redsmin IP 62.210.222.165 (don't forget to specify the right port, for instance 6379)
  • Connect your Redis server in Redsmin using the EC2 public IP and the port you opened.
1

I was able to find the ElastiCache private IP by pinging the Primary Endpoint from the EC2 shell.

PING xyz.abc.euw2.cache.amazonaws.com (172.31.xxx.xxx) 56(84) bytes of data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.