Merge "Added influxdb role"

This commit is contained in:
Jenkins 2016-09-08 14:06:16 +00:00 committed by Gerrit Code Review
commit 15228232e1
17 changed files with 207 additions and 0 deletions

View File

@ -188,6 +188,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"
@ -240,6 +243,7 @@ enable_congress: "no"
enable_gnocchi: "no"
enable_heat: "yes"
enable_horizon: "yes"
enable_influxdb: "no"
enable_ironic: "no"
enable_magnum: "no"
enable_manila: "no"

View File

@ -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.
@ -78,6 +80,9 @@ storage
[ironic:children]
control
[influxdb:children]
monitoring
[magnum:children]
control

View File

@ -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

View 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 }}"

View File

@ -0,0 +1,3 @@
---
dependencies:
- { role: common }

View 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

View File

@ -0,0 +1,4 @@
---
- include: config.yml
- include: start.yml

View 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']

View File

@ -0,0 +1,2 @@
---
- include: "{{ action }}.yml"

View 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']

View File

@ -0,0 +1,4 @@
---
- include: do_reconfigure.yml
serial: "30%"
when: inventory_hostname in groups['influxdb']

View 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']

View File

@ -0,0 +1,5 @@
---
- include: config.yml
- include: start.yml
serial: "30%"

View 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

View 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"
}
]
}

View File

@ -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,

View File

@ -122,6 +122,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"