From 4cf7ff9fa22fa4f38ddde5df1b8ad17c7475f0a2 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Fri, 14 Feb 2020 15:24:06 +0000 Subject: [PATCH] Introduce influxdb_datadir_volume This allows you to tune the performance of InfluxDB by locating the volume on a drive that is separate to the default docker storage. Change-Id: Iea555a2702b225b30f5d7035b8a703d4f3376ee7 --- ansible/group_vars/all.yml | 1 + ansible/roles/destroy/tasks/cleanup_host.yml | 1 + ansible/roles/influxdb/defaults/main.yml | 2 +- .../logging-and-monitoring/index.rst | 1 + .../logging-and-monitoring/influxdb-guide.rst | 28 +++++++++++++++++++ ...luxdb-datadir-volume-68200f92a3c5d633.yaml | 6 ++++ tools/cleanup-host | 5 ++++ 7 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 doc/source/reference/logging-and-monitoring/influxdb-guide.rst create mode 100644 releasenotes/notes/add-variable-influxdb-datadir-volume-68200f92a3c5d633.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index c450688329..06a01dd287 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1041,6 +1041,7 @@ enable_vitrage_prometheus_datasource: "{{ enable_prometheus | bool }}" # InfluxDB options #################### influxdb_address: "{{ kolla_internal_fqdn }}" +influxdb_datadir_volume: "influxdb" ######################### # Internal Image options diff --git a/ansible/roles/destroy/tasks/cleanup_host.yml b/ansible/roles/destroy/tasks/cleanup_host.yml index 539708c2aa..17dba02cb7 100644 --- a/ansible/roles/destroy/tasks/cleanup_host.yml +++ b/ansible/roles/destroy/tasks/cleanup_host.yml @@ -9,6 +9,7 @@ glance_file_datadir_volume: "{{ glance_file_datadir_volume }}" nova_instance_datadir_volume: "{{ nova_instance_datadir_volume }}" gnocchi_metric_datadir_volume: "{{ gnocchi_metric_datadir_volume }}" + influxdb_datadir_volume: "{{ influxdb_datadir_volume }}" kolla_internal_vip_address: "{{ kolla_internal_vip_address }}" kolla_external_vip_address: "{{ kolla_external_vip_address }}" kolla_dev_repos_directory: "{{ kolla_dev_repos_directory }}" diff --git a/ansible/roles/influxdb/defaults/main.yml b/ansible/roles/influxdb/defaults/main.yml index f18f152160..d6d1ca8f4c 100644 --- a/ansible/roles/influxdb/defaults/main.yml +++ b/ansible/roles/influxdb/defaults/main.yml @@ -37,6 +37,6 @@ influxdb_dimensions: "{{ default_container_dimensions }}" influxdb_default_volumes: - "{{ node_config_directory }}/influxdb/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - - "influxdb:/var/lib/influxdb" + - "{{ influxdb_datadir_volume }}:/var/lib/influxdb" - "kolla_logs:/var/log/kolla/" influxdb_extra_volumes: "{{ default_extra_volumes }}" diff --git a/doc/source/reference/logging-and-monitoring/index.rst b/doc/source/reference/logging-and-monitoring/index.rst index 9d14ac36ca..a2cfbd0c9f 100644 --- a/doc/source/reference/logging-and-monitoring/index.rst +++ b/doc/source/reference/logging-and-monitoring/index.rst @@ -9,6 +9,7 @@ logging and monitoring services available in kolla. :maxdepth: 1 central-logging-guide + influxdb-guide monasca-guide osprofiler-guide prometheus-guide diff --git a/doc/source/reference/logging-and-monitoring/influxdb-guide.rst b/doc/source/reference/logging-and-monitoring/influxdb-guide.rst new file mode 100644 index 0000000000..6bb460d0c6 --- /dev/null +++ b/doc/source/reference/logging-and-monitoring/influxdb-guide.rst @@ -0,0 +1,28 @@ +.. _influxdb-guide: + +=============================== +InfluxDB - Time Series Database +=============================== + +Overview +~~~~~~~~ + +InfluxDB is a time series database developed by InfluxData. It is +possible to deploy a single instance without charge. To use the +clustering features you will require a commercial license. + +InfluxDB +~~~~~~~~ + +The `recommendation `_ +is to use flash storage for InfluxDB. If docker is configured to use +spinning disks by default, or you have some higher performance drives +available, it may be desirable to control where the docker volume is +located. This can be achieved by setting a path for +``influxdb_datadir_volume`` in ``/etc/kolla/globals.yml``: + +.. code-block:: yaml + + influxdb_datadir_volume: /mnt/ssd/influxdb/ + +The default is to use a named volume, ``influxdb``. diff --git a/releasenotes/notes/add-variable-influxdb-datadir-volume-68200f92a3c5d633.yaml b/releasenotes/notes/add-variable-influxdb-datadir-volume-68200f92a3c5d633.yaml new file mode 100644 index 0000000000..6013c9e05f --- /dev/null +++ b/releasenotes/notes/add-variable-influxdb-datadir-volume-68200f92a3c5d633.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds a new variable, ``influxdb_datadir_volume``. This allows you control + where the docker volume for InfluxDB is created. A performance tuning is + to set this to a path on a high performance flash drive. diff --git a/tools/cleanup-host b/tools/cleanup-host index dfffa6157f..25dfc176a8 100755 --- a/tools/cleanup-host +++ b/tools/cleanup-host @@ -63,6 +63,11 @@ if [[ "$gnocchi_metric_datadir_volume" != "gnocchi" && -d "$gnocchi_metric_datad rm -rfv $gnocchi_metric_datadir_volume fi +if [[ "$influxdb_datadir_volume" != "influxdb" && -d "$influxdb_datadir_volume" ]]; then + echo "Removing influxdb volume if it is customzied" + rm -rfv $influxdb_datadir_volume +fi + FOLDER_PATH="/etc/kolla/" if [[ -e "$FOLDER_PATH/ovsdpdk-db/ovs-dpdkctl.sh" ]]; then