Projects/Cloudstone/Chef Configurations

From RAD Lab

Revision as of 00:05, 1 August 2009; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

Cloudstone deploys and starts the necessary services using Chef, a systems integration framework written in Ruby.

Each Cloudstone service (e.g. MySQL, Rails, Nginx, Faban) has a recipe that is run by passing chef-solo a configuration file written in JSON. This page is organized such that the headings are the name of the configuration file.


Legend
TypeSee JSON.
KeyOnly exists if parent is of type Object.
LiteralString, Number, Boolean, Null
RequiredThe default value will not work 99% of the time.
DefaultedThis setting does not need to be set. It can, however, be overridden.


Contents

faban-agent

  • Array recipes
    • "cloudstone::faban-agent"
  • Object faban
    • String jdbc null
      • Options: null, "mysql", "postgresql"
      • Necessary on the primary (i.e. writing) database instance.

faban

  • Array recipes
    • String "cloudstone::faban"
  • Object faban
    • Object hosts
      • String webserver "[Internal IP of Web Server]"
      • String driver "[Internal IP of Driver]"
      • String database "[Internal IP of DB]"
      • String cache ""
      • String storage ""
    • Boolean debug false
      • If true, Faban will suspend and wait for a debugger to attach to port 8000.
    • Object database
      • String adapter "mysql"
        • Options: "mysql", "postgresql" (Use "postgresql" for PGPool-II and "mysql" for MySQL Replication.)
      • Number port 3306
        • Suggested: 3306 for MySQL, 5432 for PostgreSQL, and 9999 for PGPool-II
    • Object code
      • String faban "s3://radlab-cloudstone/faban-kit-062309.tar.gz"
      • String workload "s3://radlab-cloudstone/workload-olio-071309.tar.gz"
      • String images_suffix "-images"
    • Object directories
      • String faban "/root/faban"
      • String workload "/root/workload"
    • String benchmark "OlioDriver.jar"
    • Object database
      • String name "olio"
      • String username "olio"
      • String password "olio"
    • String java_home "/usr/lib/jvm/java-6-openjdk"

haproxy

  • Array recipes
    • String "cloudstone::haproxy"
  • Object haproxy
    • String service_name "cloudstone_haproxy"
    • Object servers
      • Object localhost
        • Number start 3000
        • Number count 2
        • This needs to point to the Rails instances (usually starting on port 3000).
    • Object metric_service
      • Number start null
      • Number count null
      • If metric_service is set, the Director recipe is deployed.
    • Number max_connections 4096
    • Object stats
      • Number port 9999
      • Boolean enabled true
    • Object tcp
      • String name "rails_tcp"
      • Number port 4000
      • Object logs
        • Number port 7787
        • String host "127.0.0.1"
    • Object http
      • String name "rails"
      • Number port 3999
      • Object logs
        • Number port 7788
        • String host "127.0.0.1"

memcached

  • Array recipes
    • String "cloudstone::memcached"
  • Object memcached
    • Number size 1024
    • Number port 1211

mysql-initial

  • Array recipes
    • String "cloudstone::mysql-initial"
  • Object mysql
    • Number server_id 2
      • This needs to be unique across all MySQL instances.
    • Object hosts
      • String master null
      • String initial "localhost"
      • Array slaves
        • This array must contain the internal IP addresses of the slave instances.

Look at the Chef configuration for MySQL to see the defaulted settings.

mysql-master

  • Array recipes
    • String "cloudstone::mysql-master"
  • Object mysql
    • Number server_id 1
      • This needs to be unique across all MySQL instances.
    • Object hosts
      • String master "localhost"
      • String initial null
      • Array slaves
        • This array must contain the internal IP addresses of the slave instances.

Look at the Chef configuration for MySQL to see the defaulted settings.

mysql-slave

  • Array recipes
    • String "cloudstone::mysql-slave"
  • Object mysql
    • Number server_id 3
      • This needs to be unique across all MySQL instances.
    • Object hosts
      • String master null
      • String initial null
      • Array slaves
        • String "localhost"

Look at the Chef configuration for MySQL to see the defaulted settings.

mysql

  • Array recipes
    • String "cloudstone::mysql"
  • Object mysql
    • Number server_id 1
      • This needs to be unique across all MySQL instances.
    • String directory "/mnt/mysql"
    • String archive_path "/tmp/mysql_data.tar.gz"
    • String service_name "cloudstone_mysql"
    • String username "olio"
    • String password "olio"
    • Number port 3306
    • Boolean optimized true
      • When enabled, the memory buffer is 3804M (instead of 384M), requiring a 64-bit machine.
    • Object slave
      • String username "olio_slave"
      • String password "olio_slave"

nginx

  • Array recipes
    • String "cloudstone::nginx"
  • Object nginx
    • Object servers
      • Object localhost
        • Number start 3000
        • Number count 2
        • This should point to either:
          1. Rails instances (usually starting on port 3000).
          2. HAProxy instance (usually starting on port 4000 with count 1).
    • String code "http://svn.apache.org/repos/asf/incubator/olio/tags/0.1-final/webapp/rails/trunk/"
    • Object directories
      • String app "/mnt/cloudstone-web"
      • String local "/mnt/cloudstone-web/public"
      • String media "/mnt/cloudstone-web/public/uploaded_files"
    • String service_name "cloudstone_webserver"

pgpool

  • Array recipes
    • String "cloudstone::pgpool"
  • Object pgpool
    • Object databases
      • Number localhost 5432
    • Number max_connections 256
    • Number port 9999
    • String code "s3://radlab-cloudstone/pgpool-II-2.2.2.tar.gz"
    • Object directories
      • String pgpool "/mnt/pgpool"
      • String socket "/var/run/pgpool"
    • String username "olio"
    • String password "olio"
    • String service_name "cloudstone_pgpool"

postgresql

  • Array recipes
    • String "cloudstone::postgresql"
  • Object postgresql
    • Number max_connections 256
    • Number port 5432
    • String directory "/mnt/postgresql"
    • String username "olio"
    • String password "olio"
    • String service_name "cloudstone_postgresql"

rails

  • Array recipes
    • String "cloudstone::rails"
  • Object rails
    • Object memcached
      • Number port 1211
      • String host "localhost"
    • Object ports
      • Number start 3000
      • Number count 2
        • This should be roughly twice the number of cores on the instance.
    • Object geocoder
      • String host "localhost"
        • This should point to the Faban instance (i.e. piggybacked).
      • Number port 9980
    • Object database
      • String adapter "mysql"
        • Options: "mysql", "mysql_replication", "postgresql" (Use "postgresql" for PGPool-II.)
      • String host "localhost"
      • Number port 3306
        • Suggested: 3306 for MySQL, 5432 for PostgreSQL, and 9999 for PGPool-II
    • String code "http://svn.apache.org/repos/asf/incubator/olio/tags/0.1-final/webapp/rails/trunk/"
    • String directory "/mnt/cloudstone"
    • String service_prefix "cloudstone_thin_"
    • Object database
      • String name "olio"
      • String username "olio"
      • String password "olio"
    • String log_level "error"
      • Use "debug" to show debug logs in production mode.