Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What changes after AWS instance is stopped then restarted

We have received a "instances scheduled for retirement" notification form AWS. It will affect our principle db server. Based on, what I have read, the easiest way is stopping the instance then restart it again.

My understanding is it basically will physically reallocate current instance, which would cause IP change. However, apart from that, what else would be changed.

Currently the instance about to be retired is running as our principle database server. it is connected by both application server (with 20+ web applications) and a slave db server instances.

Connection string between application server and the db instance uses AWS internal computer name (i.e.Data Source=IP-0A882XXX;User ID=username;Password=password;Initial Catalog=dbName;Failover Partner=IP-0A80XXX), which should not be changed after stop/restart. I am I correct?

Is there anything else I should be aware of? such as Security, Firewall Settings, etc.?

If anyone could pointing me to a check list would be greatly appreciated!

like image 734
D.J Avatar asked Jun 17 '13 01:06

D.J


People also ask

What happens when EC2 instance is stopped and started again?

When you stop an instance, we shut it down. We don't charge usage for a stopped instance, or data transfer fees, but we do charge for the storage for any Amazon EBS volumes. Each time you start a stopped instance we charge a minimum of one minute for usage. After one minute, we charge only for the seconds you use.

What happens if you stop a instance AWS?

Stop Instance When you stop an EC2 instance, the instance will be shutdown and the virtual machine that was provisioned for you will be permanently taken away and you will no longer be charged for instance usage.

What happens when you restart AWS?

When you reboot an instance, it keeps its public DNS name (IPv4), private and public IPv4 address, IPv6 address (if applicable), and any data on its instance store volumes. Rebooting an instance doesn't start a new instance billing period (with a minimum one-minute charge), unlike stopping and starting your instance.

What happens when an Amazon EC2 instance is stopped or terminated?

By default, Amazon EBS root device volumes are automatically deleted when the instance terminates. However, by default, any additional EBS volumes that you attach at launch, or any EBS volumes that you attach to an existing instance persist even after the instance terminates.


1 Answers

Stopping and starting an EBS boot EC2 instance is similar to rebooting it with these major exceptions:

  • New internal and external IP addresses (Elastic IP address needs to be re-associated)

  • Files on ephemeral storage are lost

I wrote the following article that goes into more detail and provides a list of all the finer points to consider:

Rebooting vs. Stop/Start of Amazon EC2 Instance - Alestic.com

The internal EC2 DNS name for your instance matches the internal IP address, so it will change on stop/start, and will need to be updated on your application servers.

You can use the following trick to not have to modify clients when the db server is moved:

  • Assign an Elastic IP to the internal instance

  • Use the external Elastic IP DNS name in the client instances.

The EC2 DNS server returns the internal IP address of the instance when queried from another EC2 instance in the same region.

I wrote the following article that goes into detail on how to do this and why it works:

Using Elastic IP to Identify Internal Instances on Amazon EC2

like image 150
Eric Hammond Avatar answered Sep 24 '22 15:09

Eric Hammond