Projects/Cloudstone/Manual Deployment

From RAD Lab

Jump to: navigation, search

Once your Amazon EC2 instances are initialized, you can use the instructions on this page to manually deploy the services necessary for Cloudstone to run.

This is not the preferred method of deployment because this page will usually not be updated when new services are added or new techniques are discovered. Instead, you should use either the Manager Script or the Deployment Library to deploy Cloudstone. With that said, the steps in this guide may still be useful when the automated methods fail for whatever reason.

Contents

MySQL

Instructions

  1. Start the MySQL server: /etc/init.d/mysql start
  2. Create a user for Olio on your instance of MySQL: mysql --execute "GRANT ALL ON *.* TO 'olio'@'%' IDENTIFIED BY 'olio';"
  3. Create the database for Olio: mysqladmin -u root create olio

Notes

  • The MySQL configuration file is located at: /etc/my.cnf
  • To stop the MySQL server: /etc/init.d/mysql stop
  • To restart the MySQL server: /etc/init.d/mysql restart

Rails

Instructions

  1. Check out the latest Olio release from the Olio repository: svn co http://svn.apache.org/repos/asf/incubator/olio/tags/0.1-final/webapp/rails/trunk/ olio
  2. Enter the Olio directory: cd olio
  3. Create the database.yml file: cp config/database.yml.template config/database.yml
  4. Edit the database.yml file using your favorite editor: vim config/database.yml
  5. Change the hostname host: of your production configuration to the IP address of the MySQL machine and change the port port: to 3306, the default MySQL port, and save the database.yml changes.
  6. Set up the Olio database and schema for the production environment: rake db:migrate RAILS_ENV=production
  7. Run the Rails server: /usr/bin/thin -e production -p 3000 start &

Notes

  • To start the Rails server on another port, use the -p # parameter with a different port number.
  • To start more than one Rails server, use the -n # parameter with the specified number of servers. Any additional servers started will start in increasing order after the parameter specified with -p #.
  • To toggle logging, change logging verbosity, or change other environment variables, look at config/environment.rb
  • Logging is provided at log/production.log

Nginx

Instructions

  1. Edit the nginx configuration with your favorite editor: vim /usr/local/nginx/conf/nginx.conf
  2. Add an entry in the http configuration for the reverse proxy load balancer:

 upstream rails_servers {
   server ip_address_of_rails_machine_1:3000;
   # One entry for each instance of a Rails server
 }

  1. Under the http, server, location configuration, replace it with the following entry for the reverse proxy load balancer:

 server {
   location / {
     proxy_pass http://rails_servers;
   }
 }

  1. Start the nginx server: nginx

Notes

  • There are many more configuration options for nginx that will not be covered here. Check the official documentation for more information.

Faban

Instructions

Any server in which you want Faban to monitor statistics from must have a Faban agent running on it, including the database server, web server, and memcache server.

  1. On every machine which will run Faban, set the JAVA_HOME environment variable to /usr/lib/jvm/java-6-openjdk: export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
  2. On every machine which will run Faban, download Faban: s3cmd get s3://radlab-cloudstone/faban.tar.gz
  3. On every machine which will run Faban, extract Faban from the downloaded tarball: tar xzvf faban.tar.gz
  4. On the database server only, download the MySQL connector: s3cmd get s3://radlab-cloudstone/mysql-connector-java-5.1.7-bin.jar
  5. On the database server only, copy the MySQL to the Java CLASSPATH: cp mysql-connector-java-5.1.7-bin.jar $JAVA_HOME/jre/lib/ext/
  6. On every machine which will run Faban except the master (driver machine), start an agent: faban/bin/agent
  7. On every machine which will run the Faban master (driver machine), download the Geocoder: s3cmd get s3://radlab-cloudstone/geocoder.war
  8. On every machine which will run the Faban master (driver machine), copy the Geocoder into Faban: cp geocoder.war faban/master/webapps/.
  9. On every machine which will run the Faban master (driver machine), start the master: faban/master/bin/startup.sh
  • Note: The script will tell you to point your browser to <internalIP>:9980 -- instead, point to http://<externalIP>:9980.