From 4e41e475664370720f6bdce697483d8fccbd8a95 Mon Sep 17 00:00:00 2001 From: Michael James Hoppal Date: Fri, 15 May 2015 14:05:50 -0600 Subject: [PATCH] Adding in vertica Change-Id: Ifa633cd4b2fb04220a1adf8d57dde942f7ea3f57 --- .gitignore | 1 + README.md | 22 ++++++++++++++++++++++ Vagrantfile | 5 +++++ host_vars/mini-mon | 15 +++++++++++++++ mini-mon.yml | 10 +++++++++- requirements.yml | 2 ++ tests/smoke_configs.py | 2 +- 7 files changed, 55 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 30e1a38..044339c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ .settings *.deb *.pyc +*.jar roles/tkuhlman.* roles/stympy.influxdb ansible.cfg diff --git a/README.md b/README.md index fed1075..b8e36fc 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ - [Smoke test](#smoke-test) - [Updating](#updating) - [Running behind a Web Proxy](#running-behind-a-web-proxy) + - [Running with Vertica][#running-with-vertica] - [Advanced Usage](#advanced-usage) - [Access information](#access-information) - [Internal Endpoints](#internal-endpoints) @@ -100,6 +101,25 @@ VM to use them also. It is important that 192.168.10.4, 192.168.10.5, 127.0.0.1 vagrant plugin install vagrant-proxyconf ``` + +## Running with Vertica +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](https://my.vertica.com/download-community-edition/). + +Place the jdbc driver and debian in the home directory of vagrant with the names of: + +vertica_jdbc.jar +vertica.deb + +Set the environment variable USE_VERTICA to true and then run vagrant up. + +``` +export USE_VERTICA=true +vagrant up +``` + + # Advanced Usage ## Access information - Your host OS home dir is synced to `/vagrant_home` on the VM. @@ -156,6 +176,8 @@ your local ansible configuration (~/.ansible.cfg or a personal ansible.cfg in th Next run `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'`. + ### Editing Ansible Configuration 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, `mini-mon.yml` and `devstack.yml`. diff --git a/Vagrantfile b/Vagrantfile index 294f97a..d6a7bd2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -51,6 +51,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| mm.vm.provision "ansible" do |ansible| ansible.playbook = "mini-mon.yml" ansible.raw_arguments = ['-T 30', '-e pipelining=True'] + if ENV["USE_VERTICA"] + ansible.extra_vars = { database_type: "vertica"} + else + ansible.extra_vars = { database_type: "influxdb"} + end end end diff --git a/host_vars/mini-mon b/host_vars/mini-mon index a8d7afb..2f6a0ed 100644 --- a/host_vars/mini-mon +++ b/host_vars/mini-mon @@ -17,12 +17,27 @@ nimbus_host: "{{mini_mon}}" percona_package: percona-xtradb-cluster-56 smtp_host: localhost storm_worker_ports: [6701, 6702] +vertica_package_location: /vagrant/vertica.deb +vertica_jdbc_location: /vagrant/vertica_jdbc.jar +vertica_ssh_key_location: /vagrant +vertica_url: "jdbc:vertica://localhost:5433/mon" zookeeper_hosts: "{{mini_mon}}:2181" # common credentials influxdb_users: mon_api: password mon_persister: password +vertica_dbadmin_password: password +vertica_users: + - username: monitor + password: password + role: monitor + - username: mon_api + password: password + role: monasca_api + - username: mon_persister + password: password + role: monasca_persister keystone_admin: admin keystone_admin_password: "" keystone_auth_method: token diff --git a/mini-mon.yml b/mini-mon.yml index e0b7fb9..9c68226 100644 --- a/mini-mon.yml +++ b/mini-mon.yml @@ -1,3 +1,10 @@ +- name: Check if database type is set + hosts: mini-mon + tasks: + - name: Check for database_type + fail: msg="Must set database type when running this playbook. To pass via command line use -e." + when: database_type is not defined + - name: Installs DBs, kafka and other core dependencies. hosts: mini-mon sudo: yes @@ -18,8 +25,9 @@ roles: - {role: zookeeper, tags: [zookeeper]} - {role: kafka, tags: [kafka]} - - {role: influxdb, tags: [influxdb]} + - {role: influxdb, when: database_type == 'influxdb', tags: [influxdb]} - {role: percona, tags: [mysql, percona]} + - {role: vertica, when: database_type == 'vertica', tags: [vertica]} - name: Sets up schema and install Monasca apps hosts: mini-mon diff --git a/requirements.yml b/requirements.yml index 87d4abe..7dbe97c 100644 --- a/requirements.yml +++ b/requirements.yml @@ -26,3 +26,5 @@ name: zookeeper - src: https://github.com/hpcloud-mon/ansible-influxdb name: influxdb +- src: mhoppal.vertica + name: vertica diff --git a/tests/smoke_configs.py b/tests/smoke_configs.py index 74f3915..aff5b37 100644 --- a/tests/smoke_configs.py +++ b/tests/smoke_configs.py @@ -8,7 +8,7 @@ system_vars = { 'default': { # the default configuration, assumes monasca-vagrant setup 'expected_processes': ('monasca-persister', 'monasca-notification', 'kafka', 'zookeeper.jar', 'monasca-api', - 'influxdb', 'apache-storm', 'mysqld'), + 'apache-storm', 'mysqld'), 'mail_host': 'localhost', 'metric_host': subprocess.check_output(['hostname', '-f']).strip()}, }