aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Ewald <mewald@evoila.de>2016-07-27 06:23:29 +0000
committerzhubingbing <1392607554@qq.com>2016-09-02 05:30:08 +0000
commit49f7359b0ce55cec28b258fc964b1bbc3200fe29 (patch)
tree647d7302d7078c36d8eb4043222f36977cda9ec8
parentb6c40d9deb40404aa83b9e391d12ab1de3eae720 (diff)
downloadkolla-49f7359b0ce55cec28b258fc964b1bbc3200fe29.tar.gz
kolla-49f7359b0ce55cec28b258fc964b1bbc3200fe29.zip
Added influxdb role
Added ansible role for influxdb Introduced host groups for monitoring and influxdb and assign role Monitoring is deployed on a separate node called monitoring01 by default Co-Authored-By: zhubingbing <zhubingbing10@gmail.com> Change-Id: If2465a14b18c6c3fd657af587a0b85f6b7a0191a Partially-Implements: Blueprint performance-monitoring
-rw-r--r--ansible/group_vars/all.yml4
-rw-r--r--ansible/inventory/all-in-one5
-rw-r--r--ansible/inventory/multinode6
-rw-r--r--ansible/roles/influxdb/defaults/main.yml9
-rw-r--r--ansible/roles/influxdb/meta/main.yml3
-rw-r--r--ansible/roles/influxdb/tasks/config.yml23
-rw-r--r--ansible/roles/influxdb/tasks/deploy.yml4
-rw-r--r--ansible/roles/influxdb/tasks/do_reconfigure.yml47
-rw-r--r--ansible/roles/influxdb/tasks/main.yml2
-rw-r--r--ansible/roles/influxdb/tasks/pull.yml7
-rw-r--r--ansible/roles/influxdb/tasks/reconfigure.yml4
-rw-r--r--ansible/roles/influxdb/tasks/start.yml13
-rw-r--r--ansible/roles/influxdb/tasks/upgrade.yml5
-rw-r--r--ansible/roles/influxdb/templates/influxdb.conf.j257
-rw-r--r--ansible/roles/influxdb/templates/influxdb.json.j211
-rw-r--r--ansible/site.yml6
-rw-r--r--etc/kolla/globals.yml1
17 files changed, 207 insertions, 0 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 583c2b84e..7be8e415b 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -182,6 +182,9 @@ manila_api_port: "8786"
watcher_api_port: "9322"
+influxdb_admin_port: "8083"
+influxdb_http_port: "8086"
+
public_protocol: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}"
internal_protocol: "http"
admin_protocol: "http"
@@ -232,6 +235,7 @@ enable_cinder_backend_lvm: "no"
enable_congress: "no"
enable_heat: "yes"
enable_horizon: "yes"
+enable_influxdb: "no"
enable_ironic: "no"
enable_magnum: "no"
enable_manila: "no"
diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one
index ac2835774..c18362a61 100644
--- a/ansible/inventory/all-in-one
+++ b/ansible/inventory/all-in-one
@@ -12,6 +12,8 @@ localhost ansible_connection=local
[storage]
localhost ansible_connection=local
+[monitoring]
+localhost ansible_connection=local
# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.
@@ -75,6 +77,9 @@ storage
[ironic:children]
control
+[influxdb:children]
+monitoring
+
[magnum:children]
control
diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode
index dcdcdc7d0..682afab69 100644
--- a/ansible/inventory/multinode
+++ b/ansible/inventory/multinode
@@ -17,6 +17,9 @@ network01
[compute]
compute01
+[monitoring]
+monitoring01
+
# When compute nodes and control nodes use different interfaces,
# you can specify "api_interface" and another interfaces like below:
#compute01 neutron_external_interface=eth0 api_interface=em1 storage_interface=em1 tunnel_interface=em1
@@ -32,6 +35,9 @@ storage
# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.
+[influxdb:children]
+monitoring
+
[kibana:children]
control
diff --git a/ansible/roles/influxdb/defaults/main.yml b/ansible/roles/influxdb/defaults/main.yml
new file mode 100644
index 000000000..4633af3e2
--- /dev/null
+++ b/ansible/roles/influxdb/defaults/main.yml
@@ -0,0 +1,9 @@
+---
+project_name: "influxdb"
+
+####################
+# Docker
+####################
+influxdb_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-influxdb"
+influxdb_tag: "{{ openstack_release }}"
+influxdb_image_full: "{{ influxdb_image }}:{{ influxdb_tag }}"
diff --git a/ansible/roles/influxdb/meta/main.yml b/ansible/roles/influxdb/meta/main.yml
new file mode 100644
index 000000000..6b4fff8fe
--- /dev/null
+++ b/ansible/roles/influxdb/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - { role: common }
diff --git a/ansible/roles/influxdb/tasks/config.yml b/ansible/roles/influxdb/tasks/config.yml
new file mode 100644
index 000000000..f9b7544f8
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/config.yml
@@ -0,0 +1,23 @@
+---
+- name: Ensuring config directories exist
+ file:
+ path: "{{ node_config_directory }}/influxdb"
+ state: "directory"
+ recurse: yes
+ when: inventory_hostname in groups['influxdb']
+
+- name: Copying over config.json files
+ template:
+ src: "{{ item }}.json.j2"
+ dest: "{{ node_config_directory }}/influxdb/config.json"
+ when: inventory_hostname in groups['influxdb']
+ with_items:
+ - influxdb
+
+- name: Copying over influxdb config file
+ template:
+ src: "{{ role_path }}/templates/{{ item }}.conf.j2"
+ dest: "{{ node_config_directory }}/influxdb/influxdb.conf"
+ when: inventory_hostname in groups['influxdb']
+ with_items:
+ - influxdb
diff --git a/ansible/roles/influxdb/tasks/deploy.yml b/ansible/roles/influxdb/tasks/deploy.yml
new file mode 100644
index 000000000..1f16915ad
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/deploy.yml
@@ -0,0 +1,4 @@
+---
+- include: config.yml
+
+- include: start.yml
diff --git a/ansible/roles/influxdb/tasks/do_reconfigure.yml b/ansible/roles/influxdb/tasks/do_reconfigure.yml
new file mode 100644
index 000000000..6049df474
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/do_reconfigure.yml
@@ -0,0 +1,47 @@
+---
+- name: Ensuring the containers up
+ kolla_docker:
+ name: "influxdb"
+ action: "get_container_state"
+ register: container_state
+ failed_when: container_state.Running == false
+ when: inventory_hostname in groups['influxdb']
+
+- include: config.yml
+
+- name: Check the configs
+ command: docker exec influxdb /usr/local/bin/kolla_set_configs --check
+ changed_when: false
+ failed_when: false
+ register: check_results
+ when: inventory_hostname in groups['influxdb']
+
+# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS'
+# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE',
+# just remove the container and start again
+- name: Containers config strategy
+ kolla_docker:
+ name: "influxdb"
+ action: "get_container_env"
+ register: container_envs
+ when: inventory_hostname in groups['influxdb']
+
+- name: Remove the containers
+ kolla_docker:
+ name: "influxdb"
+ action: "remove_container"
+ register: remove_containers
+ when:
+ - config_strategy == "COPY_ONCE"
+ - inventory_hostname in groups['influxdb']
+
+- include: start.yml
+ when: remove_containers.changed
+
+- name: Restart containers
+ kolla_docker:
+ name: "influxdb"
+ action: "restart_container"
+ when:
+ - config_strategy == 'COPY_ALWAYS'
+ - inventory_hostname in groups['influxdb']
diff --git a/ansible/roles/influxdb/tasks/main.yml b/ansible/roles/influxdb/tasks/main.yml
new file mode 100644
index 000000000..b017e8b4a
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- include: "{{ action }}.yml"
diff --git a/ansible/roles/influxdb/tasks/pull.yml b/ansible/roles/influxdb/tasks/pull.yml
new file mode 100644
index 000000000..c611eebd4
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/pull.yml
@@ -0,0 +1,7 @@
+---
+- name: Pulling influxdb image
+ kolla_docker:
+ action: "pull_image"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ influxdb_image_full }}"
+ when: inventory_hostname in groups['influxdb']
diff --git a/ansible/roles/influxdb/tasks/reconfigure.yml b/ansible/roles/influxdb/tasks/reconfigure.yml
new file mode 100644
index 000000000..8be80caa5
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/reconfigure.yml
@@ -0,0 +1,4 @@
+---
+- include: do_reconfigure.yml
+ serial: "30%"
+ when: inventory_hostname in groups['influxdb']
diff --git a/ansible/roles/influxdb/tasks/start.yml b/ansible/roles/influxdb/tasks/start.yml
new file mode 100644
index 000000000..1a98e7123
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/start.yml
@@ -0,0 +1,13 @@
+---
+- name: Starting influxdb container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ influxdb_image_full }}"
+ name: "influxdb"
+ volumes:
+ - "{{ node_config_directory }}/influxdb/:{{ container_config_directory }}/:ro"
+ - "/etc/localtime:/etc/localtime:ro"
+ - "influxdb:/var/lib/influxdb"
+ - "kolla_logs:/var/log/kolla/"
+ when: inventory_hostname in groups['influxdb']
diff --git a/ansible/roles/influxdb/tasks/upgrade.yml b/ansible/roles/influxdb/tasks/upgrade.yml
new file mode 100644
index 000000000..4586b4fab
--- /dev/null
+++ b/ansible/roles/influxdb/tasks/upgrade.yml
@@ -0,0 +1,5 @@
+---
+- include: config.yml
+
+- include: start.yml
+ serial: "30%"
diff --git a/ansible/roles/influxdb/templates/influxdb.conf.j2 b/ansible/roles/influxdb/templates/influxdb.conf.j2
new file mode 100644
index 000000000..cded6fbe6
--- /dev/null
+++ b/ansible/roles/influxdb/templates/influxdb.conf.j2
@@ -0,0 +1,57 @@
+reporting-disabled = false
+[logging]
+level = "info"
+file = "/var/log/kolla/influxdb/influxdb.log"
+[meta]
+ dir = "/var/lib/influxdb/meta"
+ retention-autocreate = true
+ logging-enabled = true
+ pprof-enabled = false
+ lease-duration = "1m0s"
+[data]
+ enabled = true
+ dir = "/var/lib/influxdb/data"
+ wal-dir = "/var/lib/influxdb/wal"
+ wal-logging-enabled = true
+ data-logging-enabled = true
+[cluster]
+ shard-writer-timeout = "5s"
+ write-timeout = "10s"
+ max-concurrent-queries = 0
+ query-timeout = "0s"
+ max-select-point = 0
+ max-select-series = 0
+ max-select-buckets = 0
+[retention]
+ enabled = true
+ check-interval = "30m"
+[shard-precreation]
+ enabled = true
+ check-interval = "10m"
+ advance-period = "30m"
+[monitor]
+ store-enabled = true
+ store-database = "_internal"
+ store-interval = "10s"
+[admin]
+ enabled = true
+ bind-address = "{{ api_interface_address }}:{{ influxdb_admin_port }}"
+ https-enabled = false
+[http]
+ enabled = true
+ bind-address = "{{ api_interface_address }}:{{ influxdb_http_port }}"
+ auth-enabled = false
+ log-enabled = true
+ write-tracing = false
+ pprof-enabled = false
+ https-enabled = false
+ max-row-limit = 10000
+[[graphite]]
+ enabled = false
+[[opentsdb]]
+ enabled = false
+[[udp]]
+ enabled = false
+[continuous_queries]
+ log-enabled = true
+ enabled = true
diff --git a/ansible/roles/influxdb/templates/influxdb.json.j2 b/ansible/roles/influxdb/templates/influxdb.json.j2
new file mode 100644
index 000000000..2c4c6b3b0
--- /dev/null
+++ b/ansible/roles/influxdb/templates/influxdb.json.j2
@@ -0,0 +1,11 @@
+{
+ "command": "/usr/bin/influxd -config /etc/influxdb/influxdb.conf",
+ "config_files": [
+ {
+ "source": "{{ container_config_directory }}/influxdb.conf",
+ "dest": "/etc/influxdb/influxdb.conf",
+ "owner": "influxdb",
+ "perm": "0600"
+ }
+ ]
+}
diff --git a/ansible/site.yml b/ansible/site.yml
index 5508c4f22..75ae3837a 100644
--- a/ansible/site.yml
+++ b/ansible/site.yml
@@ -14,6 +14,12 @@
tags: elasticsearch,
when: enable_elasticsearch | bool }
+- hosts: influxdb
+ roles:
+ - { role: influxdb,
+ tags: influxdb,
+ when: enable_influxdb | bool }
+
- hosts: haproxy
roles:
- { role: haproxy,
diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml
index bef77a1e2..65bd137ff 100644
--- a/etc/kolla/globals.yml
+++ b/etc/kolla/globals.yml
@@ -130,6 +130,7 @@ kolla_internal_vip_address: "10.10.10.254"
#enable_congress: "no"
#enable_heat: "yes"
#enable_horizon: "yes"
+#enable_influxdb: "no"
#enable_ironic: "no"
#enable_magnum: "no"
#enable_manila: "no"