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
This commit is contained in:
parent
b6c40d9deb
commit
49f7359b0c
@ -182,6 +182,9 @@ manila_api_port: "8786"
|
|||||||
|
|
||||||
watcher_api_port: "9322"
|
watcher_api_port: "9322"
|
||||||
|
|
||||||
|
influxdb_admin_port: "8083"
|
||||||
|
influxdb_http_port: "8086"
|
||||||
|
|
||||||
public_protocol: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}"
|
public_protocol: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}"
|
||||||
internal_protocol: "http"
|
internal_protocol: "http"
|
||||||
admin_protocol: "http"
|
admin_protocol: "http"
|
||||||
@ -232,6 +235,7 @@ enable_cinder_backend_lvm: "no"
|
|||||||
enable_congress: "no"
|
enable_congress: "no"
|
||||||
enable_heat: "yes"
|
enable_heat: "yes"
|
||||||
enable_horizon: "yes"
|
enable_horizon: "yes"
|
||||||
|
enable_influxdb: "no"
|
||||||
enable_ironic: "no"
|
enable_ironic: "no"
|
||||||
enable_magnum: "no"
|
enable_magnum: "no"
|
||||||
enable_manila: "no"
|
enable_manila: "no"
|
||||||
|
@ -12,6 +12,8 @@ localhost ansible_connection=local
|
|||||||
[storage]
|
[storage]
|
||||||
localhost ansible_connection=local
|
localhost ansible_connection=local
|
||||||
|
|
||||||
|
[monitoring]
|
||||||
|
localhost ansible_connection=local
|
||||||
|
|
||||||
# You can explicitly specify which hosts run each project by updating the
|
# You can explicitly specify which hosts run each project by updating the
|
||||||
# groups in the sections below. Common services are grouped together.
|
# groups in the sections below. Common services are grouped together.
|
||||||
@ -75,6 +77,9 @@ storage
|
|||||||
[ironic:children]
|
[ironic:children]
|
||||||
control
|
control
|
||||||
|
|
||||||
|
[influxdb:children]
|
||||||
|
monitoring
|
||||||
|
|
||||||
[magnum:children]
|
[magnum:children]
|
||||||
control
|
control
|
||||||
|
|
||||||
|
@ -17,6 +17,9 @@ network01
|
|||||||
[compute]
|
[compute]
|
||||||
compute01
|
compute01
|
||||||
|
|
||||||
|
[monitoring]
|
||||||
|
monitoring01
|
||||||
|
|
||||||
# When compute nodes and control nodes use different interfaces,
|
# When compute nodes and control nodes use different interfaces,
|
||||||
# you can specify "api_interface" and another interfaces like below:
|
# you can specify "api_interface" and another interfaces like below:
|
||||||
#compute01 neutron_external_interface=eth0 api_interface=em1 storage_interface=em1 tunnel_interface=em1
|
#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
|
# You can explicitly specify which hosts run each project by updating the
|
||||||
# groups in the sections below. Common services are grouped together.
|
# groups in the sections below. Common services are grouped together.
|
||||||
|
[influxdb:children]
|
||||||
|
monitoring
|
||||||
|
|
||||||
[kibana:children]
|
[kibana:children]
|
||||||
control
|
control
|
||||||
|
|
||||||
|
9
ansible/roles/influxdb/defaults/main.yml
Normal file
9
ansible/roles/influxdb/defaults/main.yml
Normal file
@ -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 }}"
|
3
ansible/roles/influxdb/meta/main.yml
Normal file
3
ansible/roles/influxdb/meta/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- { role: common }
|
23
ansible/roles/influxdb/tasks/config.yml
Normal file
23
ansible/roles/influxdb/tasks/config.yml
Normal file
@ -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
|
4
ansible/roles/influxdb/tasks/deploy.yml
Normal file
4
ansible/roles/influxdb/tasks/deploy.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
- include: config.yml
|
||||||
|
|
||||||
|
- include: start.yml
|
47
ansible/roles/influxdb/tasks/do_reconfigure.yml
Normal file
47
ansible/roles/influxdb/tasks/do_reconfigure.yml
Normal file
@ -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']
|
2
ansible/roles/influxdb/tasks/main.yml
Normal file
2
ansible/roles/influxdb/tasks/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include: "{{ action }}.yml"
|
7
ansible/roles/influxdb/tasks/pull.yml
Normal file
7
ansible/roles/influxdb/tasks/pull.yml
Normal file
@ -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']
|
4
ansible/roles/influxdb/tasks/reconfigure.yml
Normal file
4
ansible/roles/influxdb/tasks/reconfigure.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
- include: do_reconfigure.yml
|
||||||
|
serial: "30%"
|
||||||
|
when: inventory_hostname in groups['influxdb']
|
13
ansible/roles/influxdb/tasks/start.yml
Normal file
13
ansible/roles/influxdb/tasks/start.yml
Normal file
@ -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']
|
5
ansible/roles/influxdb/tasks/upgrade.yml
Normal file
5
ansible/roles/influxdb/tasks/upgrade.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- include: config.yml
|
||||||
|
|
||||||
|
- include: start.yml
|
||||||
|
serial: "30%"
|
57
ansible/roles/influxdb/templates/influxdb.conf.j2
Normal file
57
ansible/roles/influxdb/templates/influxdb.conf.j2
Normal file
@ -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
|
11
ansible/roles/influxdb/templates/influxdb.json.j2
Normal file
11
ansible/roles/influxdb/templates/influxdb.json.j2
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -14,6 +14,12 @@
|
|||||||
tags: elasticsearch,
|
tags: elasticsearch,
|
||||||
when: enable_elasticsearch | bool }
|
when: enable_elasticsearch | bool }
|
||||||
|
|
||||||
|
- hosts: influxdb
|
||||||
|
roles:
|
||||||
|
- { role: influxdb,
|
||||||
|
tags: influxdb,
|
||||||
|
when: enable_influxdb | bool }
|
||||||
|
|
||||||
- hosts: haproxy
|
- hosts: haproxy
|
||||||
roles:
|
roles:
|
||||||
- { role: haproxy,
|
- { role: haproxy,
|
||||||
|
@ -130,6 +130,7 @@ kolla_internal_vip_address: "10.10.10.254"
|
|||||||
#enable_congress: "no"
|
#enable_congress: "no"
|
||||||
#enable_heat: "yes"
|
#enable_heat: "yes"
|
||||||
#enable_horizon: "yes"
|
#enable_horizon: "yes"
|
||||||
|
#enable_influxdb: "no"
|
||||||
#enable_ironic: "no"
|
#enable_ironic: "no"
|
||||||
#enable_magnum: "no"
|
#enable_magnum: "no"
|
||||||
#enable_manila: "no"
|
#enable_manila: "no"
|
||||||
|
Loading…
Reference in New Issue
Block a user