Migrate devstack to xenial

Migrate upstart to systemd.

Change-Id: I351ce88ca8b26e1bdcc6eb61fd41960ad8774ffb
This commit is contained in:
Shinya Kawabata 2016-09-05 17:38:41 +09:00
parent 0ab79b7315
commit 72acb84f02
14 changed files with 272 additions and 209 deletions

View File

@ -26,7 +26,7 @@ Vagrant.configure(2) do |config|
end
config.vm.hostname = "devstack"
config.vm.box = "ubuntu/trusty64"
config.vm.box = "ubuntu/xenial64"
# config.vm.box_check_update = false
config.vm.network "private_network",ip:"192.168.10.6"
config.vm.synced_folder "~/", "/vagrant_home"

View File

@ -0,0 +1,3 @@
# Type deactivate before you use cqlsh.
export CQLSH_NO_BUNDLED=true
export CQLSH_HOST=127.0.0.1

View File

@ -2,12 +2,12 @@
# chkconfig: 2345 80 05
# description: Grafana web server & backend
# processname: grafana
# processname: grafana-server
# config: /etc/grafana/grafana.ini
# pidfile: /var/run/grafana.pid
# pidfile: /var/run/grafana-server.pid
### BEGIN INIT INFO
# Provides: grafana
# Provides: grafana-server
# Required-Start: $all
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5

View File

@ -1,35 +0,0 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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 "Kafka"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
limit nofile 32768 32768
# If zookeeper is running on this box also give it time to start up properly
pre-start script
if [ -e /etc/init.d/zookeeper ]; then
/etc/init.d/zookeeper start || true
fi
end script
# Rather than using setuid/setgid sudo is used because the pre-start task must run as root
exec sudo -Hu kafka -g kafka KAFKA_HEAP_OPTS="-Xmx128m" /opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties

View File

@ -0,0 +1,29 @@
# 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=Kafka
Requires=network.target
After=network.target zookeeper.service
[Service]
User=kafka
Group=kafka
LimitNOFILE=32768:32768
Environment="KAFKA_HEAP_OPTS=-Xmx128m"
ExecStart=/opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -1,11 +1,8 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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
# 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,
@ -17,12 +14,16 @@
# Startup script for the Monasca API
description "Monasca API Python app"
start on runlevel [2345]
[Unit]
Description=Monasca API Java app
Requires=network.target
After=network.target kafka.service influxdb.service mysql.service
console log
respawn
[Service]
User=mon-api
Group=monasca
ExecStart=/usr/bin/java -Dfile.encoding=UTF-8 -Xmx128m -cp /opt/monasca/monasca-api.jar monasca.api.MonApiApplication server /etc/monasca/api-config.yml
Restart=on-failure
setgid monasca
setuid mon-api
exec /opt/monasca-api/bin/gunicorn -n monasca-api -k eventlet --worker-connections=2000 --backlog=1000 --paste /etc/monasca/api-config.ini -w 9
[Install]
WantedBy=multi-user.target

View File

@ -1,11 +1,8 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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
# 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,
@ -17,12 +14,16 @@
# Startup script for the Monasca API
description "Monasca API Java app"
start on runlevel [2345]
[Unit]
Description=Monasca API Python app
Requires=network.target
After=network.target kafka.service influxdb.service mysql.service
console log
respawn
[Service]
User=mon-api
Group=monasca
ExecStart=/opt/monasca-api/bin/gunicorn -n monasca-api -k eventlet --worker-connections=2000 --backlog=1000 --paste /etc/monasca/api-config.ini -w 9
Restart=on-failure
setgid monasca
setuid mon-api
exec /usr/bin/java -Dfile.encoding=UTF-8 -Xmx128m -cp /opt/monasca/monasca-api.jar monasca.api.MonApiApplication server /etc/monasca/api-config.yml
[Install]
WantedBy=multi-user.target

View File

