summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kurilin <andr.kurilin@gmail.com>2018-12-11 17:13:45 +0200
committerAndrey Kurilin <andr.kurilin@gmail.com>2018-12-13 12:50:07 +0000
commit5bdc7c60c574de96229b226b44d47047d47f596b (patch)
tree77e36961fcdc630a3ca8012bcfce2d1fd9845fca
parent0b878cfd24aef2ff4604c697bf39339c84accc78 (diff)
downloadosprofiler-5bdc7c60c574de96229b226b44d47047d47f596b.tar.gz
[devstack] Add support for elasticsearch backend
Change-Id: I857bb80a702c4875b06e0aa76d6f0e2e1240d87d
-rw-r--r--devstack/lib/osprofiler17
1 files changed, 17 insertions, 0 deletions
diff --git a/devstack/lib/osprofiler b/devstack/lib/osprofiler
index 0627372..d5b75e3 100644
--- a/devstack/lib/osprofiler
+++ b/devstack/lib/osprofiler
@@ -69,6 +69,20 @@ function install_jaeger() {
pip_install jaeger-client
}
+function install_elasticsearch() {
+ if is_ubuntu; then
+ install_package docker.io
+ start_service docker
+ add_user_to_group $STACK_USER docker
+ # https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html#docker-cli-run-dev-mode
+ sg docker -c 'docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:5.6.14'
+ else
+ exit_distro_not_supported "docker.io installation"
+ fi
+
+ pip_install elasticsearch
+}
+
function install_osprofiler_collector() {
if [ -z "$OSPROFILER_COLLECTOR" ]; then
OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"messaging://"}
@@ -78,6 +92,9 @@ function install_osprofiler_collector() {
elif [ "$OSPROFILER_COLLECTOR" == "jaeger" ]; then
install_jaeger
OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"jaeger://localhost:6831"}
+ elif [ "$OSPROFILER_COLLECTOR" == "elasticsearch" ]; then
+ install_elasticsearch
+ OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"elasticsearch://elastic:changeme@localhost:9200"}
else
die $LINENO "OSProfiler collector $OSPROFILER_COLLECTOR is not supported"
fi