大网数据广告活动
服务器运维问答

Redis GUI needed for AWS ElastiCache on an EC2 instance

· 52CE 我爱测

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 clust…

问题原文

原帖链接 · Kanuj Bhatnagar · CC BY-SA 3.0

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?

已采纳解答

原帖链接 · FGRibreau · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-07-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。