Skip to content
huxoll edited this page Oct 2, 2013 · 13 revisions

TopStack makes heavy use of Chef during operation. You'll need any standard Chef server, with some additional cookbooks provided in the TopStackChefRepo project.

Here are some sample steps to set up Chef for TopStack.

  1. Obtain a chef server package (Chef 11 recommended) and install it, from http://www.opscode.com/chef/install/

    For example, on Ubuntu 12.04:

    $ wget http://${latest-Chef-11}.deb
    $ dpkg -i ${latest-Chef-11}.deb
    $ # Run the initial build
    $ sudo chef-server-ctl reconfigure
    
  2. Obtain a chef client package (Chef 11 recommended) and install it, from http://www.opscode.com/chef/install/

    For example, on Ubuntu 12.04:

    $ curl -L https://www.opscode.com/chef/install.sh | sudo bash
    
  3. Unzip the cookbooks from the TopStack Chef repository.

    Perform the following steps on your deployment instance. (If you're not installing Chef on your deployment instance, you'll need to obtain credentials such as the "webui.pem" described below and transfer them to the instance.)

    You can also create a unique admin node for your TopStack host; for convenience, we're using the automatic webui.pem certificate here.

    mkdir -p /etc/ChefRepo/cookbooks
    mkdir -p /etc/ChefRepo/roles
    cd /etc/ChefRepo && tar -zxvf ${TOPSTACK_DIR}/TopStackChefRepo/dist/topstack-chef.tar.gz
    cat <<-EOC > /etc/chef/knife.rb
    log_level            :info
    log_location         STDOUT
    node_name           'chef-webui'
    cache_type          'BasicFile'
    cache_options( :path => "/root/.chef/checksums" )
    client_key             "/etc/chef-server/chef-webui.pem"
    
    cookbook_path      [ "/etc/ChefRepo/cookbooks" ]
    cookbook_copyright "transcendcomputing com"
    cookbook_email     "[email protected]"
    cookbook_license   "apachev2"
    
    chef_server_url    "https://localhost"
    
    validation_key      "/etc/chef-server/chef-validator.pem"
    validation_client_name "chef-validator"
    EOC
    
    for role in /etc/ChefRepo/roles/*; do 
       knife role from file $role -c /etc/chef/knife.rb
    done
    
    # Upload cookbooks
    knife cookbook upload /etc/ChefRepo/cookbooks/* -a -c /etc/chef/knife.rb
    
    knife environment from file /etc/ChefRepo/environments/transcend_production.json -c /etc/chef/knife.rb
  4. TopStack requires access to a queue for transmitting monitoring data. Chef includes RabbitMQ as an embedded service which meets this need. Use the following command to add a virtual host for monitor data use, on any Chef server. (The IP of the rabbit host will need to be provided to Monitor, if it's not the chef server.)

    # RabbitMQ controller (rabbitmqctl) may be found in /opt/chef-server/embedded/bin with Chef 11 omnibus install
    cd /opt/chef-server/embedded/bin
    ./rabbitmqctl add_vhost /monitor
    ./rabbitmqctl add_user transcend transcend
    ./rabbitmqctl set_permissions -p /monitor transcend ".*" ".*" ".*"
    # Also ensure that rabbit is listening on all interfaces; comment out RABBITMQ_NODE_IP_ADDRESS in
    # /var/opt/chef-server/rabbitmq/etc and restart:
    vi /var/opt/chef-server/rabbitmq/etc
    /opt/chef-server/bin/chef-server-ctl restart rabbitmq
    
  5. Configure your TopStack deployment instance, as described in Deployment Instance Setup.

Clone this wiki locally