Merge pull request #1 from hpcloud-mon/feature/require_storm
Move to requiring storm to run
This commit is contained in:
commit
b59b2f3508
38
pom.xml
38
pom.xml
@ -268,34 +268,6 @@
|
||||
<shortRevisionLength>6</shortRevisionLength>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.storm</groupId>
|
||||
<artifactId>storm-core</artifactId>
|
||||
<version>${storm.version}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>false</overWrite>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>jdeb</artifactId>
|
||||
<groupId>org.vafer</groupId>
|
||||
@ -317,14 +289,8 @@
|
||||
</data>
|
||||
<data>
|
||||
<type>file</type>
|
||||
<src>${project.build.directory}/storm-core-${storm.version}.jar
|
||||
</src>
|
||||
<dst>/opt/mon/storm-core-${storm.version}.jar</dst>
|
||||
</data>
|
||||
<data>
|
||||
<type>file</type>
|
||||
<src>${project.basedir}/src/deb/init/mon-thresh.conf</src>
|
||||
<dst>/etc/init/mon-thresh.conf</dst>
|
||||
<src>${project.basedir}/src/deb/init/mon-thresh</src>
|
||||
<dst>/etc/init.d/mon-thresh</dst>
|
||||
</data>
|
||||
<data>
|
||||
<type>file</type>
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
chmod +x /etc/init.d/mon-thresh
|
||||
if ! [ `getent passwd thresh` ]; then
|
||||
adduser --system --group thresh
|
||||
fi
|
||||
|
32
src/deb/init/mon-thresh
Executable file
32
src/deb/init/mon-thresh
Executable file
@ -0,0 +1,32 @@
|
||||
#! /bin/sh
|
||||
#### BEGIN INIT INFO
|
||||
## Provides: mon-thresh
|
||||
## Required-Start: $nimbus
|
||||
## Required-Stop:
|
||||
## Default-Start: 2 3 4 5
|
||||
## Default-Stop:
|
||||
## Short-Description: Monitoring threshold engine running under storm
|
||||
## Description:
|
||||
#### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
sudo -Hu thresh /opt/storm/current/bin/storm jar /opt/mon/mon-thresh.jar com.hpcloud.mon.ThresholdingEngine /etc/mon/mon-thresh-config.yml thresh-cluster
|
||||
;;
|
||||
stop)
|
||||
sudo -Hu thresh /opt/storm/current/bin/storm kill thresh-cluster
|
||||
# The above command returns but actually takes awhile loop watching status
|
||||
while true; do
|
||||
sudo -Hu thresh /opt/storm/current/bin/storm list |grep thresh-cluster
|
||||
if [ $? -ne 0 ]; then break; fi
|
||||
sleep 1
|
||||
done
|
||||
;;
|
||||
status)
|
||||
sudo -Hu thresh /opt/storm/current/bin/storm list |grep thresh-cluster
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
esac
|
@ -1,23 +0,0 @@
|
||||
# Startup script for the mon-thresh
|
||||
|
||||
description "MON threshold engine java app"
|
||||
start on runlevel [2345]
|
||||
|
||||
console log
|
||||
respawn
|
||||
|
||||
setgid thresh
|
||||
setuid thresh
|
||||
|
||||
script
|
||||
|
||||
if [ -r /etc/default/mon-thresh ]; then
|
||||
. /etc/default/mon-thresh
|
||||
fi
|
||||
|
||||
exec /usr/bin/java -Xmx8g -Dlogback.configurationFile=/etc/mon/logback.xml -DLOGDIR=${LOGDIR:-/tmp} -cp "/opt/mon/*" com.hpcloud.mon.ThresholdingEngine /etc/mon/mon-thresh-config.yml mon-thresh local
|
||||
|
||||
end script
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user