I'm studying RDS, and I have a question.
I'm reading in some places that rds relies on the ec2 infrastructure. But I don't understand why, what is the relation with rds and ec2?
I know that after we create an rds instance we can connect to rds instance from a ec2 instance, but what is the other relation?
For example, when we create a RDS instance we need to choose a db intance class, for example "db.t1.micro", but when we create an rds instance we dont create an ec2 instance...
So what I'm thinking is that maybe rds relies on ec2 infrastructure, because when we create an rds instance we are using the same ec2 infrastructure to create an instance but in this case for RDS? Is that it?
Yes you are correct, I think what they are really saying is that RDS instances run on the same infrastructure as the EC2 instances you spinup and use yourself.
When you start an RDS instance, it runs on an EC2 instance, but you have no access to that underlying instance it is controlled and managed by the RDS group/system.
Related
My webpage support multiple webpage instances, and each one of them holds an rds instance in aws. Currently I have 3 rds instances, but I just found out that you can have one rds with multiple db instances using the CREATE DATABASE command.
Because the rds is private, I followed the instructions on aws page to create an ec2 instance to connect to my private rds instance (https://aws.amazon.com/premiumsupport/knowledge-center/rds-connect-ec2-bastion-host). I can connect to the ec2 from my computer, but when I run any command, I dont get anything in return, i.e: aws rds describe-db-instances
Anybody have an idea of what could be wrong?
Thanks!!
One of my AWS EC2 instances would be a better fit for Lightsail (and more cost-effective). Is there a way to create a Lightsail instance based from an EBS snapshot?
It seems that there is the ability to Export Amazon Lightsail snapshots to Amazon EC2, but I couldn't see any capability to go from EC2 to Lightsail.
Looks like you'll need to reload/reconfigure a Lightsail instance from scratch.
We have an AWS account with multiple EC2 instances and an RDS instance. These have been running since before VPCs were introduced. Now I need to upgrade the RDS instance class and the new class can only be established in a VPC. So if our RDS instance is modified (converted) into the new class and the new RDS instance is in a VPC will the EC2 instances that use this RDS need to be moved into the VPC at the same time or can this be a separate process?
RDS and EC2 security groups are not cross-compatible between classic and vpc EC2. If you have an RDS with an EC2 sec group reference you will not be able to add a classic ec2 sec group to your vpc RDS sec group.
Differences Between Security Groups for EC2-Classic and EC2-VPC
Your best bet is to migrate your EC2 infrastructure to VPC along with your RDS. You can of course grant global access to your RDS if you want to separate the process and then lock it back down when you've migrated your EC2 infrastructure but this is a big no no (huge security risk).
This is a non trivial process and I feel your pain. The least complex thing is to incur downtime during migration so that you don't have divergence between RDS instances. But that's not ideal especially when you have a large RDS storage-wise. BTW, you will want to test how long the process takes to snapshot and restore the RDS since it might take a while.
An alternative if you can manage it is to force your app to use read-only replicas while you migrate the RDS. That way your app can still function (kind of) and you won't have to worry about reconciliation between RDS instances post-migration. But obviously your app needs to be aware that it's in read-only mode or you'll end up with erratic behavior.
Forgot to mention there is something called classic-link which might help here but I've personally never used classic-link. Check it out in an AWS whitepaper write up here:
Move Amazon RDS MySQL
Databases to Amazon VPC
using Amazon EC2
ClassicLink and Read
Replicas
Thanks in advance....
we have RDS replication with multi-AZ option. Is there any way to replicate our AWS EC2 instances without using Auto-scaling option?
On the EC2 console listing running instances, select the instance you want to replicate and under Actions click Launch More Like This.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/launch-more-like-this.html
Yes, configure your EC2 instance exactly the way you want it to be. Stop the instance and create an AMI of this instance. Then launch as many EC2 instances as you want using the AMI. Each EC2 instance will be almost identical. There will be differences due to licensing, IP addressing, instance ID, etc.
This is the same technique that you would use with Auto Scaling Groups (e.g. new instances are launched from a specific AMI).
Another option is to use Launch More Like This from the EC2 Console. However, this feature does not clone your instance, only replicates some configuration details.
We are facing two problems with EC2 and RDS instances:
We are loosing existing data, when the existing EC2 instance is terminated and new EC2 instance is created automatically. Once we create Elastic Beanstalk and upload our application files, its creating one EC2 instance and running. And then next if we upload any files to the existing EC2 instance and in case its going down/terminated, one more new instance is getting created and loosing the data from the old EC2 instance.
If we add the EC2 instance ip address to the RDS inbound security group to restrict others from accessing RDS instance from other ips, we are facing problem to access RDS, when the old EC2 instance is terminated and new EC2 instance is created or any other new ec2 instance is created based on load.
Kindly suggest some solution for the above issues.
Any data you store in EC2 is going to get lost if/when the instance is terminated. You need to design your solution so that it is not dependent on ephemeral subsystems.
Exactly how, will depend on what you are doing, but for example, if you are hosting a web server and the user can upload images, better to store them on S3 instead of directly in the EC2 instance. Data should be stored in a database also not on the EC2 instance, so in an RDS instance or DynamoDB both of which will survive an EC2 termination and restart.
For the access problem, you create a security group (call it sg-1234 for example), and then make each of your new instances created with that security group when they start.
Also create an RDS security group (call if db-1234 for example) and in the DB-1234 security group create a rule that allow Sg-1234 as a source.