Add support for mongodb backend in devstack plugin

Change-Id: I0cb1b339aeac471f23092b844a7466266c6c2451
This commit is contained in:
Slawek Kaplonski 2018-12-04 22:22:53 +01:00
parent 05a0ac4155
commit de7e34f1db
1 changed files with 17 additions and 0 deletions

View File

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