You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ds...@apache.org on 2014/05/14 16:02:22 UTC
[14/15] AMBARI-5747 Remove facter-1.6.10, Ruby,
Puppet dependencies from pom.xml and src (dsen)
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/gmondLib.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/gmondLib.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/gmondLib.sh
deleted file mode 100644
index 6190a78..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/gmondLib.sh
+++ /dev/null
@@ -1,556 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Slurp in all our user-customizable settings.
-source ./gangliaEnv.sh;
-
-# Get access to Ganglia-wide constants etc.
-source ./gangliaLib.sh;
-
-GMOND_BIN=/usr/sbin/gmond;
-GMOND_CORE_CONF_FILE=gmond.core.conf;
-GMOND_MASTER_CONF_FILE=gmond.master.conf;
-GMOND_SLAVE_CONF_FILE=gmond.slave.conf;
-GMOND_PID_FILE=gmond.pid;
-
-# Functions.
-function getGmondCoreConfFileName()
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- # ${clusterName} is not empty.
- echo "${GANGLIA_CONF_DIR}/${clusterName}/${GMOND_CORE_CONF_FILE}";
- else
- echo "${GANGLIA_CONF_DIR}/${GMOND_CORE_CONF_FILE}";
- fi
-}
-
-function getGmondMasterConfFileName()
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- # ${clusterName} is not empty.
- echo "${GANGLIA_CONF_DIR}/${clusterName}/conf.d/${GMOND_MASTER_CONF_FILE}";
- else
- echo "${GANGLIA_CONF_DIR}/conf.d/${GMOND_MASTER_CONF_FILE}";
- fi
-}
-
-function getGmondSlaveConfFileName()
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- # ${clusterName} is not empty.
- echo "${GANGLIA_CONF_DIR}/${clusterName}/conf.d/${GMOND_SLAVE_CONF_FILE}";
- else
- echo "${GANGLIA_CONF_DIR}/conf.d/${GMOND_SLAVE_CONF_FILE}";
- fi
-}
-
-function getGmondPidFileName()
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- # ${clusterName} is not empty.
- echo "${GANGLIA_RUNTIME_DIR}/${clusterName}/${GMOND_PID_FILE}";
- else
- echo "${GANGLIA_RUNTIME_DIR}/${GMOND_PID_FILE}";
- fi
-}
-
-function removeGmondPidFileName()
-{
- clusterName=${1};
- gmondPidFileName=`getGmondPidFileName ${clusterName}`;
- if [ -e "${gmondPidFileName}" ];
- then
- rm -rf ${gmondPidFileName};
- fi
-}
-
-
-function getGmondLoggedPid()
-{
- gmondPidFile=`getGmondPidFileName ${1}`;
-
- if [ -e "${gmondPidFile}" ]
- then
- echo `cat ${gmondPidFile}`;
- fi
-}
-
-function getGmondRunningPid()
-{
- gmondLoggedPid=`getGmondLoggedPid ${1}`;
-
- if [ -n "${gmondLoggedPid}" ]
- then
- echo `ps -o pid=MYPID -p ${gmondLoggedPid} | tail -1 | awk '{print $1}' | grep -v MYPID`;
- fi
-}
-
-function generateGmondCoreConf()
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- read gmondClusterName gmondMasterIP gmondPort <<<`getGangliaClusterInfo ${clusterName}`;
-
- # Check that all of ${gmondClusterName} and ${gmondMasterIP} and ${gmondPort} are populated.
- if [ "x" != "x${gmondClusterName}" -a "x" != "x${gmondMasterIP}" -a "x" != "x${gmondPort}" ]
- then
- now=`date`;
-
- cat << END_OF_GMOND_CORE_CONF
-#################### Generated by ${0} on ${now} ####################
-#
-/* This configuration is as close to 2.5.x default behavior as possible
- The values closely match ./gmond/metric.h definitions in 2.5.x */
-globals {
- daemonize = yes
- setuid = yes
- user = ${GMOND_USER}
- debug_level = 0
- max_udp_msg_len = 1472
- mute = no
- deaf = no
- allow_extra_data = yes
- host_dmax = 0 /*secs */
- host_tmax = 20 /*secs */
- cleanup_threshold = 300 /*secs */
- gexec = no
- send_metadata_interval = 30 /*secs */
-}
-
-/*
- * The cluster attributes specified will be used as part of the <CLUSTER>
- * tag that will wrap all hosts collected by this instance.
- */
-cluster {
- name = "${gmondClusterName}"
- owner = "unspecified"
- latlong = "unspecified"
- url = "unspecified"
-}
-
-/* The host section describes attributes of the host, like the location */
-host {
- location = "unspecified"
-}
-
-/* You can specify as many tcp_accept_channels as you like to share
- * an XML description of the state of the cluster.
- *
- * At the very least, every gmond must expose its XML state to
- * queriers from localhost.
- */
-tcp_accept_channel {
- bind = localhost
- port = ${gmondPort}
-}
-
-/* Each metrics module that is referenced by gmond must be specified and
- loaded. If the module has been statically linked with gmond, it does
- not require a load path. However all dynamically loadable modules must
- include a load path. */
-modules {
- module {
- name = "core_metrics"
- }
- module {
- name = "cpu_module"
- path = "modcpu.so"
- }
- module {
- name = "disk_module"
- path = "moddisk.so"
- }
- module {
- name = "load_module"
- path = "modload.so"
- }
- module {
- name = "mem_module"
- path = "modmem.so"
- }
- module {
- name = "net_module"
- path = "modnet.so"
- }
- module {
- name = "proc_module"
- path = "modproc.so"
- }
- module {
- name = "sys_module"
- path = "modsys.so"
- }
-}
-
-/* The old internal 2.5.x metric array has been replaced by the following
- collection_group directives. What follows is the default behavior for
- collecting and sending metrics that is as close to 2.5.x behavior as
- possible. */
-
-/* This collection group will cause a heartbeat (or beacon) to be sent every
- 20 seconds. In the heartbeat is the GMOND_STARTED data which expresses
- the age of the running gmond. */
-collection_group {
- collect_once = yes
- time_threshold = 20
- metric {
- name = "heartbeat"
- }
-}
-
-/* This collection group will send general info about this host total memory every
- 180 secs.
- This information doesn't change between reboots and is only collected
- once. This information needed for heatmap showing */
- collection_group {
- collect_once = yes
- time_threshold = 180
- metric {
- name = "mem_total"
- title = "Memory Total"
- }
- }
-
-/* This collection group will send general info about this host every
- 1200 secs.
- This information doesn't change between reboots and is only collected
- once. */
-collection_group {
- collect_once = yes
- time_threshold = 1200
- metric {
- name = "cpu_num"
- title = "CPU Count"
- }
- metric {
- name = "cpu_speed"
- title = "CPU Speed"
- }
- /* Should this be here? Swap can be added/removed between reboots. */
- metric {
- name = "swap_total"
- title = "Swap Space Total"
- }
- metric {
- name = "boottime"
- title = "Last Boot Time"
- }
- metric {
- name = "machine_type"
- title = "Machine Type"
- }
- metric {
- name = "os_name"
- title = "Operating System"
- }
- metric {
- name = "os_release"
- title = "Operating System Release"
- }
- metric {
- name = "location"
- title = "Location"
- }
-}
-
-/* This collection group will send the status of gexecd for this host
- every 300 secs.*/
-/* Unlike 2.5.x the default behavior is to report gexecd OFF. */
-collection_group {
- collect_once = yes
- time_threshold = 300
- metric {
- name = "gexec"
- title = "Gexec Status"
- }
-}
-
-/* This collection group will collect the CPU status info every 20 secs.
- The time threshold is set to 90 seconds. In honesty, this
- time_threshold could be set significantly higher to reduce
- unneccessary network chatter. */
-collection_group {
- collect_every = 20
- time_threshold = 90
- /* CPU status */
- metric {
- name = "cpu_user"
- value_threshold = "1.0"
- title = "CPU User"
- }
- metric {
- name = "cpu_system"
- value_threshold = "1.0"
- title = "CPU System"
- }
- metric {
- name = "cpu_idle"
- value_threshold = "5.0"
- title = "CPU Idle"
- }
- metric {
- name = "cpu_nice"
- value_threshold = "1.0"
- title = "CPU Nice"
- }
- metric {
- name = "cpu_aidle"
- value_threshold = "5.0"
- title = "CPU aidle"
- }
- metric {
- name = "cpu_wio"
- value_threshold = "1.0"
- title = "CPU wio"
- }
- /* The next two metrics are optional if you want more detail...
- ... since they are accounted for in cpu_system.
- metric {
- name = "cpu_intr"
- value_threshold = "1.0"
- title = "CPU intr"
- }
- metric {
- name = "cpu_sintr"
- value_threshold = "1.0"
- title = "CPU sintr"
- }
- */
-}
-
-collection_group {
- collect_every = 20
- time_threshold = 90
- /* Load Averages */
- metric {
- name = "load_one"
- value_threshold = "1.0"
- title = "One Minute Load Average"
- }
- metric {
- name = "load_five"
- value_threshold = "1.0"
- title = "Five Minute Load Average"
- }
- metric {
- name = "load_fifteen"
- value_threshold = "1.0"
- title = "Fifteen Minute Load Average"
- }
-}
-
-/* This group collects the number of running and total processes */
-collection_group {
- collect_every = 80
- time_threshold = 950
- metric {
- name = "proc_run"
- value_threshold = "1.0"
- title = "Total Running Processes"
- }
- metric {
- name = "proc_total"
- value_threshold = "1.0"
- title = "Total Processes"
- }
-}
-
-/* This collection group grabs the volatile memory metrics every 40 secs and
- sends them at least every 180 secs. This time_threshold can be increased
- significantly to reduce unneeded network traffic. */
-collection_group {
- collect_every = 40
- time_threshold = 180
- metric {
- name = "mem_free"
- value_threshold = "1024.0"
- title = "Free Memory"
- }
- metric {
- name = "mem_shared"
- value_threshold = "1024.0"
- title = "Shared Memory"
- }
- metric {
- name = "mem_buffers"
- value_threshold = "1024.0"
- title = "Memory Buffers"
- }
- metric {
- name = "mem_cached"
- value_threshold = "1024.0"
- title = "Cached Memory"
- }
- metric {
- name = "swap_free"
- value_threshold = "1024.0"
- title = "Free Swap Space"
- }
-}
-
-collection_group {
- collect_every = 40
- time_threshold = 300
- metric {
- name = "bytes_out"
- value_threshold = 4096
- title = "Bytes Sent"
- }
- metric {
- name = "bytes_in"
- value_threshold = 4096
- title = "Bytes Received"
- }
- metric {
- name = "pkts_in"
- value_threshold = 256
- title = "Packets Received"
- }
- metric {
- name = "pkts_out"
- value_threshold = 256
- title = "Packets Sent"
- }
-}
-
-
-collection_group {
- collect_every = 40
- time_threshold = 180
- metric {
- name = "disk_free"
- value_threshold = 1.0
- title = "Disk Space Available"
- }
- metric {
- name = "part_max_used"
- value_threshold = 1.0
- title = "Maximum Disk Space Used"
- }
- metric {
- name = "disk_total"
- value_threshold = 1.0
- title = "Total Disk Space"
- }
-}
-
-udp_recv_channel {
- port = 0
-}
-
-
-include ("${GANGLIA_CONF_DIR}/${gmondClusterName}/conf.d/*.conf")
-END_OF_GMOND_CORE_CONF
- else
- return 2;
- fi
- else
- return 1;
- fi
-}
-
-function generateGmondMasterConf
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- read gmondClusterName gmondMasterIP gmondPort <<<`getGangliaClusterInfo ${clusterName}`;
-
- # Check that all of ${gmondClusterName} and ${gmondMasterIP} and ${gmondPort} are populated.
- if [ "x" != "x${gmondClusterName}" -a "x" != "x${gmondMasterIP}" -a "x" != "x${gmondPort}" ]
- then
- now=`date`;
-
- cat << END_OF_GMOND_MASTER_CONF
-#################### Generated by ${0} on ${now} ####################
-/* Masters only receive; they never send. */
-udp_recv_channel {
- bind = ${gmondMasterIP}
- port = ${gmondPort}
-}
-
-/* The gmond cluster master must additionally provide an XML
- * description of the cluster to the gmetad that will query it.
- */
-tcp_accept_channel {
- bind = ${gmondMasterIP}
- port = ${gmondPort}
-}
-END_OF_GMOND_MASTER_CONF
- else
- return 2;
- fi
- else
- return 1;
- fi
-}
-
-function generateGmondSlaveConf
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- read gmondClusterName gmondMasterIP gmondPort <<<`getGangliaClusterInfo ${clusterName}`;
-
- # Check that all of ${gmondClusterName} and ${gmondMasterIP} and ${gmondPort} are populated.
- if [ "x" != "x${gmondClusterName}" -a "x" != "x${gmondMasterIP}" -a "x" != "x${gmondPort}" ]
- then
- now=`date`;
-
- cat << END_OF_GMOND_SLAVE_CONF
-#################### Generated by ${0} on ${now} ####################
-/* Slaves only send; they never receive. */
-udp_send_channel {
- #bind_hostname = yes # Highly recommended, soon to be default.
- # This option tells gmond to use a source address
- # that resolves to the machine's hostname. Without
- # this, the metrics may appear to come from any
- # interface and the DNS names associated with
- # those IPs will be used to create the RRDs.
- host = ${gmondMasterIP}
- port = ${gmondPort}
- ttl = 1
-}
-END_OF_GMOND_SLAVE_CONF
- else
- return 2;
- fi
- else
- return 1;
- fi
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py
deleted file mode 100755
index d29a944..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py
+++ /dev/null
@@ -1,207 +0,0 @@
-#!/usr/bin/env python
-
-'''
-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.
-'''
-
-import cgi
-import os
-import rrdtool
-import sys
-import time
-import re
-import urlparse
-
-# place this script in /var/www/cgi-bin of the Ganglia collector
-# requires 'yum install rrdtool-python' on the Ganglia collector
-
-
-def printMetric(clusterName, hostName, metricName, file, cf, start, end, resolution, pointInTime):
- if clusterName.endswith("rrds"):
- clusterName = ""
-
- args = [file, cf]
-
- if start is not None:
- args.extend(["-s", start])
-
- if end is not None:
- args.extend(["-e", end])
-
- if resolution is not None:
- args.extend(["-r", resolution])
-
- rrdMetric = rrdtool.fetch(args)
- # ds_name
- sys.stdout.write(rrdMetric[1][0])
- sys.stdout.write("\n")
-
- sys.stdout.write(clusterName)
- sys.stdout.write("\n")
- sys.stdout.write(hostName)
- sys.stdout.write("\n")
- sys.stdout.write(metricName)
- sys.stdout.write("\n")
-
- # write time
- sys.stdout.write(str(rrdMetric[0][0]))
- sys.stdout.write("\n")
- # write step
- sys.stdout.write(str(rrdMetric[0][2]))
- sys.stdout.write("\n")
-
- if not pointInTime:
- valueCount = 0
- lastValue = None
-
- for tuple in rrdMetric[2]:
-
- thisValue = tuple[0]
-
- if valueCount > 0 and thisValue == lastValue:
- valueCount += 1
- else:
- if valueCount > 1:
- sys.stdout.write("[~r]")
- sys.stdout.write(str(valueCount))
- sys.stdout.write("\n")
-
- if thisValue is None:
- sys.stdout.write("[~n]\n")
- else:
- sys.stdout.write(str(thisValue))
- sys.stdout.write("\n")
-
- valueCount = 1
- lastValue = thisValue
- else:
- value = None
- idx = -1
- tuple = rrdMetric[2]
- tupleLastIdx = len(tuple) * -1
-
- while value is None and idx >= tupleLastIdx:
- value = tuple[idx][0]
- idx-=1
-
- if value is not None:
- sys.stdout.write(str(value))
- sys.stdout.write("\n")
-
- sys.stdout.write("[~EOM]\n")
- return
-
-def stripList(l):
- return([x.strip() for x in l])
-
-sys.stdout.write("Content-type: text/plain\n\n")
-
-# write start time
-sys.stdout.write(str(time.mktime(time.gmtime())))
-sys.stdout.write("\n")
-
-requestMethod = os.environ['REQUEST_METHOD']
-
-if requestMethod == 'POST':
- postData = sys.stdin.readline()
- queryString = cgi.parse_qs(postData)
- queryString = dict((k, v[0]) for k, v in queryString.items())
-elif requestMethod == 'GET':
- queryString = dict(cgi.parse_qsl(os.environ['QUERY_STRING']));
-
-if "m" in queryString:
- metricParts = queryString["m"].split(",")
-else:
- metricParts = [""]
-metricParts = stripList(metricParts)
-
-hostParts = []
-if "h" in queryString:
- hostParts = queryString["h"].split(",")
-hostParts = stripList(hostParts)
-
-if "c" in queryString:
- clusterParts = queryString["c"].split(",")
-else:
- clusterParts = [""]
-clusterParts = stripList(clusterParts)
-
-if "p" in queryString:
- rrdPath = queryString["p"]
-else:
- rrdPath = "/var/lib/ganglia/rrds/"
-
-start = None
-if "s" in queryString:
- start = queryString["s"]
-
-end = None
-if "e" in queryString:
- end = queryString["e"]
-
-resolution = None
-if "r" in queryString:
- resolution = queryString["r"]
-
-if "cf" in queryString:
- cf = queryString["cf"]
-else:
- cf = "AVERAGE"
-
-if "pt" in queryString:
- pointInTime = True
-else:
- pointInTime = False
-
-def _walk(*args, **kwargs):
-
- for root,dirs,files in os.walk(*args, **kwargs):
- for dir in dirs:
- qualified_dir = os.path.join(root,dir)
- if os.path.islink(qualified_dir):
- for x in os.walk(qualified_dir, **kwargs):
- yield x
- yield (root, dirs, files)
-
-
-for cluster in clusterParts:
- for path, dirs, files in _walk(rrdPath + cluster):
- pathParts = path.split("/")
- #Process only path which contains files. If no host parameter passed - process all hosts folders and summary info
- #If host parameter passed - process only this host folder
- if len(files) > 0 and (len(hostParts) == 0 or pathParts[-1] in hostParts):
- for metric in metricParts:
- file = metric + ".rrd"
- fileFullPath = os.path.join(path, file)
- if os.path.exists(fileFullPath):
- #Exact name of metric
- printMetric(pathParts[-2], pathParts[-1], file[:-4], os.path.join(path, file), cf, start, end, resolution, pointInTime)
- else:
- #Regex as metric name
- metricRegex = metric + '\.rrd$'
- p = re.compile(metricRegex)
- matchedFiles = filter(p.match, files)
- for matchedFile in matchedFiles:
- printMetric(pathParts[-2], pathParts[-1], matchedFile[:-4], os.path.join(path, matchedFile), cf, start, end, resolution, pointInTime)
-
-
-sys.stdout.write("[~EOF]\n")
-# write end time
-sys.stdout.write(str(time.mktime(time.gmtime())))
-sys.stdout.write("\n")
-
-sys.stdout.flush
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrdcachedLib.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrdcachedLib.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrdcachedLib.sh
deleted file mode 100644
index 8b7c257..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrdcachedLib.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get access to Ganglia-wide constants etc.
-source ./gangliaLib.sh;
-
-RRDCACHED_BIN=/usr/bin/rrdcached;
-RRDCACHED_PID_FILE=${GANGLIA_RUNTIME_DIR}/rrdcached.pid;
-RRDCACHED_ALL_ACCESS_UNIX_SOCKET=${GANGLIA_RUNTIME_DIR}/rrdcached.sock;
-RRDCACHED_LIMITED_ACCESS_UNIX_SOCKET=${GANGLIA_RUNTIME_DIR}/rrdcached.limited.sock;
-
-function getRrdcachedLoggedPid()
-{
- if [ -e "${RRDCACHED_PID_FILE}" ]
- then
- echo `cat ${RRDCACHED_PID_FILE}`;
- fi
-}
-
-function getRrdcachedRunningPid()
-{
- rrdcachedLoggedPid=`getRrdcachedLoggedPid`;
-
- if [ -n "${rrdcachedLoggedPid}" ]
- then
- echo `ps -o pid=MYPID -p ${rrdcachedLoggedPid} | tail -1 | awk '{print $1}' | grep -v MYPID`;
- fi
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/setupGanglia.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/setupGanglia.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/setupGanglia.sh
deleted file mode 100644
index 5145b9c..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/setupGanglia.sh
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get access to Ganglia-wide constants, utilities etc.
-source ./gangliaLib.sh
-
-function usage()
-{
- cat << END_USAGE
-Usage: ${0} [-c <gmondClusterName> [-m]] [-t] [-o <owner>] [-g <group>]
-
-Options:
- -c <gmondClusterName> The name of the Ganglia Cluster whose gmond configuration we're here to generate.
-
- -m Whether this gmond (if -t is not specified) is the master for its Ganglia
- Cluster. Without this, we generate slave gmond configuration.
-
- -t Whether this is a call to generate gmetad configuration (as opposed to the
- gmond configuration that is generated without this).
- -o <owner> Owner
- -g <group> Group
-END_USAGE
-}
-
-function instantiateGmetadConf()
-{
- # gmetad utility library.
- source ./gmetadLib.sh;
-
- generateGmetadConf > ${GMETAD_CONF_FILE};
-}
-
-function instantiateGmondConf()
-{
- # gmond utility library.
- source ./gmondLib.sh;
-
- gmondClusterName=${1};
-
- if [ "x" != "x${gmondClusterName}" ]
- then
-
- createDirectory "${GANGLIA_RUNTIME_DIR}/${gmondClusterName}";
- createDirectory "${GANGLIA_CONF_DIR}/${gmondClusterName}/conf.d";
-
- # Always blindly generate the core gmond config - that goes on every box running gmond.
- generateGmondCoreConf ${gmondClusterName} > `getGmondCoreConfFileName ${gmondClusterName}`;
-
- isMasterGmond=${2};
-
- # Decide whether we want to add on the master or slave gmond config.
- if [ "0" -eq "${isMasterGmond}" ]
- then
- generateGmondSlaveConf ${gmondClusterName} > `getGmondSlaveConfFileName ${gmondClusterName}`;
- else
- generateGmondMasterConf ${gmondClusterName} > `getGmondMasterConfFileName ${gmondClusterName}`;
- fi
-
- chown -R ${3}:${4} ${GANGLIA_CONF_DIR}/${gmondClusterName}
-
- else
- echo "No gmondClusterName passed in, nothing to instantiate";
- fi
-}
-
-# main()
-
-gmondClusterName=;
-isMasterGmond=0;
-configureGmetad=0;
-owner='root';
-group='root';
-
-while getopts ":c:mto:g:" OPTION
-do
- case ${OPTION} in
- c)
- gmondClusterName=${OPTARG};
- ;;
- m)
- isMasterGmond=1;
- ;;
- t)
- configureGmetad=1;
- ;;
- o)
- owner=${OPTARG};
- ;;
- g)
- group=${OPTARG};
- ;;
- ?)
- usage;
- exit 1;
- esac
-done
-
-# Initialization.
-createDirectory ${GANGLIA_CONF_DIR};
-createDirectory ${GANGLIA_RUNTIME_DIR};
-# So rrdcached can drop its PID files in here.
-chmod a+w ${GANGLIA_RUNTIME_DIR};
-chown ${owner}:${group} ${GANGLIA_CONF_DIR};
-
-if [ -n "${gmondClusterName}" ]
-then
-
- # Be forgiving of users who pass in -c along with -t (which always takes precedence).
- if [ "1" -eq "${configureGmetad}" ]
- then
- instantiateGmetadConf;
- else
- instantiateGmondConf ${gmondClusterName} ${isMasterGmond} ${owner} ${group};
- fi
-
-elif [ "1" -eq "${configureGmetad}" ]
-then
- instantiateGmetadConf;
-else
- usage;
- exit 2;
-fi
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmetad.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmetad.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmetad.sh
deleted file mode 100644
index ab5102d..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmetad.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get all our common constants etc. set up.
-source ./gmetadLib.sh;
-
-# To get access to ${RRDCACHED_ALL_ACCESS_UNIX_SOCKET}.
-source ./rrdcachedLib.sh;
-
-# Before starting gmetad, start rrdcached.
-./startRrdcached.sh;
-
-if [ $? -eq 0 ]
-then
- gmetadRunningPid=`getGmetadRunningPid`;
-
- # Only attempt to start gmetad if there's not already one running.
- if [ -z "${gmetadRunningPid}" ]
- then
- env RRDCACHED_ADDRESS=${RRDCACHED_ALL_ACCESS_UNIX_SOCKET} \
- ${GMETAD_BIN} --conf=${GMETAD_CONF_FILE} --pid-file=${GMETAD_PID_FILE};
-
- for i in `seq 0 5`; do
- gmetadRunningPid=`getGmetadRunningPid`;
- if [ -n "${gmetadRunningPid}" ]
- then
- break;
- fi
- sleep 1;
- done
-
- if [ -n "${gmetadRunningPid}" ]
- then
- echo "Started ${GMETAD_BIN} with PID ${gmetadRunningPid}";
- else
- echo "Failed to start ${GMETAD_BIN}";
- exit 1;
- fi
- else
- echo "${GMETAD_BIN} already running with PID ${gmetadRunningPid}";
- fi
-else
- echo "Not starting ${GMETAD_BIN} because starting ${RRDCACHED_BIN} failed.";
- exit 2;
-fi
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmond.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmond.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmond.sh
deleted file mode 100644
index 55420b7..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmond.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get all our common constants etc. set up.
-# Pulls in gangliaLib.sh as well, so we can skip pulling it in again.
-source ./gmondLib.sh;
-
-function startGmondForCluster()
-{
- gmondClusterName=${1};
-
- gmondRunningPid=`getGmondRunningPid ${gmondClusterName}`;
-
- # Only attempt to start gmond if there's not already one running.
- if [ -z "${gmondRunningPid}" ]
- then
- gmondCoreConfFileName=`getGmondCoreConfFileName ${gmondClusterName}`;
- removeGmondPidFileName ${gmondClusterName};
- if [ -e "${gmondCoreConfFileName}" ]
- then
- gmondPidFileName=`getGmondPidFileName ${gmondClusterName}`;
-
- ${GMOND_BIN} --conf=${gmondCoreConfFileName} --pid-file=${gmondPidFileName};
-
- for i in `seq 0 5`; do
- gmondRunningPid=`getGmondRunningPid ${gmondClusterName}`;
- if [ -n "${gmondRunningPid}" ]
- then
- break;
- fi
- sleep 1;
- done
-
- if [ -n "${gmondRunningPid}" ]
- then
- echo "Started ${GMOND_BIN} for cluster ${gmondClusterName} with PID ${gmondRunningPid}";
- else
- echo "Failed to start ${GMOND_BIN} for cluster ${gmondClusterName}";
- exit 1;
- fi
- fi
- else
- echo "${GMOND_BIN} for cluster ${gmondClusterName} already running with PID ${gmondRunningPid}";
- fi
-}
-
-# main()
-gmondClusterName=${1};
-
-if [ "x" == "x${gmondClusterName}" ]
-then
- # No ${gmondClusterName} passed in as command-line arg, so start
- # all the gmonds we know about.
- for gmondClusterName in `getConfiguredGangliaClusterNames`
- do
- startGmondForCluster ${gmondClusterName};
- done
-else
- # Just start the one ${gmondClusterName} that was asked for.
- startGmondForCluster ${gmondClusterName};
-fi
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startRrdcached.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startRrdcached.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startRrdcached.sh
deleted file mode 100644
index e79472b..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startRrdcached.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Slurp in all our user-customizable settings.
-source ./gangliaEnv.sh;
-
-# Get all our common constants etc. set up.
-source ./rrdcachedLib.sh;
-
-rrdcachedRunningPid=`getRrdcachedRunningPid`;
-
-# Only attempt to start rrdcached if there's not already one running.
-if [ -z "${rrdcachedRunningPid}" ]
-then
- #changed because problem puppet had with nobody user
- #sudo -u ${GMETAD_USER} ${RRDCACHED_BIN} -p ${RRDCACHED_PID_FILE} \
- # -m 664 -l unix:${RRDCACHED_ALL_ACCESS_UNIX_SOCKET} \
- # -m 777 -P FLUSH,STATS,HELP -l unix:${RRDCACHED_LIMITED_ACCESS_UNIX_SOCKET} \
- # -b /var/lib/ganglia/rrds -B
- su - ${GMETAD_USER} -c "${RRDCACHED_BIN} -p ${RRDCACHED_PID_FILE} \
- -m 664 -l unix:${RRDCACHED_ALL_ACCESS_UNIX_SOCKET} \
- -m 777 -P FLUSH,STATS,HELP -l unix:${RRDCACHED_LIMITED_ACCESS_UNIX_SOCKET} \
- -b ${RRDCACHED_BASE_DIR} -B"
-
- # Ideally, we'd use ${RRDCACHED_BIN}'s -s ${WEBSERVER_GROUP} option for
- # this, but it doesn't take sometimes due to a lack of permissions,
- # so perform the operation explicitly to be super-sure.
- chgrp ${WEBSERVER_GROUP} ${RRDCACHED_ALL_ACCESS_UNIX_SOCKET};
- chgrp ${WEBSERVER_GROUP} ${RRDCACHED_LIMITED_ACCESS_UNIX_SOCKET};
-
- # Check to make sure rrdcached actually started up.
- for i in `seq 0 5`; do
- rrdcachedRunningPid=`getRrdcachedRunningPid`;
- if [ -n "${rrdcachedRunningPid}" ]
- then
- break;
- fi
- sleep 1;
- done
-
- if [ -n "${rrdcachedRunningPid}" ]
- then
- echo "Started ${RRDCACHED_BIN} with PID ${rrdcachedRunningPid}";
- else
- echo "Failed to start ${RRDCACHED_BIN}";
- exit 1;
- fi
-else
- echo "${RRDCACHED_BIN} already running with PID ${rrdcachedRunningPid}";
-fi
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmetad.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmetad.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmetad.sh
deleted file mode 100644
index 2764e0e..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmetad.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get all our common constants etc. set up.
-source ./gmetadLib.sh;
-
-gmetadRunningPid=`getGmetadRunningPid`;
-
-# Only go ahead with the termination if we could find a running PID.
-if [ -n "${gmetadRunningPid}" ]
-then
- kill -KILL ${gmetadRunningPid};
- echo "Stopped ${GMETAD_BIN} (with PID ${gmetadRunningPid})";
-fi
-
-# Poll again.
-gmetadRunningPid=`getGmetadRunningPid`;
-
-# Once we've killed gmetad, there should no longer be a running PID.
-if [ -z "${gmetadRunningPid}" ]
-then
- # It's safe to stop rrdcached now.
- ./stopRrdcached.sh;
-fi
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmond.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmond.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmond.sh
deleted file mode 100644
index 94cfc28..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmond.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get all our common constants etc. set up.
-# Pulls in gangliaLib.sh as well, so we can skip pulling it in again.
-source ./gmondLib.sh;
-
-function stopGmondForCluster()
-{
- gmondClusterName=${1};
-
- gmondRunningPid=`getGmondRunningPid ${gmondClusterName}`;
-
- # Only go ahead with the termination if we could find a running PID.
- if [ -n "${gmondRunningPid}" ]
- then
- kill -KILL ${gmondRunningPid};
- removeGmondPidFileName ${gmondClusterName};
- echo "Stopped ${GMOND_BIN} for cluster ${gmondClusterName} (with PID ${gmondRunningPid})";
- fi
-}
-
-# main()
-gmondClusterName=${1};
-
-if [ "x" == "x${gmondClusterName}" ]
-then
- # No ${gmondClusterName} passed in as command-line arg, so stop
- # all the gmonds we know about.
- for gmondClusterName in `getConfiguredGangliaClusterNames`
- do
- stopGmondForCluster ${gmondClusterName};
- done
-else
- stopGmondForCluster ${gmondClusterName};
-fi
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopRrdcached.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopRrdcached.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopRrdcached.sh
deleted file mode 100644
index 0a0d8d8..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopRrdcached.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get all our common constants etc. set up.
-source ./rrdcachedLib.sh;
-
-rrdcachedRunningPid=`getRrdcachedRunningPid`;
-
-# Only go ahead with the termination if we could find a running PID.
-if [ -n "${rrdcachedRunningPid}" ]
-then
- kill -TERM ${rrdcachedRunningPid};
- # ${RRDCACHED_BIN} takes a few seconds to drain its buffers, so wait
- # until we're sure it's well and truly dead.
- #
- # Without this, an immediately following startRrdcached.sh won't do
- # anything, because it still sees this soon-to-die instance alive,
- # and the net result is that after a few seconds, there's no
- # ${RRDCACHED_BIN} running on the box anymore.
- sleep 5;
- echo "Stopped ${RRDCACHED_BIN} (with PID ${rrdcachedRunningPid})";
-fi
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/teardownGanglia.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/teardownGanglia.sh b/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/teardownGanglia.sh
deleted file mode 100644
index b27f7a2..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/teardownGanglia.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-# Get access to Ganglia-wide constants, utilities etc.
-source ./gangliaLib.sh;
-
-# Undo what we did while setting up Ganglia on this box.
-rm -rf ${GANGLIA_CONF_DIR};
-rm -rf ${GANGLIA_RUNTIME_DIR};
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config.pp
deleted file mode 100644
index bf69f51..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config.pp
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia::config(
- $ganglia_server_host = undef,
- $service_state = $hdp::params::cluster_service_state
-)
-{
- if ($service_state in ['running','installed_and_configured','stopped']) {
- #TODO: divide into what is needed on server vs what is needed on monitored nodes
- $shell_cmds_dir = $hdp-ganglia::params::ganglia_shell_cmds_dir
- $shell_files = ['checkGmond.sh','checkRrdcached.sh','gmetadLib.sh','gmondLib.sh','rrdcachedLib.sh' ,'setupGanglia.sh','startGmetad.sh','startGmond.sh','startRrdcached.sh','stopGmetad.sh','stopGmond.sh','stopRrdcached.sh','teardownGanglia.sh']
-
- hdp::directory_recursive_create { $shell_cmds_dir :
- owner => root,
- group => root
- }
-
- hdp-ganglia::config::init_file { ['gmetad','gmond']: }
-
- hdp-ganglia::config::shell_file { $shell_files: }
-
- hdp-ganglia::config::file { ['gangliaClusters.conf','gangliaEnv.sh','gangliaLib.sh']:
- ganglia_server_host => $ganglia_server_host
- }
-
- anchor{'hdp-ganglia::config::begin':} -> Hdp::Directory_recursive_create[$shell_cmds_dir] -> Hdp-ganglia::Config::Shell_file<||> -> anchor{'hdp-ganglia::config::end':}
- Anchor['hdp-ganglia::config::begin'] -> Hdp-ganglia::Config::Init_file<||> -> Anchor['hdp-ganglia::config::end']
- Anchor['hdp-ganglia::config::begin'] -> Hdp-ganglia::Config::File<||> -> Anchor['hdp-ganglia::config::end']
- }
-}
-
-define hdp-ganglia::config::shell_file()
-{
- file { "${hdp-ganglia::params::ganglia_shell_cmds_dir}/${name}":
- source => "puppet:///modules/hdp-ganglia/${name}",
- mode => '0755'
- }
-}
-
-define hdp-ganglia::config::init_file()
-{
- file { "/etc/init.d/hdp-${name}":
- source => "puppet:///modules/hdp-ganglia/${name}.init",
- mode => '0755'
- }
-}
-
-### config files
-define hdp-ganglia::config::file(
- $ganglia_server_host = undef
-)
-{
- hdp::configfile { "${hdp-ganglia::params::ganglia_shell_cmds_dir}/${name}":
- component => 'ganglia',
- owner => root,
- group => root
- }
- if ($ganglia_server_host != undef) {
- Hdp::Configfile<||>{ganglia_server_host => $ganglia_server_host}
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_daemon.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_daemon.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_daemon.pp
deleted file mode 100755
index 1718cb8..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_daemon.pp
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-#
-# 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.
-#
-#
-#TODO: these scripts called should be converted to native puppet
-define hdp-ganglia::config::generate_daemon(
- $ganglia_service,
- $role,
- $owner = 'root',
- $group = $hdp::params::user_group
-)
-{
- $shell_cmds_dir = $hdp-ganglia::params::ganglia_shell_cmds_dir
- $cmd = $ganglia_service ? {
- 'gmond' => $role ? {
- 'server' => "${shell_cmds_dir}/setupGanglia.sh -c ${name} -m -o ${owner} -g ${group}",
- default => "${shell_cmds_dir}/setupGanglia.sh -c ${name} -o ${owner} -g ${group}"
- },
- 'gmetad' => "${shell_cmds_dir}/setupGanglia.sh -t -o ${owner} -g ${group}",
- default => hdp_fail("Unexpected ganglia service: ${$ganglia_service}")
- }
-
- #TODO: put in test condition
- hdp::exec { $cmd:
- command => $cmd
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmetad/service_check.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmetad/service_check.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmetad/service_check.pp
deleted file mode 100644
index 15cbe36..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmetad/service_check.pp
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia::hdp-gmetad::service_check()
-{
-
- anchor { 'hdp-ganglia::hdp-gmetad::service_check::begin':}
-
- exec { 'hdp-gmetad':
- command => "/etc/init.d/hdp-gmetad status | grep -v failed",
- tries => 3,
- try_sleep => 5,
- path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
- before => Anchor['hdp-ganglia::hdp-gmetad::service_check::end'],
- logoutput => "true"
- }
-
- anchor{ 'hdp-ganglia::hdp-gmetad::service_check::end':}
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmond/service_check.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmond/service_check.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmond/service_check.pp
deleted file mode 100644
index 8c1ed52..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/hdp-gmond/service_check.pp
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia::hdp-gmond::service_check()
-{
-
- anchor { 'hdp-ganglia::hdp-gmond::service_check::begin':}
-
- exec { 'hdp-gmond':
- command => "/etc/init.d/hdp-gmond status | grep -v failed",
- tries => 3,
- try_sleep => 5,
- path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
- before => Anchor['hdp-ganglia::hdp-gmond::service_check::end'],
- logoutput => "true"
- }
-
- anchor{ 'hdp-ganglia::hdp-gmond::service_check::end':}
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/init.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/init.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/init.pp
deleted file mode 100644
index 2c98355..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/init.pp
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia(
- $service_state
-)
-{
- if ! ($service_state in ['no_op', 'uninstalled']) {
- include hdp-ganglia::params
- $gmetad_user = $hdp-ganglia::params::gmetad_user
- $gmond_user = $hdp-ganglia::params::gmond_user
-
- hdp::group { 'gmetad_group' :
- group_name => $gmetad_user,
- }
-
- hdp::group { 'gmond_group':
- group_name => $gmond_user,
- }
-
- hdp::user { 'gmond_user':
- user_name => $gmond_user,
- gid => $gmond_user,
- groups => ["$gmond_user"]
- }
-
- hdp::user { 'gmetad_user':
- user_name => $gmetad_user,
- gid => $gmetad_user,
- groups => ["$gmetad_user"]
- }
-
- anchor{'hdp-ganglia::begin':} -> Hdp::Group<|title == 'gmond_group' or title == 'gmetad_group'|> -> Hdp::User['gmond_user'] -> Hdp::User['gmetad_user'] -> anchor{'hdp-ganglia::end':}
- }
-}
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor.pp
deleted file mode 100644
index 965eb30..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor.pp
+++ /dev/null
@@ -1,165 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia::monitor(
- $service_state = $hdp::params::cluster_service_state,
- $ganglia_server_host = undef,
- $opts = {}
-) inherits hdp-ganglia::params
-{
- if ($service_state == 'no_op') {
- } elsif ($service_state == 'uninstalled') {
-
- hdp::package { 'ganglia-monitor':
- ensure => 'uninstalled',
- java_needed => false
- }
-
- } else {
- if ($hdp::params::service_exists['hdp-ganglia::server'] != true) {
- class { 'hdp-ganglia':
- service_state => $service_state
- }
- }
-
- hdp::package { 'ganglia-monitor': }
-
- hdp::package { 'ganglia-gmond-modules-python': }
-
- if ($hdp::params::service_exists['hdp-ganglia::server'] != true) {
- class { 'hdp-ganglia::config': ganglia_server_host => $ganglia_server_host}
- }
-
- if (($hdp::params::service_exists['hdp-hadoop::datanode'] == true) or ($hdp::params::service_exists['hdp-hadoop::namenode'] == true) or ($hdp::params::service_exists['hdp-hadoop::jobtracker'] == true) or ($hdp::params::service_exists['hdp-hadoop::tasktracker'] == true) or ($hdp::params::service_exists['hdp-yarn::resourcemanager'] == true) or ($hdp::params::service_exists['hdp-yarn::nodemanager'] == true) or ($hdp::params::service_exists['hdp-yarn::historyserver'] == true) or ($hdp::params::service_exists['hdp-hadoop::client'] == true) or ($hdp::params::service_exists['hdp-hadoop::snamenode'] == true)) {
- class { 'hdp-hadoop::enable-ganglia': }
- }
-
- if ($service_exists['hdp-hbase::master'] == true) {
- class { 'hdp-hbase::master::enable-ganglia': }
- }
-
- if ($service_exists['hdp-hbase::regionserver'] == true) {
- class { 'hdp-hbase::regionserver::enable-ganglia': }
- }
-
- class { 'hdp-ganglia::monitor::config-gen': }
-
- class { 'hdp-ganglia::monitor::gmond': ensure => $service_state}
-
- class { 'hdp-ganglia::monitor::ownership': }
-
- if ($hdp::params::service_exists['hdp-ganglia::server'] != true) {
- Class['hdp-ganglia'] -> Hdp::Package['ganglia-monitor'] -> Hdp::Package['ganglia-gmond-modules-python'] -> Class['hdp-ganglia::config'] ->
- Class['hdp-ganglia::monitor::config-gen'] -> Class['hdp-ganglia::monitor::ownership'] ->
- Class['hdp-ganglia::monitor::gmond']
- } else {
- Hdp::Package['ganglia-monitor'] -> Hdp::Package['ganglia-gmond-modules-python'] -> Class['hdp-ganglia::monitor::config-gen'] ->
- Class['hdp-ganglia::monitor::ownership'] -> Class['hdp-ganglia::monitor::gmond']
- }
- }
-}
-
-
-class hdp-ganglia::monitor::config-gen()
-{
-
- $service_exists = $hdp::params::service_exists
-
- if ($hdp::params::is_namenode_master) {
- hdp-ganglia::config::generate_daemon { 'HDPNameNode':}
- }
- if ($hdp::params::is_jtnode_master) {
- hdp-ganglia::config::generate_daemon { 'HDPJobTracker':}
- }
- if ($hdp::params::is_rmnode_master) {
- hdp-ganglia::config::generate_daemon { 'HDPResourceManager':}
- }
- if ($hdp::params::is_hsnode_master) {
- hdp-ganglia::config::generate_daemon { 'HDPHistoryServer':}
- }
- if ($hdp::params::is_hbase_master) {
- hdp-ganglia::config::generate_daemon { 'HDPHBaseMaster':}
- }
-
- if (($hdp::params::is_slave == true)
- or (($hdp::params::is_namenode_master == false)
- and ($hdp::params::is_jtnode_master == false)
- and ($hdp::params::is_rmnode_master == false)
- and ($hdp::params::is_hsnode_master == false)
- and ($hdp::params::is_hbase_master == false))) {
- hdp-ganglia::config::generate_daemon { 'HDPSlaves':}
- }
-
- Hdp-ganglia::Config::Generate_daemon<||>{
- ganglia_service => 'gmond',
- role => 'monitor'
- }
- #
- anchor{'hdp-ganglia::monitor::config-gen::begin':} -> Hdp-ganglia::Config::Generate_daemon<||> -> anchor{'hdp-ganglia::monitor::config-gen::end':}
-}
-
-class hdp-ganglia::monitor::gmond(
- $ensure
- )
-{
- if ($ensure == 'running') {
- class { 'hdp-ganglia::server::delete_default_gmond_process': }
- $command = "service hdp-gmond start >> /tmp/gmond.log 2>&1 ; /bin/ps auwx | /bin/grep [g]mond >> /tmp/gmond.log 2>&1"
- } elsif ($ensure == 'stopped') {
- $command = "service hdp-gmond stop >> /tmp/gmond.log 2>&1 ; /bin/ps auwx | /bin/grep [g]mond >> /tmp/gmond.log 2>&1"
- }
- if ($ensure == 'running' or $ensure == 'stopped') {
- hdp::exec { "hdp-gmond service" :
- command => $command,
- path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'
- }
- }
-}
-
-class hdp-ganglia::monitor::ownership() {
-
- file { "${hdp-ganglia::params::ganglia_dir}/conf.d":
- owner => 'root',
- group => $hdp::params::user_group
- }
-
- file { "${hdp-ganglia::params::ganglia_dir}/conf.d/modgstatus.conf":
- owner => 'root',
- group => $hdp::params::user_group
- }
-
- file { "${hdp-ganglia::params::ganglia_dir}/conf.d/multicpu.conf":
- owner => 'root',
- group => $hdp::params::user_group
- }
-
- file { "${hdp-ganglia::params::ganglia_dir}/gmond.conf":
- owner => 'root',
- group => $hdp::params::user_group
- }
-}
-
-class hdp-ganglia::server::delete_default_gmond_process() {
- hdp::exec { "delete_default_gmond_process" :
- command => "chkconfig gmond off",
- path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
- require => Class['hdp-ganglia::monitor::gmond']
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor_and_server.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor_and_server.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor_and_server.pp
deleted file mode 100644
index 418c4cb..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor_and_server.pp
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia::monitor_and_server(
- $service_state = $hdp::params::cluster_service_state,
- $opts = {}
-) inherits hdp-ganglia::params
-{
- $ganglia_shell_cmds_dir = $hdp-ganglia::params::ganglia_shell_cmds_dir
- $ganglia_conf_dir = $hdp-ganglia::params::ganglia_conf_dir
- $ganglia_runtime_dir = $hdp-ganglia::params::ganglia_runtime_dir
-
- #note: includes the common package ganglia-monitor
- class { 'hdp-ganglia':
- service_state => $service_state
- }
-
- if ($service_state == 'no_op') {
- } elsif ($service_state in ['uninstalled']) {
- class { 'hdp-ganglia::server::packages':
- ensure => 'uninstalled'
- }
-
- hdp::directory { [$ganglia_conf_dir,$ganglia_runtime_dir]:
- service_state => $service_state,
- force => true
- }
-
- class { 'hdp-ganglia::config':
- service_state => $service_state
- }
-
- Class['hdp-ganglia'] -> Class['hdp-ganglia::server::packages'] ->
- Hdp::Directory[$ganglia_conf_dir] -> Hdp::Directory[$ganglia_runtime_dir] ->
- Class['hdp-ganglia::config']
- } elsif ($service_state in ['running','stopped','installed_and_configured']) {
- class { 'hdp-ganglia::server::packages': }
-
- class { 'hdp-ganglia::config':
- ganglia_server_host => $hdp::params::host_address,
- service_state => $service_state
- }
-
- class {'hdp-ganglia::monitor::config-gen': }
-
-
- hdp-ganglia::config::generate_daemon { 'gmetad':
- ganglia_service => 'gmetad'
- }
-
- class { 'hdp-ganglia::service::change_permission':
- ensure => $service_state
- }
-
- #top level no anchors needed
- Class['hdp-ganglia'] -> Class['hdp-ganglia::server::packages'] -> Class['hdp-ganglia::config'] ->
- Class['hdp-ganglia::monitor::config-gen'] -> Hdp-ganglia::Config::Generate_daemon['gmetad'] ->
- Class['hdp-ganglia::service::change_permission']
- } else {
- hdp_fail("TODO not implemented yet: service_state = ${service_state}")
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/params.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/params.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/params.pp
deleted file mode 100644
index 31c8a1f..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/params.pp
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia::params() inherits hdp::params
-{
- $ganglia_conf_dir = "/etc/ganglia/hdp"
- $ganglia_dir = "/etc/ganglia"
- $ganglia_runtime_dir = "/var/run/ganglia/hdp"
-
- $ganglia_shell_cmds_dir = hdp_default("ganglia_shell_cmd_dir","/usr/libexec/hdp/ganglia")
-
- $gmetad_user = $hdp::params::gmetad_user
- $gmond_user = $hdp::params::gmond_user
-
- $webserver_group = hdp_default("webserver_group","apache")
- $rrdcached_default_base_dir = "/var/lib/ganglia/rrds"
- $rrdcached_base_dir = hdp_default("rrdcached_base_dir", "/var/lib/ganglia/rrds")
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/server.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/server.pp b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/server.pp
deleted file mode 100644
index 7dca30c..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/server.pp
+++ /dev/null
@@ -1,259 +0,0 @@
-#
-#
-# 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.
-#
-#
-class hdp-ganglia::server(
- $service_state = $hdp::params::cluster_service_state,
- $opts = {}
-) inherits hdp-ganglia::params
-{
- $hdp::params::service_exists['hdp-ganglia::server'] = true
-
- if ($service_state == 'no_op') {
- } elsif ($service_state == 'uninstalled') {
-
- class { 'hdp-ganglia::server::packages':
- ensure => 'uninstalled',
- service_state => $service_state
- }
-
- class { 'hdp-ganglia::server::files':
- ensure => 'absent'
- }
-
- } else {
- class { 'hdp-ganglia':
- service_state => $service_state
- }
-
- class { 'hdp-ganglia::server::packages':
- ensure => 'present',
- service_state => $service_state
- }
-
- class { 'hdp-ganglia::config':
- ganglia_server_host => $hdp::params::host_address,
- service_state => $service_state
- }
-
- if ($hdp::params::has_namenodes) {
- hdp-ganglia::config::generate_daemon { 'HDPNameNode':
- ganglia_service => 'gmond',
- role => 'server'
- }
- }
-
- if ($hdp::params::has_jobtracker) {
- hdp-ganglia::config::generate_daemon { 'HDPJobTracker':
- ganglia_service => 'gmond',
- role => 'server'
- }
- }
-
- if ($hdp::params::has_hbase_masters) {
- hdp-ganglia::config::generate_daemon { 'HDPHBaseMaster':
- ganglia_service => 'gmond',
- role => 'server'
- }
- }
-
- if ($hdp::params::has_resourcemanager) {
- hdp-ganglia::config::generate_daemon { 'HDPResourceManager':
- ganglia_service => 'gmond',
- role => 'server'
- }
- }
-
- if ($hdp::params::has_histroryserver) {
- hdp-ganglia::config::generate_daemon { 'HDPHistoryServer':
- ganglia_service => 'gmond',
- role => 'server'
- }
- }
-
- hdp-ganglia::config::generate_daemon { 'HDPSlaves':
- ganglia_service => 'gmond',
- role => 'server'
- }
-
- hdp-ganglia::config::generate_daemon { 'gmetad':
- ganglia_service => 'gmetad',
- role => 'server'
- }
-
- class { 'hdp-ganglia::server::gmetad': ensure => $service_state}
-
- class { 'hdp-ganglia::service::change_permission': ensure => $service_state }
-
- if ($service_state == 'installed_and_configured') {
- $webserver_state = 'restart'
- } elsif ($service_state == 'running') {
- $webserver_state = 'running'
- } else {
- # We are never stopping httpd
- #$webserver_state = $service_state
- }
-
- class { 'hdp-monitor-webserver': service_state => $webserver_state}
-
- class { 'hdp-ganglia::server::files':
- ensure => 'present'
- }
-
- file { "${hdp-ganglia::params::ganglia_dir}/gmetad.conf":
- owner => 'root',
- group => $hdp::params::user_group
- }
-
- #top level does not need anchors
- Class['hdp-ganglia'] -> Class['hdp-ganglia::server::packages'] -> Class['hdp-ganglia::config'] ->
- Hdp-ganglia::Config::Generate_daemon<||> ->
- File["${hdp-ganglia::params::ganglia_dir}/gmetad.conf"] -> Class['hdp-ganglia::service::change_permission'] ->
- Class['hdp-ganglia::server::files'] -> Class['hdp-ganglia::server::gmetad'] -> Class['hdp-monitor-webserver']
- }
-}
-
-class hdp-ganglia::server::packages(
- $ensure = present,
- $service_state = 'installed_and_configured'
-)
-{
- hdp::package { ['libganglia','ganglia-devel','ganglia-server','ganglia-web']:
- ensure => $ensure,
- java_needed => false,
- require => Hdp::Package ['rrdtool-python']
- }
-
- # Removing conflicting packages only once to workaround "/bin/rpm -e absent-absent-absent.absent" bug (BUG-2881)
- if ($service_state == 'installed_and_configured' and $hdp::params::hdp_os_type == 'centos5') {
- # Remove conflicting 32bit package
- hdp::package { ['rrdtool-devel']:
- ensure => 'absent',
- java_needed => false,
- before => Hdp::Package ['rrdtool']
- }
-
- # Remove conflicting 32bit package
- hdp::package { ['rrdtool']:
- ensure => 'absent',
- java_needed => false,
- before => Hdp::Package ['rrdtool-python']
- }
- }
-
- hdp::package { ['rrdtool-python']:
- ensure => $ensure,
- java_needed => false
- }
-
-}
-
-class hdp-ganglia::server::files(
- $ensure = present
-)
-{
- $rrd_py_path = $hdp::params::rrd_py_path [$hdp::params::hdp_os_type]
- hdp::directory_recursive_create{$rrd_py_path:
- ensure => "directory",
- override_owner => false
- }
-
- $rrd_py_file_path = "${rrd_py_path}/rrd.py"
-
- file{$rrd_py_file_path :
- ensure => $ensure,
- source => "puppet:///modules/hdp-ganglia/rrd.py",
- mode => '0755'
- }
-
- anchor{ 'hdp-ganglia::server::files::begin' : } -> Hdp::Directory_recursive_create[$rrd_py_path] -> File[$rrd_py_file_path] -> anchor{ 'hdp-ganglia::server::files::end' : }
-
- $rrd_files_dir = $hdp-ganglia::params::rrdcached_base_dir
- $rrd_file_owner = $hdp-ganglia::params::gmetad_user
- $rrdcached_default_file_dir = $hdp-ganglia::params::rrdcached_default_base_dir
-
- ## If directory is different fr omdefault make sure it exists
- if ($rrdcached_default_file_dir != $rrd_files_dir) {
- hdp::directory_recursive_create{ $rrd_files_dir :
- ensure => "directory",
- owner => $rrd_file_owner,
- group => $rrd_file_owner,
- mode => '0755'
- }
-
- file { $rrdcached_default_file_dir :
- ensure => link,
- target => $rrd_files_dir,
- force => true
- }
-
- File[$rrd_py_file_path] -> Hdp::Directory_recursive_create[$rrd_files_dir] -> File[$rrdcached_default_file_dir] -> Anchor['hdp-ganglia::server::files::end']
- }
- elsif ($rrd_file_owner != $hdp::params::NOBODY_USER) {
- #owner of rrdcached_default_file_dir is 'nobody' by default
- #need to change owner to gmetad_user for proper gmetad service start
-
- hdp::directory { $rrdcached_default_file_dir:
- owner => $rrd_file_owner,
- group => $rrd_file_owner,
- override_owner => true
- }
-
- File[$rrd_py_file_path] -> Hdp::Directory[$rrdcached_default_file_dir] -> Anchor['hdp-ganglia::server::files::end']
- }
-}
-
-
-class hdp-ganglia::service::change_permission(
- $ensure
-)
-{
- if ($ensure == 'running' or $ensure == 'installed_and_configured') {
- hdp::directory_recursive_create { '/var/lib/ganglia/dwoo' :
- mode => '0777',
- owner => $hdp-ganglia::params::gmetad_user
- }
- }
-}
-
-class hdp-ganglia::server::gmetad(
- $ensure
-)
-{
- if ($ensure == 'running') {
- class { 'hdp-ganglia::server::delete_default_gmetad_process': }
- $command = "service hdp-gmetad start >> /tmp/gmetad.log 2>&1 ; /bin/ps auwx | /bin/grep [g]metad >> /tmp/gmetad.log 2>&1"
- } elsif ($ensure == 'stopped') {
- $command = "service hdp-gmetad stop >> /tmp/gmetad.log 2>&1 ; /bin/ps auwx | /bin/grep [g]metad >> /tmp/gmetad.log 2>&1"
- }
- if ($ensure == 'running' or $ensure == 'stopped') {
- hdp::exec { "hdp-gmetad service" :
- command => "$command",
- path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'
- }
- }
-}
-
-class hdp-ganglia::server::delete_default_gmetad_process() {
- hdp::exec { "delete_default_gmetad_process" :
- command => "chkconfig gmetad off",
- path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
- require => Class['hdp-ganglia::server::gmetad']
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaClusters.conf.erb
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaClusters.conf.erb b/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaClusters.conf.erb
deleted file mode 100644
index 5e03bd5..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaClusters.conf.erb
+++ /dev/null
@@ -1,43 +0,0 @@
-#/*
-# * 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.
-# */
-
-#########################################################
-### ClusterName GmondMasterHost GmondPort ###
-#########################################################
-
- HDPSlaves <%=scope.function_hdp_host("ganglia_server_host")%> 8660
-
-<% if (scope.function_hdp_default('namenode_host') != '')%>
- HDPNameNode <%=scope.function_hdp_host("ganglia_server_host")%> 8661
-<%end-%>
-<% if (scope.function_hdp_get_major_stack_version([scope.function_hdp_template_var("stack_version")]) < 2)%>
- <% if (scope.function_hdp_default('jtnode_host') != '')%>
- HDPJobTracker <%=scope.function_hdp_host("ganglia_server_host")%> 8662
- <%end-%>
-<%end-%>
-<% if (scope.function_hdp_default('hbase_master_hosts') != '')%>
- HDPHBaseMaster <%=scope.function_hdp_host("ganglia_server_host")%> 8663
-<%end-%>
-<% if (scope.function_hdp_get_major_stack_version([scope.function_hdp_template_var("stack_version")]) >= 2)%>
- <% if (scope.function_hdp_default('rm_host') != '')%>
- HDPResourceManager <%=scope.function_hdp_host("ganglia_server_host")%> 8664
- <%end-%>
- <% if (scope.function_hdp_default('hs_host') != '')%>
- HDPHistoryServer <%=scope.function_hdp_host("ganglia_server_host")%> 8666
- <%end-%>
-<%end-%>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaEnv.sh.erb
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaEnv.sh.erb b/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaEnv.sh.erb
deleted file mode 100644
index 4be541d..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaEnv.sh.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/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.
-# */
-
-# Unix users and groups for the binaries we start up.
-GMETAD_USER=<%=scope.function_hdp_template_var("gmetad_user")%>;
-GMOND_USER=<%=scope.function_hdp_template_var("gmond_user")%>;
-WEBSERVER_GROUP=<%=scope.function_hdp_template_var("webserver_group")%>;
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaLib.sh.erb
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaLib.sh.erb b/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaLib.sh.erb
deleted file mode 100644
index f129e37..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/templates/gangliaLib.sh.erb
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/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.
-# */
-
-cd `dirname ${0}`;
-
-GANGLIA_CONF_DIR=<%=scope.function_hdp_template_var("ganglia_conf_dir")%>;
-GANGLIA_RUNTIME_DIR=<%=scope.function_hdp_template_var("ganglia_runtime_dir")%>;
-RRDCACHED_BASE_DIR=<%=scope.function_hdp_template_var("rrdcached_base_dir")%>;
-
-# This file contains all the info about each Ganglia Cluster in our Grid.
-GANGLIA_CLUSTERS_CONF_FILE=./gangliaClusters.conf;
-
-function createDirectory()
-{
- directoryPath=${1};
-
- if [ "x" != "x${directoryPath}" ]
- then
- mkdir -p ${directoryPath};
- fi
-}
-
-function getGangliaClusterInfo()
-{
- clusterName=${1};
-
- if [ "x" != "x${clusterName}" ]
- then
- # Fetch the particular entry for ${clusterName} from ${GANGLIA_CLUSTERS_CONF_FILE}.
- awk -v clusterName=${clusterName} '($1 !~ /^#/) && ($1 == clusterName)' ${GANGLIA_CLUSTERS_CONF_FILE};
- else
- # Spit out all the non-comment, non-empty lines from ${GANGLIA_CLUSTERS_CONF_FILE}.
- awk '($1 !~ /^#/) && (NF)' ${GANGLIA_CLUSTERS_CONF_FILE};
- fi
-}
-
-function getConfiguredGangliaClusterNames()
-{
- # Find all the subdirectories in ${GANGLIA_CONF_DIR} and extract only
- # the subdirectory name from each.
- if [ -e ${GANGLIA_CONF_DIR} ]
- then
- find ${GANGLIA_CONF_DIR} -maxdepth 1 -mindepth 1 -type d | xargs -n1 basename;
- fi
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh b/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh
deleted file mode 100644
index d14091a..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/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.
-#
-#
-
-export hdfs_user=$1
-shift
-export conf_dir=$1
-shift
-export mark_dir=$1
-shift
-export name_dirs=$*
-
-export EXIT_CODE=0
-export command="namenode -format"
-export list_of_non_empty_dirs=""
-
-mark_file=/var/run/hadoop/hdfs/namenode-formatted
-if [[ -f ${mark_file} ]] ; then
- rm -f ${mark_file}
- mkdir -p ${mark_dir}
-fi
-
-if [[ ! -d $mark_dir ]] ; then
- for dir in `echo $name_dirs | tr ',' ' '` ; do
- echo "NameNode Dirname = $dir"
- cmd="ls $dir | wc -l | grep -q ^0$"
- eval $cmd
- if [[ $? -ne 0 ]] ; then
- (( EXIT_CODE = $EXIT_CODE + 1 ))
- list_of_non_empty_dirs="$list_of_non_empty_dirs $dir"
- fi
- done
-
- if [[ $EXIT_CODE == 0 ]] ; then
- su - ${hdfs_user} -c "yes Y | hadoop --config ${conf_dir} ${command}"
- else
- echo "ERROR: Namenode directory(s) is non empty. Will not format the namenode. List of non-empty namenode dirs ${list_of_non_empty_dirs}"
- fi
-else
- echo "${mark_dir} exists. Namenode DFS already formatted"
-fi
-
-exit $EXIT_CODE
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1171b0/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py b/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py
deleted file mode 100644
index f8e9c1a..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-
-'''
-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.
-'''
-
-import optparse
-import httplib
-
-#
-# Main.
-#
-def main():
- parser = optparse.OptionParser(usage="usage: %prog [options] component ")
- parser.add_option("-m", "--hosts", dest="hosts", help="Comma separated hosts list for WEB UI to check it availability")
- parser.add_option("-p", "--port", dest="port", help="Port of WEB UI to check it availability")
-
- (options, args) = parser.parse_args()
-
- hosts = options.hosts.split(',')
- port = options.port
-
- for host in hosts:
- try:
- conn = httplib.HTTPConnection(host, port)
- # This can be modified to get a partial url part to be sent with request
- conn.request("GET", "/")
- httpCode = conn.getresponse().status
- conn.close()
- except Exception:
- httpCode = 404
-
- if httpCode != 200:
- print "Cannot access WEB UI on: http://" + host + ":" + port
- exit(1)
-
-
-if __name__ == "__main__":
- main()