Update devstack plugin
* Current After devstack/stack.sh is completed, the monasca-analytics service starts automatically. This service runs "Alert Fatigue Management" example using Markov chain recipe. * Issue This example keep running until kill the process. Therefore, user can not manually run the new example process after creating devstack env. * Solve Do not automatically start "Alert Fatigue Management" example. And, remove the monasca-analytics service which is no longer necessary. Change-Id: Ia37563c5b213d96f82f3361f33df135fcf5ad41c
This commit is contained in:
parent
ecf75f1919
commit
8707a01ab1
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"version": 1,
|
||||
"disable_existing_loggers": false,
|
||||
"formatters": {
|
||||
"standard": {
|
||||
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s"
|
||||
}
|
||||
},
|
||||
"handlers": {
|
||||
"default": {
|
||||
"level": "DEBUG",
|
||||
"class": "logging.FileHandler",
|
||||
"filename": "/var/log/monasca/analytics/monasca_analytics.log"
|
||||
"formatter": "standard"
|
||||
}
|
||||
},
|
||||
"loggers": {
|
||||
"": {
|
||||
"handlers": ["default"],
|
||||
"level": "DEBUG",
|
||||
"propagate": true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,114 +0,0 @@
|
|||
{
|
||||
"spark_config": {
|
||||
"appName": "testApp",
|
||||
"streaming": {
|
||||
"batch_interval": 1
|
||||
}
|
||||
},
|
||||
"server": {
|
||||
"port": 3000,
|
||||
"debug": false
|
||||
},
|
||||
"sources": {
|
||||
"src1": {
|
||||
"module": "CloudMarkovChainSource",
|
||||
"params": {
|
||||
"server_sleep_in_seconds": 0.01
|
||||
},
|
||||
"transitions": {
|
||||
"web_service": {
|
||||
"run=>slow": {
|
||||
"0": 0.001,
|
||||
"8": 0.02,
|
||||
"12": 0.07,
|
||||
"14": 0.07,
|
||||
"22": 0.03,
|
||||
"24": 0.001
|
||||
},
|
||||
"slow=>run": {
|
||||
"0": 0.99,
|
||||
"8": 0.7,
|
||||
"12": 0.1,
|
||||
"14": 0.1,
|
||||
"22": 0.8,
|
||||
"24": 0.99
|
||||
},
|
||||
"stop=>run": 0.7
|
||||
},
|
||||
"host": {
|
||||
"on=>off": 0.005,
|
||||
"off=>on": 0.5
|
||||
},
|
||||
"switch": {
|
||||
"on=>off": 0.01,
|
||||
"off=>on": 0.7
|
||||
}
|
||||
},
|
||||
"triggers": {
|
||||
"support": {
|
||||
"get_called": {
|
||||
"0": 0.1,
|
||||
"8": 0.2,
|
||||
"12": 0.8,
|
||||
"14": 0.8,
|
||||
"22": 0.5,
|
||||
"24": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
"graph": {
|
||||
"h1:host": ["s1"],
|
||||
"h2:host": ["s1"],
|
||||
"s1:switch": [],
|
||||
"w1:web_service": ["h1"],
|
||||
"w2:web_service": ["h2"]
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
"ingestors": {
|
||||
"ing1": {
|
||||
"module": "CloudIngestor"
|
||||
}
|
||||
},
|
||||
"smls": {
|
||||
"sml1": {
|
||||
"module": "LiNGAM",
|
||||
"params": {
|
||||
"threshold": 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
"voters": {
|
||||
"vot1": {
|
||||
"module": "PickIndexVoter",
|
||||
"params": {
|
||||
"index": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"sinks": {
|
||||
"snk1": {
|
||||
"module": "KafkaSink",
|
||||
"params": {
|
||||
"host": "localhost",
|
||||
"port": 9092,
|
||||
"topic": "transformed_alerts"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ldps": {
|
||||
"ldp1": {
|
||||
"module": "CloudCausalityLDP"
|
||||
}
|
||||
},
|
||||
"connections": {
|
||||
"src1": ["ing1", "ldp1"],
|
||||
"sml1": ["vot1"],
|
||||
"ing1": [],
|
||||
"vot1": ["ldp1"],
|
||||
"ldp1": ["snk1"],
|
||||
"snk1": []
|
||||
},
|
||||
"feedback": {}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
#
|
||||
# Copyright 2016 FUJITSU LIMITED
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Monasca Analytics Daemon
|
||||
After=zookeeper.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
LimitNOFILE=32768
|
||||
ExecStart=/etc/monasca/analytics/init/start-monasca-analytics.sh
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,29 +0,0 @@
|
|||
#
|
||||
# Copyright 2016 FUJITSU LIMITED
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
description "Monasca Analytics"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
|
||||
respawn
|
||||
|
||||
limit nofile 32768 32768
|
||||
|
||||
expect daemon
|
||||
|
||||
exec /etc/monasca/analytics/init/start-monasca-analytics.sh
|
|
@ -1,21 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright 2016 FUJITSU LIMITED
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
start-stop-daemon -c monasca-analytics:monasca-analytics -m\
|
||||
--pidfile /var/run/monasca/analytics/analytics.pid \
|
||||
--start --exec python /opt/stack/monasca-analytics/run.py -p /opt/spark/spark-1.6.1/ -c /etc/monasca/analytics/markov_source_config.json -l /etc/monasca/analytics/logging.json
|
|
@ -134,39 +134,6 @@ function unistall_pkgs {
|
|||
sudo rm -rf $SPARK_DIR
|
||||
}
|
||||
|
||||
###
|
||||
function install_monasca_analytics {
|
||||
echo_summary "Install Monasca-analytics"
|
||||
|
||||
sudo groupadd --system monasca-analytics || true
|
||||
sudo useradd --system -g monasca-analytics monasca-analytics || true
|
||||
|
||||
create_monasca_analytics_directories
|
||||
copy_monasca_analytics_files
|
||||
}
|
||||
|
||||
###
|
||||
function create_monasca_analytics_directories {
|
||||
|
||||
MONASCA_ANALYTICS_DIRECTORIES=("/var/log/monasca/analytics" "/etc/monasca/analytics/init")
|
||||
|
||||
for MONASCA_ANALYTICS_DIRECTORY in "${MONASCA_ANALYTICS_DIRECTORIES[@]}"
|
||||
do
|
||||
sudo mkdir -p ${MONASCA_ANALYTICS_DIRECTORY}
|
||||
sudo chown monasca-analytics:monasca-analytics ${MONASCA_ANALYTICS_DIRECTORY}
|
||||
sudo chmod 755 ${MONASCA_ANALYTICS_DIRECTORY}
|
||||
done
|
||||
}
|
||||
|
||||
###
|
||||
function copy_monasca_analytics_files {
|
||||
sudo cp -f "${MONASCA_ANALYTICS_BASE}"/devstack/files/monasca-analytics/markov_source_config.json /etc/monasca/analytics
|
||||
sudo cp -f "${MONASCA_ANALYTICS_BASE}"/devstack/files/monasca-analytics/logging.json /etc/monasca/analytics
|
||||
sudo cp -f "${MONASCA_ANALYTICS_BASE}"/devstack/files/monasca-analytics/monasca_analytics_init.conf /etc/init/monasca-analytics.conf
|
||||
sudo cp -f "${MONASCA_ANALYTICS_BASE}"/devstack/files/monasca-analytics/start-monasca-analytics.sh /etc/monasca/analytics/init/.
|
||||
sudo chmod +x /etc/monasca/analytics/init/start-monasca-analytics.sh
|
||||
}
|
||||
|
||||
###
|
||||
function install_pkg {
|
||||
## JDK
|
||||
|
@ -200,12 +167,12 @@ END
|
|||
LENGTH_FOR_HOST=`expr match "$http_proxy" 'http://[\.A-Za-z\-]*'`-7
|
||||
sed -e '7,8d' \
|
||||
-e "s/<host><\/host>/<host>${http_proxy:7:$LENGTH_FOR_HOST}<\/host>/g" \
|
||||
${MONASCA_ANALYTICS_BASE}/devstack/files/monasca-analytics/settings.xml > ~/.m2/settings.xml
|
||||
${MONASCA_ANALYTICS_BASE}/devstack/files/maven/settings.xml > ~/.m2/settings.xml
|
||||
else
|
||||
sed -e "s/<username><\/username>/<username>${HTTP_PROXY_USER_NAME}<\/username>/g" \
|
||||
-e "s/<password><\/password>/<password>${HTTP_PROXY_PASSWORD}<\/password>/g" \
|
||||
-e "s/<host><\/host>/<host>${HTTP_PROXY_HOST}<\/host>/g" \
|
||||
${MONASCA_ANALYTICS_BASE}/devstack/files/monasca-analytics/settings.xml > ~/.m2/settings.xml
|
||||
${MONASCA_ANALYTICS_BASE}/devstack/files/maven/settings.xml > ~/.m2/settings.xml
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -317,11 +284,6 @@ function install_spark {
|
|||
install_kafka
|
||||
}
|
||||
|
||||
###
|
||||
function extra_spark {
|
||||
:
|
||||
}
|
||||
|
||||
###
|
||||
function post_config_monasca_analytics {
|
||||
:
|
||||
|
@ -349,8 +311,6 @@ if is_service_enabled monasca-analytics; then
|
|||
# Perform installation of service source
|
||||
echo_summary "Installing Spark"
|
||||
install_spark
|
||||
echo_summary "Installing Monasca-analytics"
|
||||
install_monasca_analytics
|
||||
|
||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||
# Configure after the other layer 1 and 2 services have been configured
|
||||
|
|
Loading…
Reference in New Issue