summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlawek Kaplonski <skaplons@redhat.com>2018-12-04 22:22:53 +0100
committerSlawek Kaplonski <skaplons@redhat.com>2019-01-21 13:03:30 +0100
commitde7e34f1db0b251b59400e202a9855347daf4065 (patch)
tree2d415b1a4d52ea2d7313c25df66ec79130013331
parent05a0ac415581ec197a06c82d45090b12400b9d92 (diff)
downloadosprofiler-de7e34f1db0b251b59400e202a9855347daf4065.tar.gz
Add support for mongodb backend in devstack plugin
Change-Id: I0cb1b339aeac471f23092b844a7466266c6c2451
-rw-r--r--devstack/lib/osprofiler17
1 files changed, 17 insertions, 0 deletions
diff --git a/devstack/lib/osprofiler b/devstack/lib/osprofiler
index d5b75e3..1074c32 100644
--- a/devstack/lib/osprofiler
+++ b/devstack/lib/osprofiler
@@ -83,6 +83,20 @@ function install_elasticsearch() {
pip_install elasticsearch
}
+function install_mongodb {
+ pip_install pymongo
+ if is_ubuntu; then
+ install_package mongodb-server
+ start_service mongodb
+ elif is_fedora; then
+ install_package mongodb
+ install_package mongodb-server
+ start_service mongod
+ else
+ exit_distro_not_supported "mongodb installation"
+ fi
+}
+
function install_osprofiler_collector() {
if [ -z "$OSPROFILER_COLLECTOR" ]; then
OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"messaging://"}
@@ -95,6 +109,9 @@ function install_osprofiler_collector() {
elif [ "$OSPROFILER_COLLECTOR" == "elasticsearch" ]; then
install_elasticsearch
OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"elasticsearch://elastic:changeme@localhost:9200"}
+ elif [ "$OSPROFILER_COLLECTOR" == "mongodb" ]; then
+ install_mongodb
+ OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"mongodb://localhost:27017"}
else
die $LINENO "OSProfiler collector $OSPROFILER_COLLECTOR is not supported"
fi