How-to move to a productive system with Mercury?

Events happening in the community are now at Drupal community events on www.drupal.org.
ayalon's picture

Thanks for the great efforts with Mercury! I used your excellent AMIs to set up a new EC2 Instance.

I installed my own Drupal Instance and MySQL DB, changed my php.ini settings and used solr to index my page.

Now I consider to switch to the productive system. At the moment I'm afraid to use this webserver because I know, that clicking the "Terminate" button in the Amazaon Management Console will completely destroy everything I've set up. Also a server failure will probably kill the server because I'm not able to reset th server.

The big question is now: How can I make my system safe and persistant?

I researched a bit and found the Elastic Block Store functionality. I created a EBS Drive and attached it to my EC2 instance. Worked with well.

Here is my list of all data, I would like to make persistant:

MySQL Database
I found an instruction here</> how to move the MySQL files to an EBS Drive.

Website files
Stored under /var/www

Apache Solr index
The index of the whole drupal website

Apache Solr configuration file
Storing the schema.xmol and the solrconfig.xml modified for my website

Apache Server Configuration
My virtual hosts, PHP.ini file, phpmyadmin configuration etc.

Log files of apache / solr / system
For security and statistic reason.

Backup and rsync script
Normally I have some scripts I use under ~/scripts

Custom User / Logins
Custom SFTP User Login / Password stored in /etc/passwd /etc/group

How can I make all these parts of my EC2 instance persistant?

And the follow up question:
How can I restore my EC2 instance from the scratch in case of emergency using the persistant data above?

Comments

Productive systems

ayalon's picture

Does actually USE anyone Mercury in a productive system or are all this tutorials only for training purpose?

Hi ayalon, I think that the

paolomainardi's picture

Hi ayalon,

I think that the only think you need to do is to create symlink of services you need, to mounted EBS drive (as explained in the Mysql EBS tutorial).

After, you should create a script to take care of this process, you could use this file like as skeleton:

/etc/mercury/boot.d/S050ec2.sh

After, you have 2 options:

1) Rebundle your system (with ec2 command line tools)
2) Create new bcfg2 configuration files.

Hi Ayalon, Sounds like we're

mpaler's picture

Hi Ayalon,

Sounds like we're both in the same camp: New to Mercury and personally speaking, relatively new to server admin. Here's what I'm doing on a production site right now:

Single instance of Mercury Running on a medium sized image.

Mysql datafiles are persistent on a 10GB EBS. Used the Mysql EBS tutorial listed in Panthon Documentation (http://groups.drupal.org/node/33092 -- thankyou nullvariable!). Taking periodic manual snap shots. I plan on looking into continuous snapshotting soon.

The entire drupal installation (all pressflow core files and sites directory), except the drupal files (sites/default/files) is in version control. In my case, subversion.

I run a shell script that backs up the apache configuration files and the drupal files directory (sites/default/files) directly to S3.

I also use Backup and Migrate to do a daily backup of just my critical data to S3 also.

Here's what I currently do incase of a disaster.

  1. initiate a brand new mercury instance, install pressflow like a new site.
  2. recreate the proper directory structure in /var/www
  3. bring in my backed up apache config files, and apache enable the appropriate sites
  4. attach the EBS volume, mount it using commands in the MySQL tutorial.
  5. delete the entire fresh pressflow files I just installed in step 1.
  6. Do a check out of my drupal files from the repo.

Clunky? Yes. But repeatable. I basically have comfort in the fact that all my data and code files are always backed up...

My next step is to start experimenting to see how much of the Mercury and my Pressflow installation I can push into the EBS volume to make persistent. I'm going to start with putting all of /var/www into the volume using commands similar to those found in the Mysql tutorial.

Mercury

Group organizers

Group categories

Post Type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: