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" MIRROR_FILE="/etc/monasca/monasca-persister-mirror.yml"
STORM_FILE="/opt/storm/current/conf/storm.yaml" 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 # 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() { get_up_list() {
if [ -e $VERTICA_FILE ] if [ -e $INFLUXDB_FILE ]
then then
echo "verticad"
else
echo "influxdb" echo "influxdb"
fi fi
@ -52,10 +52,8 @@ get_down_list() {
echo "storm-supervisor kafka zookeeper" echo "storm-supervisor kafka zookeeper"
if [ -e $VERTICA_FILE ] if [ -e $INFLUXDB_FILE ]
then then
echo "verticad"
else
echo "influxdb" echo "influxdb"
fi fi
} }

View File

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

View File

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

View File

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