From a29a9d6d899f55298bed6b1bbc55b05083426f31 Mon Sep 17 00:00:00 2001 From: Deklan Dieterly Date: Fri, 14 Mar 2014 09:20:45 -0600 Subject: [PATCH] Get deb file creation working. --- pom.xml | 57 +++++++++++++++- src/deb/control/control | 9 +++ src/deb/control/postinst | 15 +++++ src/deb/control/postrm | 9 +++ src/deb/control/prerm | 9 +++ src/deb/etc/mon-thresh-config.yml-sample | 86 ++++++++++++++++++++++++ src/deb/init/mon-thresh.conf | 11 +++ 7 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 src/deb/control/control create mode 100755 src/deb/control/postinst create mode 100644 src/deb/control/postrm create mode 100644 src/deb/control/prerm create mode 100755 src/deb/etc/mon-thresh-config.yml-sample create mode 100644 src/deb/init/mon-thresh.conf diff --git a/pom.xml b/pom.xml index 32bcce0..32c460e 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,8 @@ true UTF-8 UTF-8 + ${project.name}-${project.version}-${timestamp}-${buildNumber} + @@ -216,7 +218,7 @@ maven-shade-plugin 2.2 - mon-thresh + ${artifactNamedVersion} true @@ -255,6 +257,59 @@ ${project.version} + + org.codehaus.mojo + buildnumber-maven-plugin + 1.2 + + + validate + + create + + + + + false + 6 + + + + jdeb + org.vafer + 1.0.1 + + + package + + jdeb + + + ${project.basedir}/debs/binaries/${artifactNamedVersion}.deb + + + file + ${project.build.directory}/${artifactNamedVersion}.jar + + /opt/mon/mon-thresh.jar + + + file + ${project.basedir}/src/deb/init/mon-thresh.conf + /etc/init/mon-thresh.conf + + + file + + ${project.basedir}/src/deb/etc/mon-thresh-config.yml-sample + + /etc/mon/thresh-config.yml-sample + + + + + + diff --git a/src/deb/control/control b/src/deb/control/control new file mode 100644 index 0000000..93016f3 --- /dev/null +++ b/src/deb/control/control @@ -0,0 +1,9 @@ +Package: [[name]] +Section: misc +Priority: optional +Architecture: all +Depends: openjdk-7-jre-headless | openjdk-7-jre +Version: [[version]]-[[timestamp]]-[[buildNumber]] +Maintainer: HPCloud Monitoring +Description: Mon-Thresh + Reads metrics and generates alarms based on alarm definitions. diff --git a/src/deb/control/postinst b/src/deb/control/postinst new file mode 100755 index 0000000..e2f4de4 --- /dev/null +++ b/src/deb/control/postinst @@ -0,0 +1,15 @@ +#!/bin/sh + +case "$1" in + configure) + if ! [ `getent passwd persister` ]; then + adduser --system --group persister + fi + + #Restart does not pick up upstart job config changes stop/start is needed + stop mon-thresh + start mon-thresh + ;; +esac + +exit 0 diff --git a/src/deb/control/postrm b/src/deb/control/postrm new file mode 100644 index 0000000..78d5d28 --- /dev/null +++ b/src/deb/control/postrm @@ -0,0 +1,9 @@ +#!/bin/sh + +case "$1" in + remove|purge) + userdel persister + ;; +esac + +exit 0 diff --git a/src/deb/control/prerm b/src/deb/control/prerm new file mode 100644 index 0000000..4633f86 --- /dev/null +++ b/src/deb/control/prerm @@ -0,0 +1,9 @@ +#!/bin/sh + +case "$1" in + remove) + stop mon-thresh + ;; +esac + +exit 0 diff --git a/src/deb/etc/mon-thresh-config.yml-sample b/src/deb/etc/mon-thresh-config.yml-sample new file mode 100755 index 0000000..4518d89 --- /dev/null +++ b/src/deb/etc/mon-thresh-config.yml-sample @@ -0,0 +1,86 @@ +metricSpoutThreads: 1 +metricSpoutTasks: 1 + +metricSpoutConfig: + + #Kafka settings. + kafkaConsumerConfiguration: + # See http://kafka.apache.org/documentation.html#api for semantics and defaults. + topic: test + numThreads: 1 + groupId: 1 + zookeeperConnect: localhost:2181 + consumerId: 1 + socketTimeoutMs: 30000 + socketReceiveBufferBytes : 65536 + fetchMessageMaxBytes: 1048576 + autoCommitEnable: true + autoCommitIntervalMs: 60000 + queuedMaxMessageChunks: 10 + rebalanceMaxRetries: 4 + fetchMinBytes: 1 + fetchWaitMaxMs: 100 + rebalanceBackoffMs: 2000 + refreshLeaderBackoffMs: 200 + autoOffsetReset: largest + consumerTimeoutMs: -1 + clientId : 1 + zookeeperSessionTimeoutMs : 6000 + zookeeperConnectionTimeoutMs : 6000 + zookeeperSyncTimeMs: 2000 + + +eventSpoutConfig: + #Kafka settings. + kafkaConsumerConfiguration: + # See http://kafka.apache.org/documentation.html#api for semantics and defaults. + topic: test + numThreads: 1 + groupId: 1 + zookeeperConnect: localhost:2181 + consumerId: 1 + socketTimeoutMs: 30000 + socketReceiveBufferBytes : 65536 + fetchMessageMaxBytes: 1048576 + autoCommitEnable: true + autoCommitIntervalMs: 60000 + queuedMaxMessageChunks: 10 + rebalanceMaxRetries: 4 + fetchMinBytes: 1 + fetchWaitMaxMs: 100 + rebalanceBackoffMs: 2000 + refreshLeaderBackoffMs: 200 + autoOffsetReset: largest + consumerTimeoutMs: -1 + clientId : 1 + zookeeperSessionTimeoutMs : 6000 + zookeeperConnectionTimeoutMs : 6000 + zookeeperSyncTimeMs: 2000 + + +sporadicMetricNamespaces: + - foo + +database: + driverClass: com.vertica.jdbc.Driver +# url: jdbc:vertica://mon-aw1rdd1-vertica0001.rndd.aw1.hpcloud.net:5433/som + url: jdbc:vertica://15.185.94.245:5433/som +# user: persister + user: mon_persister +# user: dbadmin + password: password + properties: + ssl: false + # the maximum amount of time to wait on an empty pool before throwing an exception + maxWaitForConnection: 1s + + # the SQL query to run when validating a connection's liveness + validationQuery: "/* MyService Health Check */ SELECT 1" + + # the minimum number of connections to keep open + minSize: 8 + + # the maximum number of connections to keep open + + + maxSize: 41 diff --git a/src/deb/init/mon-thresh.conf b/src/deb/init/mon-thresh.conf new file mode 100644 index 0000000..914b641 --- /dev/null +++ b/src/deb/init/mon-thresh.conf @@ -0,0 +1,11 @@ +# Startup script for the mon-thresh + +description "MON threshold engine java app" +start on runlevel [2345] + +console log +respawn + +setgid persister +setuid persister +exec /usr/bin/java -Xmx8g -cp /opt/mon/mon-thresh.jar com.hpcloud.ThresholdEngine /etc/mon-thresh/mon-thresh-config.yml topology-name