summaryrefslogtreecommitdiff
path: root/ambari-metrics
diff options
context:
space:
mode:
authorSiddharth Wagle <swagle@hortonworks.com>2014-12-22 13:53:30 -0800
committerSiddharth Wagle <swagle@hortonworks.com>2014-12-22 13:53:30 -0800
commite6cdb06bc7cd6d7ff010592c20e49de0a0f5b855 (patch)
tree97004d909c8b40645d7a388a67767650e6597ca3 /ambari-metrics
parentff4c6c114b626b7164c6160f677e459fdcbaf1e6 (diff)
AMBARI-8869. Include AMS debian packages in Ambari build. (swagle, dsen via swagle)
Diffstat (limited to 'ambari-metrics')
-rw-r--r--ambari-metrics/ambari-metrics-assembly/pom.xml286
-rw-r--r--ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/control22
-rw-r--r--ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst24
-rw-r--r--ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/prerm28
-rw-r--r--ambari-metrics/ambari-metrics-hadoop-sink/pom.xml42
-rw-r--r--ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor2
-rw-r--r--ambari-metrics/pom.xml8
7 files changed, 363 insertions, 49 deletions
diff --git a/ambari-metrics/ambari-metrics-assembly/pom.xml b/ambari-metrics/ambari-metrics-assembly/pom.xml
index 0a0afbdd18..c31e34fe74 100644
--- a/ambari-metrics/ambari-metrics-assembly/pom.xml
+++ b/ambari-metrics/ambari-metrics-assembly/pom.xml
@@ -36,6 +36,10 @@
<hadoop-sink.dir>${project.basedir}/../ambari-metrics-hadoop-sink</hadoop-sink.dir>
<storm-sink.dir>${project.basedir}/../ambari-metrics-storm-sink</storm-sink.dir>
<flume-sink.dir>${project.basedir}/../ambari-metrics-flume-sink</flume-sink.dir>
+ <python.ver>python &gt;= 2.6</python.ver>
+ <deb.python.ver>python (&gt;= 2.6)</deb.python.ver>
+ <deb.architecture>amd64</deb.architecture>
+ <deb.dependency.list>${deb.python.ver},python-dev,gcc</deb.dependency.list>
</properties>
<build>
@@ -96,7 +100,6 @@
</plugins>
</build>
-
<profiles>
<profile>
<id>rpm</id>
@@ -455,12 +458,287 @@
</mappings>
</configuration>
</execution>
-
-
-
</executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>deb</id>
+ <activation>
+ <property>
+ <name>build-deb</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>jdeb</artifactId>
+ <groupId>org.vafer</groupId>
+ <version>1.0.1</version>
+ <executions>
+ <execution>
+ <!-- unbinds rpm creation from maven lifecycle -->
+ <phase>package</phase>
+ <goals>
+ <goal>jdeb</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <controlDir>${basedir}/src/main/package/deb/control</controlDir>
+ <deb>${basedir}/target/${artifactId}_${package-version}-${package-release}.deb</deb>
+ <dataSet>
+ <data>
+ <type>file</type>
+ <src>${monitor.dir}/src/main/python/__init__.py</src>
+ <mapper>
+ <type>perm</type>
+ <prefix>${resmonitor.install.dir}</prefix>
+ <!-- TODO: Figure out if file perms should be set -->
+ <!--user>root</user>
+ <group>root</group-->
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <type>file</type>
+ <src>${monitor.dir}/src/main/python/main.py</src>
+ <mapper>
+ <type>perm</type>
+ <prefix>${resmonitor.install.dir}</prefix>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <type>directory</type>
+ <src>${monitor.dir}/src/main/python/core</src>
+ <mapper>
+ <type>perm</type>
+ <prefix>${resmonitor.install.dir}/core</prefix>
+ </mapper>
+ </data>
+ <data>
+ <type>directory</type>
+ <src>${monitor.dir}/src/main/python/psutil</src>
+ <excludes>build/**</excludes>
+ <mapper>
+ <type>perm</type>
+ <prefix>${resmonitor.install.dir}/psutil</prefix>
+ </mapper>
+ </data>
+ <data>
+ <type>template</type>
+ <paths>
+ <path>/var/run/ambari-metrics-monitor</path>
+ <path>/var/log/ambari-metrics-monitor</path>
+ <path>/etc/ambari-metrics-monitor/conf</path>
+ <path>/usr/lib/ambari-metrics-collector</path>
+ <path>/etc/ambari-metrics-collector/conf</path>
+ <path>/etc/ams-hbase/conf</path>
+ <path>/var/run/ambari-metrics-collector</path>
+ <path>/var/run/ams-hbase</path>
+ <path>/var/log/ambari-metrics-collector</path>
+ <path>/var/lib/ambari-metrics-collector</path>
+ <path>/usr/lib/ambari-metrics-hadoop-sink</path>
+ <path>/usr/lib/flume/lib</path>
+ <path>/usr/lib/storm/lib</path>
+ </paths>
+ </data>
+ <data>
+ <src>${monitor.dir}/conf/unix/metric_groups.conf</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/etc/ambari-metrics-monitor/conf</prefix>
+ <filemode>644</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>${monitor.dir}/conf/unix/metric_monitor.ini</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/etc/ambari-metrics-monitor/conf</prefix>
+ <filemode>644</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>${monitor.dir}/conf/unix/ambari-metrics-monitor</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/usr/sbin</prefix>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+
+ <!-- Metric collector -->
+
+ <data>
+ <src>${collector.dir}/target/ambari-metrics-timelineservice-${project.version}.jar</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <dirmode>644</dirmode>
+ <prefix>/usr/lib/ambari-metrics-collector</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/target/lib</src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <prefix>/usr/lib/ambari-metrics-collector</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/target/embedded/${hbase.folder}</src>
+ <type>directory</type>
+ <excludes>bin/**,bin/*</excludes>
+ <mapper>
+ <type>perm</type>
+ <prefix>/usr/lib/ams-hbase</prefix>
+ <filemode>644</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/target/embedded/${hbase.folder}/bin</src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>755</filemode>
+ <prefix>/usr/lib/ams-hbase/bin</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/target/lib</src>
+ <type>directory</type>
+ <includes>phoenix*.jar,antlr*.jar</includes>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <prefix>/usr/lib/ams-hbase/lib</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/conf/unix/ambari-metrics-collector</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>755</filemode>
+ <prefix>/usr/sbin</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/conf/unix/ams-env.sh</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>755</filemode>
+ <prefix>/etc/ambari-metrics-collector/conf</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/conf/unix/ams-site.xml</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <prefix>/etc/ambari-metrics-collector/conf</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/conf/unix/log4j.properties</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <prefix>/etc/ambari-metrics-collector/conf</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${collector.dir}/target/embedded/${hbase.folder}/conf/hbase-site.xml</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <prefix>/etc/ambari-metrics-collector/conf</prefix>
+ </mapper>
+ </data>
+ <data>
+ <type>directory</type>
+ <src>${collector.dir}/target/embedded/${hbase.folder}/conf</src>
+ <mapper>
+ <type>perm</type>
+ <dirmode>755</dirmode>
+ <filemode>644</filemode>
+ <prefix>/etc/ams-hbase/conf</prefix>
+ </mapper>
+ </data>
+
+ <!-- hadoop sink -->
+
+ <data>
+ <src>${hadoop-sink.dir}/target/ambari-metrics-hadoop-sink-with-common-${project.version}.jar</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <dirmode>755</dirmode>
+ <prefix>/usr/lib/ambari-metrics-hadoop-sink</prefix>
+ </mapper>
+ </data>
+
+ <!-- flume sink -->
+
+ <data>
+ <src>${flume-sink.dir}/target/ambari-metrics-flume-sink-${project.version}.jar</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <dirmode>755</dirmode>
+ <prefix>/usr/lib/flume/lib</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${flume-sink.dir}/target/lib</src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <prefix>/usr/lib/flume/lib</prefix>
+ </mapper>
+ </data>
+
+ <!-- storm sink -->
+
+ <data>
+ <src>${storm-sink.dir}/target/ambari-metrics-storm-sink-${project.version}.jar</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <dirmode>755</dirmode>
+ <prefix>/usr/lib/storm/lib</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${storm-sink.dir}/target/lib</src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <filemode>644</filemode>
+ <prefix>/usr/lib/storm/lib</prefix>
+ </mapper>
+ </data>
+
+ </dataSet>
+ </configuration>
</plugin>
</plugins>
</build>
diff --git a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/control b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/control
new file mode 100644
index 0000000000..40cd85513c
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/control
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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
+Package: [[artifactId]]
+Version: [[package-version]]-[[package-release]]
+Section: [[deb.section]]
+Priority: [[deb.priority]]
+Depends: [[deb.dependency.list]]
+Architecture: [[deb.architecture]]
+Description: [[description]]
+Maintainer: [[deb.publisher]]
diff --git a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
new file mode 100644
index 0000000000..8ba25de25c
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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
+
+LINK_NAME="/usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar"
+JAR_NAME="/usr/lib/ambari-metrics-hadoop-sink/${sinkJarName}"
+
+if [ -e "$LINK_NAME" ]; then
+ rm -f $LINK_NAME
+fi
+
+ln -s $JAR_NAME $LINK_NAME
diff --git a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/prerm b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/prerm
new file mode 100644
index 0000000000..f50d88aa0c
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/prerm
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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
+
+# WARNING: This script is performed not only on uninstall, but also
+# during package update. See http://www.ibm.com/developerworks/library/l-rpm2/
+# for details
+
+RESOURCE_MONITORING_DIR=/usr/lib/python2.6/site-packages/resource_monitoring
+PSUTIL_DIR="${RESOURCE_MONITORING_DIR}/psutil"
+
+
+if [ -d "${PSUTIL_DIR}" ]; then
+ rm -rf "${PSUTIL_DIR}/*"
+fi
+
+exit 0
diff --git a/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml b/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
index 43523b4618..4a4e3547a2 100644
--- a/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
+++ b/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
@@ -99,48 +99,6 @@ limitations under the License.
</execution>
</executions>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.codehaus.mojo</groupId>-->
- <!--<artifactId>rpm-maven-plugin</artifactId>-->
- <!--<version>2.0.1</version>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>none</phase>-->
- <!--<goals>-->
- <!--<goal>rpm</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--<configuration>-->
- <!--<name>ambari-metrics-hadoop-sink</name>-->
- <!--<copyright>2012, Apache Software Foundation</copyright>-->
- <!--<group>Development</group>-->
- <!--<description>Maven Recipe: RPM Package.</description>-->
-
- <!--<defaultDirmode>755</defaultDirmode>-->
- <!--<defaultFilemode>644</defaultFilemode>-->
- <!--<defaultUsername>root</defaultUsername>-->
- <!--<defaultGroupname>root</defaultGroupname>-->
-
- <!--<postinstallScriptlet>-->
- <!--<scriptFile>${project.build.outputDirectory}/rpm/postinstall.sh</scriptFile>-->
- <!--<fileEncoding>utf-8</fileEncoding>-->
- <!--</postinstallScriptlet>-->
-
- <!--<mappings>-->
- <!--<mapping>-->
- <!--<directory>/usr/lib/ambari-metrics-hadoop-sink</directory>-->
- <!--<sources>-->
- <!--<source>-->
- <!--<location>target/${project.artifactId}-with-common-${project.version}.jar</location>-->
- <!--</source>-->
- <!--</sources>-->
-
- <!--</mapping>-->
-
- <!--</mappings>-->
- <!--</configuration>-->
- <!--</plugin>-->
</plugins>
<resources>
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor
index 9198ce938c..5779b5b40e 100644
--- a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor
+++ b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor
@@ -73,7 +73,7 @@ if [ ! "$(ls -A ${RESOURCE_MONITORING_DIR}/psutil/build)" ]; then
echo "Building psutil..."
dir=$(pwd)
cd "${RESOURCE_MONITORING_DIR}/psutil"
- ${PYTHON} "build.py"
+ ${PYTHON} "setup.py" "install"
cd "${dir}"
else
echo "psutil build directory is not empty, continuing..."
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index dde339a444..da7fc14064 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -39,7 +39,9 @@
<python.ver>python &gt;= 2.6</python.ver>
<deb.python.ver>python (&gt;= 2.6)</deb.python.ver>
<!--TODO change to HDP URL-->
- <hbase.tar>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hbase-0.98.4.2.2.0.0-2041-hadoop2.tar.gz</hbase.tar>
+ <hbase.tar>
+ http://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hbase-0.98.4.2.2.0.0-2041-hadoop2.tar.gz
+ </hbase.tar>
<hbase.folder>hbase-0.98.4.2.2.0.0-2041-hadoop2</hbase.folder>
<resmonitor.install.dir>
/usr/lib/python2.6/site-packages/resource_monitoring
@@ -116,7 +118,9 @@
<configuration>
<name>package-release</name>
<value>${project.version}</value>
- <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-)(([0-9]+)|(SNAPSHOT)).*</regex>
+ <regex>
+ ^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-)(([0-9]+)|(SNAPSHOT)).*
+ </regex>
<replacement>$5</replacement>
<failIfNoMatch>true</failIfNoMatch>
</configuration>