Update vertica schema

Change-Id: I36a57c7a759dfa0c59460b2ccde48723816735f8
This commit is contained in:
bklei 2015-05-04 08:17:56 -06:00
parent cc3fc6d611
commit a4e180d2a6
7 changed files with 37 additions and 7 deletions

View File

@ -2,13 +2,22 @@
MIRROR_FILE="/etc/monasca/monasca-persister-mirror.yml"
STORM_FILE="/opt/storm/current/conf/storm.yaml"
VERTICA_FILE="/opt/vertica/config/admintools.conf"
#
# Get the list of monasca services in the order they should be
# started in.
#
get_up_list() {
echo "influxdb zookeeper kafka storm-supervisor"
if [ -e $VERTICA_FILE ]
then
echo "verticad"
else
echo "influxdb"
fi
echo "zookeeper kafka storm-supervisor"
if grep nimbus.host $STORM_FILE | grep -e $(hostname) -e localhost > /dev/null
then
@ -41,7 +50,14 @@ get_down_list() {
echo "monasca-thresh storm-ui storm-nimbus"
fi
echo "storm-supervisor kafka zookeeper influxdb"
echo "storm-supervisor kafka zookeeper"
if [ -e $VERTICA_FILE ]
then
echo "verticad"
else
echo "influxdb"
fi
}
status() {
@ -78,6 +94,7 @@ tail_logs() {
/usr/bin/tail -f /opt/storm/current/logs/*log \
/var/log/monasca/*log \
/var/log/influxdb/*log \
/opt/vertica/log/*log \
/var/log/kafka/*log \
/opt/kafka/logs/*log
}

View File

@ -4,8 +4,10 @@ CREATE TABLE MonAlarms.StateHistory(
id AUTO_INCREMENT,
tenant_id VARCHAR,
alarm_id VARCHAR,
metrics VARCHAR (65000),
old_state VARCHAR,
new_state VARCHAR,
sub_alarms VARCHAR (65000),
reason VARCHAR(65000),
reason_data VARCHAR(65000),
time_stamp TIMESTAMP NOT NULL

View File

@ -4,6 +4,7 @@ GRANT ALL ON TABLE MonMetrics.Measurements TO mon_persister;
GRANT ALL ON TABLE MonMetrics.Definitions TO mon_persister;
GRANT ALL ON TABLE MonMetrics.Dimensions TO mon_persister;
GRANT ALL ON TABLE MonMetrics.DefinitionDimensions TO mon_persister;
GRANT ALL ON TABLE MonAlarms.StateHistory TO mon_persister;
GRANT USAGE ON SCHEMA MonMetrics TO mon_api;
GRANT USAGE ON SCHEMA MonAlarms TO mon_api;

View File

@ -7,6 +7,7 @@ CREATE TABLE MonMetrics.Measurements (
definition_dimensions_id BINARY(20) NOT NULL,
time_stamp TIMESTAMP NOT NULL,
value FLOAT NOT NULL,
value_meta VARCHAR(2048),
PRIMARY KEY(id)
) PARTITION BY EXTRACT('year' FROM time_stamp)*10000 + EXTRACT('month' FROM time_stamp)*100 + EXTRACT('day' FROM time_stamp);
@ -41,13 +42,15 @@ CREATE PROJECTION Measurements_DBD_1_rep_MonMetrics /*+createtype(D)*/
id ENCODING AUTO,
definition_dimensions_id ENCODING RLE,
time_stamp ENCODING DELTAVAL,
value ENCODING AUTO
value ENCODING AUTO,
value_meta ENCODING AUTO
)
AS
SELECT id,
definition_dimensions_id,
time_stamp,
value
value,
value_meta
FROM MonMetrics.Measurements
ORDER BY definition_dimensions_id,
time_stamp,

View File

@ -19,6 +19,9 @@ fi
# create the db
/opt/vertica/bin/admintools -t create_db -s 127.0.0.1 -d mon -p <%= db_admin_password %>
# start the db
/opt/vertica/bin/admintools -t start_db -p <%= db_admin_password %> -d mon
# Add in the schemas
/opt/vertica/bin/vsql -w <%= db_admin_password %> < /var/vertica/mon_schema.sql
/opt/vertica/bin/vsql -w <%= db_admin_password %> < /var/vertica/mon_metrics_schema.sql
@ -30,7 +33,7 @@ fi
/opt/vertica/bin/admintools -t set_restart_policy -d mon -p always
# For ssl support link the cert/key and restart the db
if [ $USE_SSL ]
if [ $USE_SSL == "true" ]
then
ln /var/vertica/server* /var/vertica/catalog/mon/v*/
/opt/vertica/bin/admintools -t stop_db -F -p <%= db_admin_password %> -d mon

View File

@ -22,6 +22,9 @@ nodes=`grep install_opts /opt/vertica/config/admintools.conf | cut -d\ -f 4 |cu
# create the db
/opt/vertica/bin/admintools -t create_db -s $nodes -d mon -p <%= db_admin_password %>
# start the db
/opt/vertica/bin/admintools -t start_db -p <%= db_admin_password %> -d mon
# Add in the schemas
/opt/vertica/bin/vsql -w <%= db_admin_password %> < /var/vertica/mon_schema.sql
/opt/vertica/bin/vsql -w <%= db_admin_password %> < /var/vertica/mon_metrics_schema.sql
@ -32,7 +35,7 @@ nodes=`grep install_opts /opt/vertica/config/admintools.conf | cut -d\ -f 4 |cu
# Set restart policy to ksafe
/opt/vertica/bin/admintools -t set_restart_policy -d mon -p ksafe
if [ $USE_SSL ]
if [ $USE_SSL == "true" ]
then
# For ssl support link the cert/key on each server and restart the db
IFS=','

View File

@ -6,7 +6,8 @@ SELECT set_config_parameter('WarnOnIncompleteStartupPacket', 0);
-- Enable SSL ** Requires a db restart, also the restart will fail of the ssl cert is not in place on the server
-- The certs are placed in the root catalog dir by vertica and should be linked to the correct dir after db creation
-- ln /var/vertica/catalog/server* /var/vertica/catalog/mon/v*/'
SELECT SET_CONFIG_PARAMETER('EnableSSL', '1');
-- TODO ADD DYNAMIC SSL SUPPORT TO MODULE
-- SELECT SET_CONFIG_PARAMETER('EnableSSL', '1');
-- Enable SNMP alerts
SELECT SET_CONFIG_PARAMETER('SnmpTrapsEnabled', 1 );