Vagrant test environment for Monasca
Go to file
Tim Kuhlman 5520c2e38c minor name change, other changes will happen as updatedcookbooks are ready.
Change-Id: I918e0026ed96fb3cb1c5582c19744ccf771566ef
2014-07-16 15:33:10 -06:00
cookbooks New DevStack server build profile, various fixes 2014-07-16 13:16:20 -06:00
data_bags Changed it so the split setup is Vertica 1 VM is influxdb. 2014-07-09 16:28:09 -06:00
ds-build New DevStack server build profile, various fixes 2014-07-16 13:16:20 -06:00
roles Fixed port conflict with persister/influxdb 2014-07-10 11:50:07 -06:00
split minor name change, other changes will happen as updatedcookbooks are ready. 2014-07-16 15:33:10 -06:00
tests The smoke test should use keystone now that it is working. 2014-06-27 09:03:16 -06:00
.gitignore Add vertica backup to the cluster configuration 2014-05-28 12:23:05 -06:00
.gitreview Get initial build to work. 2014-07-15 17:09:03 -06:00
Berksfile New DevStack server build profile, various fixes 2014-07-16 13:16:20 -06:00
README.md minor name change, other changes will happen as updatedcookbooks are ready. 2014-07-16 15:33:10 -06:00
Vagrantfile New DevStack server build profile, various fixes 2014-07-16 13:16:20 -06:00

README.md

Table of Contents

Installs a mini monitoring environment based on Vagrant. Intended for development of the monitoring infrastructure.

Installation

Get the Code

git clone https://github.com/stackforge/monasca-vagrant

Install Vagrant

Install VirtualBox and Vagrant

Note: Vagrant version 1.5.0 or higher is required.

MacOS

The following steps assume you have Homebrew installed. Otherwise, install VirtualBox and Vagrant manually from their websites, then continue with Set Up Berkshelf below.

brew tap phinze/cask
brew install brew-cask
brew cask install virtualbox 
brew cask install vagrant

Linux (Ubuntu)

# For Ubuntu 12.04, you may need to install ruby 1.9 first
sudo apt-get install ruby1.9.3
sudo update-alternatives --set ruby /usr/bin/ruby1.9.1

sudo apt-get install virtualbox
latest=`curl -s http://www.vagrantup.com/downloads.html |tr " " "\n" |grep 'x86_64.deb' |cut -d'"' -f2`
wget $latest && sudo dpkg -i `basename $latest`

Set Up Berkshelf

MacOS

vagrant plugin install vagrant-berkshelf --plugin-version '>= 2.0.1'
gem install berkshelf

Linux (Ubuntu)

sudo vagrant plugin install vagrant-berkshelf --plugin-version '>= 2.0.1'
sudo gem install berkshelf

Using mini-mon

  • Your host OS home dir is synced to /vagrant_home on the VM.
  • The root dir of the monasca-vagrant repo on your host OS is synced to /vagrant on the VM.
  • The main VM will have an IP of 192.168.10.4 that can be access from other services running on the host.
  • An additional VM running DevStack will be created at 192.168.10.5
  • You can access UI by navigating to http://192.168.10.5 and logging in as mini-mon with password
  • Run vagrant ssh <host> to log in, where <host> is either mini-mon or devstack
  • Run vagrant help for more info

Updating

When someone updates the config, this process should allow you to bring up an updated VM.

  • git pull
  • berks update
  • vagrant destroy <vm> Where <vm> is the name of the VM being updated, for example 'vertica'
  • vagrant up

Improving Provisioning Speed

The slowest part of the provisioning process is the downloading of deb packages. To speed this up a local apt-cacher-ng can be used.

Linux (Ubuntu)

sudo apt-get install apt-cacher-ng

MacOS

brew install apt-cacher-ng

Run apt-cacher-ng -c /usr/local/etc/apt-cacher-ng/ or optionally follow the instructions from brew to start up the cache automatically. That is all that is needed. From now on, the cache will be used.

A report from the cache is found at http://localhost:3142/acng-report.html

Cookbook Development

To develop cookbook changes with Vagrant:

  • Edit Berksfile, changing the appropriate cookbook line to a local path. For example:
cookbook 'zookeeper', path: '/Users/kuhlmant/src/mon/cookbooks/zookeeper'
  • Edit your local cookbook as needed
  • Run berks update <cookbook_name>
  • If the Vagrant VM is already up, run vagrant provision. Otherwise, run vagrant up
  • When finish testing commit and upload your cookbook as normal but don't forget to bump the cookbook version in the metadata.rb.

Running behind a Web Proxy

If you are behind a proxy you can install the vagrant-proxyconf pluging to have Vagrant honor standard proxy-related environment variables and set the VM to use them also.

vagrant plugin install vagrant-proxyconf

Vertica

Vertica is supported instead of influxdb, this is especially useful for large deployments.

Before using Vertica must be downloaded from the Vertica site. Download these packages and place in the root of this repository.

  • vertica_7.0.1-0_amd64.deb
  • vertica-r-lang_7.0.1-0_amd64.deb

The vertica::console recipe is not enabled by default, but if it is added, this package is also needed.

  • vertica-console_7.0.1-0_amd64.deb

After the vertica packages are installed the configuration must be changed to run Vertica. Specifically besides starting Vertica the data bags for the monasca_api and the monasca_persister need to be updated so these services use Vertica rather than InfluxDB.

The alternative split setup is configured for running Vertica.

Alternate Vagrant Configurations

To run any of these alternate configs, simply run the Vagrant commands from within the subdir. Note that the Vertica debs must be copied (not symlinked) into the subdir as well. See the README.md in the subdir for more details.

  • split subdir - The various monitoring components split into their own VMs. The split setup runs Vertica by default rather than influxdb.
  • ds-build subdir - This is used for building a new devstack server image. It does not typically need to be run.

In the past other alternative setups were working including running mini-mon in HP Public Cloud and scripts for putting it on baremetal. These are no longer supported.