-
Notifications
You must be signed in to change notification settings - Fork 61
Installation_Guide_Environment
Architecture | Contents | Standalone
Setting up the environment involves Getting an account with Amazon, and creating various resources such as AMIs, Security Keys, Security Zones, and EBS volumes.
Note
You will need a Credit Card or arrange payment in order to complete the following steps.
- Go to http://aws.amazon.com/ and click on the "Sign Up" button
- Complete all steps for creating an account
Thera are two methods of setting up access to resources from the controller and agent instances.
-
Use IAM roles to start the instances giving them access to the needed resources. If you use this method, just make sure you start your resources with the appropriate roles.
-
Use access keys.
- Log in to the amazon console from http://aws.amazon.com/
- In the top right corner where the account name show up, click it and select Security Credentials from the drop down menu.
- Scroll down to the Access Keys section and click Create a new Access Key
- Copy the Access Key ID from the newly created key.
- Click on Show section and copy the Secret Access Key
- Store these values in a file on your computer somewhere, you will need them for configuration later.
The keypair is used to ssh into the instances that get started. Do not lose these keys as they cannot be retrieved form AWS.
- Log in to the amazon console from http://aws.amazon.com/
- Go to EC2 tab
- Click on Key Pairs link under the Network & Security section in left navigation panel
- Create a Key Pair and save the downloaded pem file somewhere safe ssh-keygen -y -f [path/to/pem/file].pem [path/to/key/file].pub
- Change the Mod settings on the key file to 600 sudo chmod 600 [path/to/pem/file].pem [path/to/key/file].pub
Tip
Optionally create environment variable for the key. I will use the environment variable, AWS_KEY in the rest of this documentation to refer to the key file. I also put this into my bashrc or profile so you can use this name as well.
export AWS_KEY=/Home/aws_keys/tank_key.pem
- Log in to the amazon console from http://aws.amazon.com/
- Go to EC2 tab
- Click on Security Groups link under the Network & Security section in left navigation panel
- Click the Create Security Group button in the tool bar area
- Name the security group something appropriate like tank
- Select the new Group and click the Inbound tab in the lower panel
- Add appropriate rules. At a minimum, you will need SSH, HTTP (80 and 8080), HTTPS(443 and 8443), and 8090 (agent)
If you wish, you can create your own Mysql instance and point to it instead.
- Log in to the amazon console from http://aws.amazon.com/
- Go to RDS tab
- Click on Instaces link in left navigation panel
- Click the Launch DB Instance button in the tool panel
- Select mysql instance
- Set all options appropriately
Agent AMIs must be created in each of the Amazon regions that you wish to run tests from. You can use cloudformation or chef to provision your instances if you wish.
Tip
There is a Cloudformation script and resources in aws-config in the root of this project's directory that will create the controller and the agent instances that can be used as a starting point for creating the AMIs.
-
Log in to the amazon console from http://aws.amazon.com/
-
Go to EC2 tab
-
Click on AMIs link under the Images section in left navigation panel
-
Find a suitable 64-bit base image backed by EBS and launch an instance. It does not matter which size or zone you start it in as it will only be used to create a base AMI.
-
After it is started, connect via ssh
-
Download and install the latest version of Java and add an entry in /etc/profile for a JAVA_HOME variable pointing to the base java directory.
-
Ensure that java is installed and that the JAVA_HOME environment variable is set in /etc/profile
-
Set the maximum number of open files limit to at least 50000
echo ulimit -n 50000 >>/etc/profile
-
Select the instance and choose Create Image (EBS AMI) from the Instance Actions dropdown in the toolbar area.
-
Give it an appropriate name such as Intuit Tank Base and click OK.
-
After the instance is ready, terminate the instance you started.
-
Log in to the amazon console from http://aws.amazon.com/
-
Go to EC2 tab
-
Click on AMIs link under the Images section in left navigation panel
-
Launch an instance from your Intuit Tank Base AMI. Select m1.xlarge and the zone your EBS volume is installed in.
-
Click on Elastic IPs link under the Network and Security section in left navigation panel
-
Click the Allocate New Address button.
-
Click the new address and click the Associate Address button.
-
Select the new instance you just launched and select ok.
-
Connect to the instance
ssh -i $AWS_KEY root@[instance]
-
Downlaod and Install Tomcat 6x from apache
wget http://tomcat.apache.org/download-60.cgi
-
Download mysql connector and install in TOMCAT_HOME/lib
wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.30.tar.gz
or
wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.30.zip
-
Uncompress and move the jar file mysql-connector-java-5.1.30-bin.jar to TOMCAT_HOME/lib
-
Download Weld support jar and install in TOMCAT_HOME/lib
wget -O TOMCAT_HOME/lib http://central.maven.org/maven2/org/jboss/weld/servlet/weld-tomcat-support/1.0.1-Final/weld-tomcat-support-1.0.1-Final.jar
-
Upload Intuit Tank war file from your build machine upload PROJECT_ROOT/web/web_ui/target/tank.war from your local machine.
-
Move it to the webapps dir For context of /tank
mv tank.war TOMCAT_HOME/webapps/
For context of /
mv tank.war TOMCAT_HOME/webapps/ROOT.war
-
Create the tank directories.
mkdir /mnt/ebs/wats; mkdir /mnt/ebs/wats/conf; mkdir /mnt/ebs/wats/jars
-
Add Datasource definition to server.xml edit the file TOMCAT_HOME/conf/server.xml. Inside the <GlobalNamingResources> tag add the following replacing values appropriately:
<Resource name="jdbc/watsDS" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="admin" password="replace_password_here" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://replace_host_name_here:3306/replace_db_name_here?autoReconnect=true" />
-
Add Datasource definition to context.xml edit the file TOMCAT_HOME/conf/context.xml. Inside the <Context> tag add the following:
<ResourceLink global='jdbc/watsDS' name='jdbc/watsDS' type="javax.sql.Datasource" />
-
Start and stop tomcat to initialize the system. Ensure that the settings file is created in $WATS_PROPERTIES and that the database tables are created.
-
Select the instance and choose Create Image (EBS AMI) from the Instance Actions dropdown in the toolbar area.
-
Give it an appropriate name such as Intuit Tank Controller and click OK.
-
After the instance is ready, terminate the instance you started.
- Log in to the amazon console from http://aws.amazon.com/
- Go to EC2 tab
- Click on AMIs link under the Images section in left navigation panel
- Launch an instance from your Intuit Tank Base AMI.
- Connect to the instance ssh -i AWS_KEY root@[instance]
- Upload the agent startup zip file from your build machine PROJECT_ROOT/agent/agent_startup_pkg/target/agent-startup-pkg.zip
- unzip the file to /opt cd /opt ; unzip ~/agent-startup-pkg.zip
- Move startup script to /etc/init.d mv tank_agent/tank-agent /etc/init.d/
- Set it to start on startup chkconfig tank-agent on
- Select the instance and choose Create Image (EBS AMI) from the Instance Actions dropdown in the toolbar area.
- Give it an appropriate name such as Intuit Tank Agent and click OK.
- After the instance is ready, terminate the instance you started.