@ -1,11 +1,8 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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
# 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,
@ -17,15 +14,17 @@
# Startup script for the monasca_notification
description "Monasca Notification daemon"
start on runlevel [2345]
[Unit]
Description=Monasca Notification daemon
Requires=network.target
After=network.target kafka.service mysql.service
console log
respawn
[Service]
User=mon-notification
Group=monasca
TimeoutStopSec=240
ExecStart=/opt/monasca/bin/monasca-notification
Restart=on-failure
kill timeout 240
respawn limit 25 5
setgid monasca
setuid mon-notification
exec /opt/monasca/bin/monasca-notification
[Install]
WantedBy=multi-user.target

View File

@ -1,28 +0,0 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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.
#
# Startup script for the monasca-persister
description "Monasca Persister java app"
start on runlevel [2345]
console log
respawn
setgid monasca
setuid mon-persister
exec /usr/bin/java -Dfile.encoding=UTF-8 -Xmx128m -cp /opt/monasca/monasca-persister.jar monasca.persister.PersisterApplication server /etc/monasca/persister-config.yml

View File

@ -0,0 +1,29 @@
# 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.
#
# Startup script for the Monasca Persister
[Unit]
Description=Monasca Persister Java app
Requires=network.target
After=network.target kafka.service influxdb.service
[Service]
User=mon-persister
Group=monasca
ExecStart=/usr/bin/java -Dfile.encoding=UTF-8 -Xmx128m -cp /opt/monasca/monasca-persister.jar monasca.persister.PersisterApplication server /etc/monasca/persister-config.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -1,11 +1,8 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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
# 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,
@ -17,12 +14,16 @@
# Startup script for the Monasca Persister
description "Monasca Persister Python app"
start on runlevel [2345]
[Unit]
Description=Monasca Persister Python app
Requires=network.target
After=network.target kafka.service influxdb.service
console log
respawn
[Service]
User=mon-persister
Group=monasca
ExecStart=/opt/monasca-persister/bin/python /opt/monasca-persister/lib/python2.7/site-packages/monasca_persister/persister.py --config-file /etc/monasca/persister.conf
Restart=on-failure
setgid monasca
setuid mon-persister
exec /opt/monasca-persister/bin/python /opt/monasca-persister/lib/python2.7/site-packages/monasca_persister/persister.py --config-file /etc/monasca/persister.conf
[Install]
WantedBy=multi-user.target

View File

@ -1,11 +1,8 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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
# 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,
@ -16,16 +13,17 @@
#
# Startup script for Storm Nimbus
description "Storm Nimbus daemon"
start on runlevel [2345]
[Unit]
Description=Storm Nimbus daemon
After=zookeeper.service kafka.service
console log
respawn
[Service]
User=storm
Group=storm
TimeoutStopSec=240
WorkingDirectory=/opt/storm/current
ExecStart=/opt/storm/current/bin/storm nimbus
Restart=on-failure
kill timeout 240
respawn limit 25 5
setgid storm
setuid storm
chdir /opt/storm/current
exec /opt/storm/current/bin/storm nimbus
[Install]
WantedBy=multi-user.target

View File

@ -1,11 +1,8 @@
#
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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
# 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,
@ -16,16 +13,17 @@
#
# Startup script for Storm Supervisor
description "Storm Supervisor daemon"
start on runlevel [2345]
[Unit]
Description=Storm Supervisor daemon
After=storm-nimbus.service zookeeper.service kafka.service
console log
respawn
[Service]
User=storm
Group=storm
TimeoutStopSec=240
WorkingDirectory=/opt/storm/current
ExecStart=/opt/storm/current/bin/storm supervisor
Restart=on-failure
kill timeout 240
respawn limit 25 5
setgid storm
setuid storm
chdir /opt/storm/current
exec /opt/storm/current/bin/storm supervisor
[Install]
WantedBy=multi-user.target

View File

