Reputation: 2534
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!
Upvotes: 5
Views: 4158
Reputation: 2534
I think I should put my end solution here, to help people like me who don't have EIP set in first place, when dealing with instance retirement.
1.Enable elastic IP on current instances (principal, mirror, monitor)
2.Stop/Restart instance (other prep would be required base on your own servers infrastructure)
....... update data instances with new setting and re-config mirroring.......
3.Update application server host file to point old DNS name with new internal ip instance acquired after migration (NOTE: It IS a HACK, but it buys me time to update all my 60+ web applications gradually )
4.Update web apps in a planed fashion. (update with correct connection string in new deployments)
5.Delete host records after everything is updated to new public domain name.
Luckily this is only one off process.
A Few take away:
The EC2 DNS server returns the internal IP address of the instance when queried from another EC2 instance in the same region.
Upvotes: 0
Reputation: 22407
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
Upvotes: 5