OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins as a part of the Git hosting and code review systems migration detailed in these mailing list posts: http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html Attempts have been made to correct repository namespaces and hostnames based on simple pattern matching, but it's possible some were updated incorrectly or missed entirely. Please reach out to us via the contact information listed at https://opendev.org/ with any questions you may have.
|1 month ago|
|ds-build||3 years ago|
|group_vars||3 years ago|
|host_vars||3 years ago|
|roles/monasca-devstack||4 years ago|
|.ansible_hosts||4 years ago|
|.gitignore||4 years ago|
|.gitreview||1 month ago|
|README.rst||11 months ago|
|Vagrantfile||4 years ago|
|devstack.yml||3 years ago|
|env.sh||3 years ago|
|events.yml||3 years ago|
|mini-mon.yml||3 years ago|
|mkdocs.yml||3 years ago|
|monasca-ansible-repos.sh||3 years ago|
|monasca-repos.sh||3 years ago|
|requirements.yml||3 years ago|
|smoke.yml||3 years ago|
Table of Contents
Installs a mini monitoring environment based on Vagrant. Intended for development of the monitoring infrastructure.
git clone https://github.com/openstack/monasca-vagrant
Note: Vagrant version 1.5.0 or higher is required.
brew tap phinze/cask brew install brew-cask brew cask install virtualbox brew cask install vagrant brew install ansible # Version 1.8+ is required ansible-galaxy install -r requirements.yml -p ./roles
sudo apt-get install virtualbox #Download and install latest vagrant from http://www.vagrantup.com/downloads.html sudo pip install ansible # Version 1.8+ is required ansible-galaxy install -r requirements.yml -p ./roles
vagrant up. The first run will download required vagrant boxes.
vagrant haltto stop the boxes and later run
vagrant upto turn them back on. To destroy and rebuild run
vagrant destroy -f. It is typically fastest to use halt/up than to rebuild your vm.
vagrant helpfor more info on standard vagrant commands.
The full Monasca stack is running on the mini-mon vm and many devstack services on the devstack vm. A monasca-agent is installed on both and metrics are actively being collected. - You can access the horizon UI by navigating to http://192.168.10.5 and logging in as mini-mon/password. This is the UI used for devstack and it contains the Monasca plugin found at the Monitoring tab as well as Grafana used for graphing metrics. - Run
vagrant ssh <host> to log in, where
<host> is either
devstack - The monasca cli is installed within both vms and the necessary environment variables loaded into the shell. This is a good way to explore the metrics in the system. For example to list all metrics, run
At the end of the install a smoke test is run that exercises every major piece of Monasca. If this fails the end of the provision will report it. It is possible to rerun this at any point using Ansible
ansible-playbook ./smoke.yml or from within the vm by running smoke.py and smoke2.py in
When someone updates the config, this process should allow you update the VMs, though not every step is needed at all times.
ansible-galaxy install -r requirements.yml -p ./roles -f
vagrant box updateOnly needed rarely
vagrant provision, if the vms where halted run
If you are behind a proxy you can install the
vagrant-proxyconf plugin to have Vagrant honor standard proxy-related environment variables and set the VM to use them also. It is important that 192.168.10.4, 192.168.10.5, 127.0.0.1 and localhost be in your no_proxy environment variable.
vagrant plugin install vagrant-proxyconf
You can configure Vagrant to run Vertica as the database in place of influxdb.
To accomplish this you have to download the community edition (Debian) and the jdbc driver from Vertica.
Place the jdbc driver and debian in the home directory of vagrant with the names of:
Set the environment variable USE_VERTICA to true and then run vagrant up.
export USE_VERTICA=true vagrant up
/vagrant_homeon the VM.
/vagranton the VM.
The slowest part of the provisioning process is the downloading of packages. The Vagrant plugin
vagrant-cachier available at https://github.com/fgrehm/vagrant-cachier should help by caching repeated dependencies. To use with Vagrant simply install the plugin.
sudo vagrant plugin install vagrant-cachier
See this page for details on the Monasca Architecture.
The components of the system which are part of the Monasca code base have there configuration in
/etc/monasca and their logs in
/var/log/monasca. For nearly all of these you can set the logging to higher debug level and restart. The components of the system which are dependencies for Monasca (zookeeper, kafka, storm, influxdb, mysql) are either in the standard Ubuntu location or in
Some other helpful commands: - Zookeeper shell at -
/usr/share/zookeeper/bin/zkCli.sh - Kafka debug commands are at
/opt/kafka/bin in particular the
kafka-console-consumer.sh is helpful. - Running
monasca-collector info will give an report on the current state of agent checks. - The storm admin webui exists at
http://192.168.10.4:8088 - The mysql admin is root/password so you can access the db with the command
mysql -uroot -ppassword mon
At any point you can rerun
vagrant provision to rerun the Ansible provisioning. Often it is easier to run ansible directly and specify tags, ie
ansible-playbook mini-mon.yml --tags api,persister. Also a very simple playbook is available for running the smoke test,
For these to work smoothly add these vagrant specific settings to your local ansible configuration (~/.ansible.cfg or a personal ansible.cfg in this dir):
[defaults] hostfile = .ansible_hosts # In some configurations this won't work, use only if your config permits. [ssh_connection] pipelining = True # Speeds up connections but only if requiretty is not enabled for sudo
vagrant ssh-config >> ~/.ssh/config, that will set the correct users/host_keys for the vagrant vms.
When running Ansible directly make sure that you pass in what the database_type is, ie
ansible-playbook mini-mon.yml -e 'database_type=influxdb'.
Since there are only two VMs in this setup the Ansible configuration has no host or group variables, rather all variables are in the playbook. There is one playbook for each machine,
devstack.yml. The playbooks contain all variables, some tasks and the roles used in building the VMs.
To edit the Ansible roles I suggest downloading the full git source of the role and putting it in your ansible path. This allows you to run your changes directly from the git copy you are working on. See the Ansible docs for more details on the exact configuration needed.
In this repo there are a couple of helper scripts to aid in downloading all of the Monasca git repositories. -
./monasca-repos.sh <parent_dir> will clone all code repos to the parent dir -
./monasca-ansible-repos.sh <parent_dir> will clone all code repos to the parent dir -
./monasca-ansible-repos.sh <parent_dir> will clone all of the team Ansible repos to the parent dir.
To run any of these alternate configs, simply run the Vagrant commands from within the subdir.