|
/Hosting/Amazon/EC2:
My Migration Process: An Old (Crashed) Amazon EC2 Server to a Newer Version
(Note: these are abbreviated notes with some detail deliberately left out.)
When one updates the software on an Amazon EC2 server, not everything gets upgraded (the kernel, for one very important example). When one starts an EC2 server for the first time, the original bundle usually comes from someone or some organization that is actively maintaining it, and periodically issuing updates. Therefore it is good practice to occasionally move one's server to a more current bundle ("AMI", in Amazon parlance).
Amazon's EC2 servers have some other unique characteristics, one of them being that data and the OS are kept in separate "partitions", and backed up by different processes. The server backup is quite a bit more onerous in terms of time and steps, if it has not yet been scripted (and I have not....) so it tends to not happen as often and the current server can become significantly different from the last backup. And when an EC2 server stops or crashes for whatever reason, the delta from the last backup is irrevocably lost.
All this to say, sometimes when there is a server problem, it is more expedient to create a new server then to restart an old backup:
Setup a new server:
On the new server, /vol now contains my MySQL databases and /var/www. Sym link these into the standard locations in the new server's file structure.
/vol also contains a /vol/etc copy of /etc (no more then 24 hours old). 'cp -a' the backed up versions of the apache2, php5, and mysql directories into /etc.
'apt-get install apache2 libapache2-mod-fastcgi mysql-server php5 php5-cli pyblosxom
postfix'
(I prefer postfix over exim.)
Correct any ownership issues in /vol with the www and mysql directories (they were just mounted on another server).
Move Elastic IP from old server to new server.
Install ntpdate and add this to root crontab:
11 */6 * * * /usr/sbin/ntpdate us.pool.ntp.org
Install etckeeper:
Now add this to root crontab:
15 1 * * * cd /vol/etc && git pull
Create a user account:
[1] http://alestic.com/
posted at: 14:15 | path: /Hosting/Amazon/EC2 | permanent link to this entry