Make api server have configurable backend db

Change-Id: If7e063dbeea593d15b73c17e823cf0554e3b0294
This commit is contained in:
bklei 2015-05-06 11:16:28 -06:00
parent 4171ea921b
commit 610ab282cc
4 changed files with 12 additions and 16 deletions

View File

@ -2,18 +2,18 @@
MIRROR_FILE="/etc/monasca/monasca-persister-mirror.yml"
STORM_FILE="/opt/storm/current/conf/storm.yaml"
VERTICA_FILE="/opt/vertica/config/admintools.conf"
INFLUXDB_FILE="/etc/opt/influxdb/influxdb.conf"
#
# Get the list of monasca services in the order they should be
# started in.
# started in. Note that we intentionally don't stop/start
# verticad -- vertica doesn't like that. Use adminTools
# for the entire cluster instead.
#
get_up_list() {
if [ -e $VERTICA_FILE ]
if [ -e $INFLUXDB_FILE ]
then
echo "verticad"
else
echo "influxdb"
fi
@ -52,10 +52,8 @@ get_down_list() {
echo "storm-supervisor kafka zookeeper"
if [ -e $VERTICA_FILE ]
if [ -e $INFLUXDB_FILE ]
then
echo "verticad"
else
echo "influxdb"
fi
}

View File

@ -4,6 +4,8 @@
class monasca::api (
$api_user = 'monasca_api',
$blobmirror = undef,
$database_type = 'influxdb',
$db_admin_password = undef,
$gzip_setting = true,
$kafka_brokers = undef,
$keystone_endpoint = undef,

View File

@ -28,7 +28,7 @@ mysql:
checkConnectionOnBorrow: true
databaseConfiguration:
databaseType: influxdb
databaseType: <%= database_type %>
influxDB:
name: mon
@ -40,15 +40,11 @@ influxDB:
user: <%= api_db_user %>
password: <%= api_db_password %>
#
# We're using influxdb -- but can't remove this or things get
# wonky.
#
vertica:
driverClass: com.vertica.jdbc.Driver
url: jdbc:vertica://localhost/mon
url: jdbc:vertica://localhost:5433/mon
user: dbadmin
password: password
password: <%= db_admin_password %>
maxWaitForConnection: 5s
validationQuery: "/* MyService Health Check */ SELECT 1"
minSize: 4

View File

@ -59,7 +59,7 @@ dataSourceFactory:
password: <%= db_admin_password %>
properties:
ssl: false
maxWaitForConnection: 1s
maxWaitForConnection: 5s
validationQuery: "/* MyService Health Check */ SELECT 1"
minSize: 8
maxSize: 41