@ -93,7 +93,7 @@ function install_monasca {
install_monasca_virtual_env
install_openjdk_7_jdk
install_openjdk_8_jdk
install_kafka
@ -224,6 +224,8 @@ function _start_monasca_agent {
}
function unstack_monasca {
stop_service grafana-server || true
stop_service monasca-agent || true
stop_service monasca-thresh || true
@ -240,7 +242,7 @@ function unstack_monasca {
stop_service kafka || true
sudo /etc/init.d/influxdb stop || true
stop_service influxdb || true
stop_service verticad || true
@ -347,7 +349,7 @@ function clean_monasca {
clean_kafka
clean_openjdk_7_jdk
clean_openjdk_8_jdk
clean_monasca_virtual_env
@ -397,11 +399,11 @@ function install_kafka {
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/kafka/kafka-server-start.sh /opt/kafka_${KAFKA_VERSION}/bin/kafka-server-start.sh
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/kafka/kafka.conf /etc/init/kafka.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/kafka/kafka.service /etc/systemd/system/kafka.service
sudo chown root:root /etc/init/kafka.conf
sudo chown root:root /etc/systemd/system/kafka.service
sudo chmod 644 /etc/init/kafka.conf
sudo chmod 644 /etc/systemd/system/kafka.service
sudo mkdir -p /var/kafka || true
@ -435,7 +437,9 @@ function install_kafka {
sudo sed -i "s/host\.name=127\.0\.0\.1/host.name=${SERVICE_HOST}/g" /etc/kafka/server.properties
fi
sudo start kafka || sudo restart kafka
sudo systemctl enable kafka
sudo systemctl start kafka || sudo systemctl restart kafka
}
@ -451,7 +455,9 @@ function clean_kafka {
sudo rm -rf /opt/kafka
sudo rm -rf /etc/init/kafka.conf
sudo systemctl disable kafka
sudo rm -rf /etc/systemd/system/kafka.service
sudo userdel kafka
@ -487,7 +493,7 @@ function install_monasca_influxdb {
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/influxdb/influxdb /etc/default/influxdb
sudo /etc/init.d/influxdb start || sudo /etc/init.d/influxdb restart
sudo systemctl start influxdb || sudo systemctl restart influxdb
}
@ -528,12 +534,6 @@ function install_monasca_cassandra {
echo_summary "Install Monasca Cassandra"
# Recent Cassandra needs Java 8
sudo add-apt-repository ppa:openjdk-r/ppa
REPOS_UPDATED=False
apt_get_update
apt_get -y install openjdk-8-jre
if [[ "$OFFLINE" != "True" ]]; then
sudo sh -c "echo 'deb http://www.apache.org/dist/cassandra/debian ${CASSANDRA_VERSION} main' > /etc/apt/sources.list.d/cassandra.list"
REPOS_UPDATED=False
@ -558,13 +558,14 @@ function install_monasca_cassandra {
sudo sed -i "s/^batch_size_fail_threshold_in_kb: 50/batch_size_fail_threshold_in_kb: 500/g" /etc/cassandra/cassandra.yaml
sudo sh -c "echo 'JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' >> /etc/default/cassandra"
sudo service cassandra restart
echo "Sleep for 15 seconds to wait starting up Cassandra"
sleep 15s
export CQLSH_NO_BUNDLED=true
pip_install 'cassandra-driver>=2.1.4,!=3.6.0'
if [[ ${SERVICE_HOST} ]]; then
/usr/bin/cqlsh ${SERVICE_HOST} -f "${MONASCA_API_DIR}"/devstack/files/cassandra/cassandra_schema.cql
@ -572,6 +573,7 @@ function install_monasca_cassandra {
else
/usr/bin/cqlsh -f "${MONASCA_API_DIR}"/devstack/files/cassandra/cassandra_schema.cql
fi
}
@ -636,12 +638,10 @@ function clean_monasca_cassandra {
sudo rm -rf /etc/cassandra
apt_get -y purge openjdk-8-jre cassandra
apt_get -y purge cassandra
apt_get -y autoremove
sudo add-apt-repository -r ppa:openjdk-r/ppa
sudo rm -f /etc/apt/sources.list.d/cassandra.list
sudo rm -f /etc/apt/trusted.gpg.d/cassandra.gpg
@ -651,7 +651,23 @@ function install_cli_creds {
echo_summary "Install Monasca CLI Creds"
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/env.sh /etc/profile.d/monasca_cli.sh
if [[ "${MONASCA_METRICS_DB,,}" == 'cassandra' ]]; then
sudo sh -c "cat ${MONASCA_API_DIR}/devstack/files/env.sh \
${MONASCA_API_DIR}/devstack/files/cassandra/env_cassandra.sh \
> /etc/profile.d/monasca_cli.sh"
else
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/env.sh /etc/profile.d/monasca_cli.sh
fi
if [[ ${SERVICE_HOST} ]]; then
sudo sed -i "s/127\.0\.0\.1/${SERVICE_HOST}/g" /etc/profile.d/monasca_cli.sh
fi
sudo chown root:root /etc/profile.d/monasca_cli.sh
@ -737,19 +753,19 @@ function clean_schema {
}
function install_openjdk_7_jdk {
function install_openjdk_8_jdk {
echo_summary "Install Monasca openjdk_7_jdk"
echo_summary "Install Monasca openjdk_8_jdk"
apt_get -y install openjdk-7-jdk
apt_get -y install openjdk-8-jdk
}
function clean_openjdk_7_jdk {
function clean_openjdk_8_jdk {
echo_summary "Clean Monasca openjdk_7_jdk"
echo_summary "Clean Monasca openjdk_8_jdk"
apt_get -y purge openjdk-7-jdk
apt_get -y purge openjdk-8-jdk
apt_get -y autoremove
@ -805,18 +821,20 @@ function install_monasca_api_java {
sudo useradd --system -g monasca mon-api || true
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-api/monasca-api.conf /etc/init/monasca-api.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-api/monasca-api.service /etc/systemd/system/monasca-api.service
if [[ "${MONASCA_METRICS_DB,,}" == 'vertica' ]]; then
# Add the Vertica JDBC to the class path.
sudo sed -i "s/-cp \/opt\/monasca\/monasca-api.jar/-cp \/opt\/monasca\/monasca-api.jar:\/opt\/monasca\/vertica-jdbc-${VERTICA_VERSION}.jar/g" /etc/init/monasca-api.conf
sudo sed -i "s/-cp \/opt\/monasca\/monasca-api.jar/-cp \/opt\/monasca\/monasca-api.jar:\/opt\/monasca\/vertica-jdbc-${VERTICA_VERSION}.jar/g" /etc/systemd/system/monasca-api.service
sudo sed -i "s/influxdb.service/vertica.service/g" /etc/systemd/system/monasca-api.service
fi
sudo chown root:root /etc/init/monasca-api.conf
sudo chown root:root /etc/systemd/system/monasca-api.service
sudo chmod 0744 /etc/init/monasca-api.conf
sudo chmod 0644 /etc/systemd/system/monasca-api.service
sudo mkdir -p /var/log/monasca || true
@ -886,8 +904,15 @@ function install_monasca_api_python {
pip_install gunicorn
pip_install PyMySQL
pip_install influxdb==2.8.0
pip_install cassandra-driver>=2.1.4,!=3.6.0
if [[ "${MONASCA_METRICS_DB,,}" == 'influxdb' ]]; then
pip_install influxdb==2.8.0
elif [[ "${MONASCA_METRICS_DB,,}" == 'cassandra' ]]; then
pip_install 'cassandra-driver>=2.1.4,!=3.6.0'
fi
(cd "${MONASCA_API_DIR}" ; sudo python setup.py sdist)
MONASCA_API_SRC_DIST=$(ls -td "${MONASCA_API_DIR}"/dist/monasca-api-*.tar.gz)
@ -898,11 +923,17 @@ function install_monasca_api_python {
sudo useradd --system -g monasca mon-api || true
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-api/python/monasca-api.conf /etc/init/monasca-api.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-api/python/monasca-api.service /etc/systemd/system/monasca-api.service
sudo chown root:root /etc/init/monasca-api.conf
if [[ "${MONASCA_METRICS_DB,,}" == 'cassandra' ]]; then
sudo chmod 0744 /etc/init/monasca-api.conf
sudo sed -i "s/influxdb.service/cassandra.service/g" /etc/systemd/system/monasca-api.service
fi
sudo chown root:root /etc/systemd/system/monasca-api.service
sudo chmod 0644 /etc/systemd/system/monasca-api.service
sudo mkdir -p /var/log/monasca || true
@ -987,7 +1018,9 @@ function clean_monasca_api_java {
sudo rm -rf /var/log/monasca/api
sudo rm /etc/init/monasca-api.conf
sudo systemctl disable monasca-api
sudo rm /etc/systemd/system/monasca-api.service
sudo rm /opt/monasca/monasca-api.jar
@ -1000,7 +1033,9 @@ function clean_monasca_api_python {
echo_summary "Clean Monasca monasca_api_python"
sudo rm /etc/init/monasca-api.conf
sudo systemctl disable monasca-api
sudo rm /etc/systemd/system/monasca-api.service
sudo rm /etc/api-config.conf
@ -1073,18 +1108,20 @@ function install_monasca_persister_java {
fi
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-persister/monasca-persister.conf /etc/init/monasca-persister.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-persister/monasca-persister.service /etc/systemd/system/monasca-persister.service
if [[ "${MONASCA_METRICS_DB,,}" == 'vertica' ]]; then
# Add the Vertica JDBC to the class path.
sudo sed -i "s/-cp \/opt\/monasca\/monasca-persister.jar/-cp \/opt\/monasca\/monasca-persister.jar:\/opt\/monasca\/vertica-jdbc-${VERTICA_VERSION}.jar/g" /etc/init/monasca-persister.conf
sudo sed -i "s/-cp \/opt\/monasca\/monasca-persister.jar/-cp \/opt\/monasca\/monasca-persister.jar:\/opt\/monasca\/vertica-jdbc-${VERTICA_VERSION}.jar/g" /etc/systemd/system/monasca-persister.service
sudo sed -i "s/influxdb.service/vertica.service/g" /etc/systemd/system/monasca-persister.service
fi
sudo chown root:root /etc/init/monasca-persister.conf
sudo chown root:root /etc/systemd/system/monasca-persister.service
sudo chmod 0744 /etc/init/monasca-persister.conf
sudo chmod 0644 /etc/systemd/system/monasca-persister.service
}
@ -1106,8 +1143,15 @@ function install_monasca_persister_python {
PIP_VIRTUAL_ENV=/opt/monasca-persister
pip_install $MONASCA_PERSISTER_SRC_DIST
pip_install influxdb==2.8.0
pip_install cassandra-driver>=2.1.4,!=3.6.0
if [[ "${MONASCA_METRICS_DB,,}" == 'influxdb' ]]; then
pip_install influxdb==2.8.0
elif [[ "${MONASCA_METRICS_DB,,}" == 'cassandra' ]]; then
pip_install 'cassandra-driver>=2.1.4,!=3.6.0'
fi
unset PIP_VIRTUAL_ENV
@ -1172,11 +1216,17 @@ function install_monasca_persister_python {
fi
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-persister/python/monasca-persister.conf /etc/init/monasca-persister.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-persister/python/monasca-persister.service /etc/systemd/system/monasca-persister.service
sudo chown root:root /etc/init/monasca-persister.conf
if [[ "${MONASCA_METRICS_DB,,}" == 'cassandra' ]]; then
sudo chmod 0744 /etc/init/monasca-persister.conf
sudo sed -i "s/influxdb.service/cassandra.service/g" /etc/systemd/system/monasca-persister.service
fi
sudo chown root:root /etc/systemd/system/monasca-persister.service
sudo chmod 0644 /etc/systemd/system/monasca-persister.service
}
@ -1186,7 +1236,9 @@ function clean_monasca_persister_java {
(cd "${MONASCA_PERSISTER_DIR}" ; sudo mvn clean)
sudo rm /etc/init/monasca-persister.conf
sudo systemctl disable monasca-persister
sudo rm /etc/systemd/system/monasca-persister.service
sudo rm /etc/monasca/persister-config.yml
@ -1203,7 +1255,9 @@ function clean_monasca_persister_python {
echo_summary "Clean Monasca monasca_persister_python"
sudo rm /etc/init/monasca-persister.conf
sudo systemctl disable monasca-persister
sudo rm /etc/systemd/system/monasca-persister.service
sudo rm /etc/monasca/persister.conf
@ -1236,8 +1290,6 @@ function install_monasca_notification {
pip_install $MONASCA_NOTIFICATION_SRC_DIST
pip_install mysql-python
unset PIP_VIRTUAL_ENV
sudo useradd --system -g monasca mon-notification || true
@ -1269,11 +1321,11 @@ function install_monasca_notification {
fi
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-notification/monasca-notification.conf /etc/init/monasca-notification.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/monasca-notification/monasca-notification.service /etc/systemd/system/monasca-notification.service
sudo chown root:root /etc/init/monasca-notification.conf
sudo chown root:root /etc/systemd/system/monasca-notification.service
sudo chmod 0744 /etc/init/monasca-notification.conf
sudo chmod 0644 /etc/systemd/system/monasca-notification.service
sudo debconf-set-selections <<< "postfix postfix/mailname string localhost"
@ -1287,7 +1339,9 @@ function clean_monasca_notification {
echo_summary "Clean Monasca monasca_notification"
sudo rm /etc/init/monasca-notification.conf
sudo systemctl disable monasca-notification
sudo rm /etc/systemd/system/monasca-notification.service
sudo rm /etc/monasca/notification.yaml
@ -1351,21 +1405,25 @@ function install_storm {
sudo chmod 0644 /opt/storm/apache-storm-${STORM_VERSION}/conf/storm.yaml
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/storm/storm-nimbus.conf /etc/init/storm-nimbus.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/storm/storm-nimbus.service /etc/systemd/system/storm-nimbus.service
sudo chown root:root /etc/init/storm-nimbus.conf
sudo chown root:root /etc/systemd/system/storm-nimbus.service
sudo chmod 0644 /etc/init/storm-nimbus.conf
sudo chmod 0644 /etc/systemd/system/storm-nimbus.service
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/storm/storm-supervisor.conf /etc/init/storm-supervisor.conf
sudo cp -f "${MONASCA_API_DIR}"/devstack/files/storm/storm-supervisor.service /etc/systemd/system/storm-supervisor.service
sudo chown root:root /etc/init/storm-supervisor.conf
sudo chown root:root /etc/systemd/system/storm-supervisor.service
sudo chmod 0644 /etc/init/storm-supervisor.conf
sudo chmod 0644 /etc/systemd/system/storm-supervisor.service
sudo start storm-nimbus || sudo restart storm-nimbus
sudo systemctl enable storm-nimbus
sudo start storm-supervisor || sudo restart storm-supervisor
sudo systemctl enable storm-supervisor
sudo systemctl start storm-nimbus || sudo systemctl restart storm-nimbus
sudo systemctl start storm-supervisor || sudo systemctl restart storm-supervisor
}
@ -1373,9 +1431,13 @@ function clean_storm {
echo_summary "Clean Monasca Storm"
sudo rm /etc/init/storm-supervisor.conf
sudo systemctl disable storm-supervisor
sudo rm /etc/init/storm-nimbus.conf
sudo systemctl disable storm-nimbus
sudo rm /etc/systemd/system/storm-supervisor.service
sudo rm /etc/systemd/system/storm-nimbus.service
sudo rm /opt/storm/apache-storm-${STORM_VERSION}/conf/storm.yaml
@ -1442,6 +1504,8 @@ function clean_monasca_thresh {
(cd "${MONASCA_THRESH_DIR}"/thresh ; sudo mvn clean)
sudo systemctl disable monasca-thresh
sudo rm /etc/init.d/monasca-thresh
sudo rm /etc/monasca/thresh-config.yml
@ -1776,6 +1840,7 @@ function install_monasca_grafana {
sudo sed -i "s#/usr/sbin#"${MONASCA_BASE}"/grafana-build/src/github.com/grafana/grafana/bin#g" /etc/init.d/grafana-server
sudo sed -i "s#/usr/share#"${MONASCA_BASE}"/grafana-build/src/github.com/grafana#g" /etc/init.d/grafana-server
sudo systemctl enable grafana-server
}
function clean_node_nvm {
@ -1786,6 +1851,8 @@ function clean_monasca_grafana {
sudo rm -f "${MONASCA_BASE}"/grafana-build
sudo systemctl disable grafana-server
sudo rm /etc/init.d/grafana-server
sudo rm -r /etc/grafana