-
Notifications
You must be signed in to change notification settings - Fork 146
Run scylla monitoring as a service
Tzach Livyatan edited this page Oct 8, 2017
·
3 revisions
The following is a naive example of running scylla monitoring as a service. Note that using it as is will remove all data on service restart! To fix, either use the -d to keep the data out of the Docker instance, or stop and start the docker instances instead of killing and removing them
file /usr/bin/scylla-monitoring
#!/bin/sh
start() {
# exec ./kill-all.sh
exec ./start-all.sh -v master
}
stop() {
exec ./kill-all.sh
}
case $1 in
start|stop) "$1" ;;
esac
file /etc/systemd/system/scylla-monitoring.service
[Unit]
Description=Start Scylla Monitoring
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
WorkingDirectory=/home/centos/scylla-grafana-monitoring/
ExecStart=/usr/bin/monitoring start
ExecStop=/usr/bin/monitoring stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Start the service
sudo systemctl start scylla-monitoring
Enable it at init
sudo systemctl enable scylla-monitoring.service