0

I made ElasticBeansTalk App on AWS. I couldn't access rds via command console.

mysql -uusername -p -h vegeweldb.xxxx.ap-northeast-1.rds.amazonaws.com
ERROR 2003 (HY000): Can't connect to MySQL server on 'vegeweldb.xxxx.ap-northeast-1.rds.amazonaws.com' (60)

Also, can't access ec2 using ssh.

ssh -i some.pem ec2-user@ec2-xx-xxx-xxx-164.ap-northeast-1.compute.amazonaws.com
Permission denied (publickey).

I made key pair on AWS. I can't figure out why. I'd appreciate if you give some advice.

BTW here's current configuration. enter image description here

Noriaki Takamizawa
  • 719
  • 1
  • 9
  • 21
  • Is your RDS instance in a VPC? Are you trying to access from an EC2 instance? Have you opened the appropriate ports in the RDS db security group? – Karen B Jun 12 '16 at 04:07
  • My RDS is in VPC. I'm now so sure about whether it's right or not. I put the screenshot on AWS. Could you examine it? – Noriaki Takamizawa Jun 12 '16 at 05:13
  • @NoriakiTakamizawa is your EC2 instance in a VPC ? If Yes, have you attached elastic IP or public IP to that EC2 instance? Also, the "some.pem" was the same key that was associated with the EC2 instance ? IF you are not able to SSH to EC2 instance itself, from where are you trying to connect to RDS instance (which is inside VPC)? – Ashish-G Jun 12 '16 at 07:31
  • @Ashish-G Thanks for the comment. I cant either access rds or ec2. ssh -i some.pem ec2-user@ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com ssh: connect to host ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com port 22: Operation timed out Here's the result. If I accessed to ec2, I could reach out rds, maybe. – Noriaki Takamizawa Jun 12 '16 at 07:43
  • @NoriakiTakamizawa ok, you might want to recheck that the VPC setup is correct -- Is the internet gateway (IGW) configured? Is the route table setup from the EC2 subnet to IGW? Is the security group (SG) used by EC2 instance has SSH (tcp/22) open from source 0.0.0.0/0 (_or_ your custom specific source)? – Ashish-G Jun 12 '16 at 08:21
  • @Ashish-G I already checked along with your advice. And I've noticed no keypair is attached to ec2 instance. But I can't figure out how to attach keypair with ec2. Do you know that? – Noriaki Takamizawa Jun 12 '16 at 08:40
  • @NoriakiTakamizawa...oh, thats bit tricky, pls see http://stackoverflow.com/questions/3260739/add-keypair-to-existing-ec2-instance ; BTW, if its just a recent instance setup and/or not in production yet, it might be faster to spin up a new instance with key-pair associated & terminate current one. – Ashish-G Jun 12 '16 at 08:49
  • @Ashish-G I didn't notice assigning key-pair on existing instance. I re-created my instance using beanstalk. Maybe it works. I'll let you know when it turns out. Anyway, thanks again :) – Noriaki Takamizawa Jun 12 '16 at 09:34
  • @NoriakiTakamizawa So when you created the EC2 instance you cannot create it without attaching a key pair to it. – error2007s Jun 12 '16 at 11:42

0 Answers0