Showing posts with label start. Show all posts
Showing posts with label start. Show all posts

Tuesday, December 3, 2013

Boot Strap : MySQL

Here is a user data boot strap script for installing and starting Oracle MySQL:

#!/bin/sh 
yum -y install mysql-server 
/etc/init.d/mysqld start 
echo -e '\n\nsudo /etc/init.d/mysqld start' >> /etc/rc.d/rc.local

Wednesday, May 15, 2013

EC2 instances life cycle

Here is a mapping of server hardware lifecycle to AWS EC2:
1. Start : On AWS - ec2-start-instances  
Note: This is different then instantiating an instance for the the first time (from an AMI).  The command for this is ec2-run-instances.
2. Reboot : On AWS - ec2-reboot-instances
(If a Linux/UNIX instance does not cleanly shut down within four minutes, Amazon EC2 will perform a hard reboot)
Note: Instance reboots are reboots of your virtual instance, and are equivalent to an operating system reboot.  You can also reboot your instance from the operating system of your instance. More here: http://serverfault.com/questions/350581/differences-between-reboot-and-ec2-reboot-instances
3. Hard kill : ec2-stop-instances 
Note: This would be like throwing away a machine but keeping the hard drive.

Tagging instances can be done at anytime using the ec2-create-tags command.



Tuesday, April 16, 2013

User data to install Apache and PHP


One of the most basic components on an EC2 instance is Apache and PHP.  Installing Apache and PHP is made easy with a short shell script, yum, and user data.  Here is all that needs to be placed in the user data section of the EC2 instance:

#!/bin/sh
yum -y install httpd php
chkconfig httpd on
/etc/init.d/httpd start