incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject git commit: AMBARI-2885. Nagios Alerts show up for NameNode gmond and HBase Master gmond even though the processes are up. (odiachenko)
Date Tue, 13 Aug 2013 16:32:13 GMT
Updated Branches:
  refs/heads/trunk 80db337cf -> 13d732392


AMBARI-2885. Nagios Alerts show up for NameNode gmond and HBase Master gmond even though the
processes are up. (odiachenko)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/13d73239
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/13d73239
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/13d73239

Branch: refs/heads/trunk
Commit: 13d732392078c804a3125d926bb2882dc2cbf07a
Parents: 80db337
Author: Oleksandr Diachenko <odiachenko@hortonworks.com>
Authored: Tue Aug 13 19:31:39 2013 +0300
Committer: Oleksandr Diachenko <odiachenko@hortonworks.com>
Committed: Tue Aug 13 19:31:53 2013 +0300

----------------------------------------------------------------------
 .../manifests/config/generate_daemon.pp         | 43 +++++++++++++++++++
 .../manifests/config/generate_monitor.pp        | 43 -------------------
 .../manifests/config/generate_server.pp         | 44 --------------------
 .../modules/hdp-ganglia/manifests/monitor.pp    | 34 +++++----------
 .../hdp-ganglia/manifests/monitor_and_server.pp |  4 +-
 .../modules/hdp-ganglia/manifests/server.pp     | 36 +++++++++-------
 .../main/puppet/modules/hdp/manifests/params.pp |  8 ++++
 7 files changed, 84 insertions(+), 128 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/13d73239/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
new file mode 100755
index 0000000..1718cb8
--- /dev/null
+++ b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_daemon.pp
@@ -0,0 +1,43 @@
+#
+#
+# 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/incubator-ambari/blob/13d73239/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_monitor.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_monitor.pp
b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_monitor.pp
deleted file mode 100755
index ab42d6e..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_monitor.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 shoudl be converetd to native puppet
-define hdp-ganglia::config::generate_monitor(
-  $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/incubator-ambari/blob/13d73239/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_server.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_server.pp
b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_server.pp
deleted file mode 100755
index 32c1549..0000000
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/config/generate_server.pp
+++ /dev/null
@@ -1,44 +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 shoudl be converetd to native puppet
-define hdp-ganglia::config::generate_server(
-  $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/incubator-ambari/blob/13d73239/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
index 07b842d..1452390 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/monitor.pp
@@ -82,44 +82,32 @@ class hdp-ganglia::monitor::config-gen()
 
   $service_exists = $hdp::params::service_exists
 
-   #FIXME currently hacking this to make it work
-
-#  if ($service_exists['hdp-hadoop::namenode'] == true) {
-#    hdp-ganglia::config::generate_monitor { 'HDPNameNode':}
-#  }
-#  if ($service_exists['hdp-hadoop::jobtracker'] == true){
-#    hdp-ganglia::config::generate_monitor { 'HDPJobTracker':}
-#  }
-#  if ($service_exists['hdp-hbase::master'] == true) {
-#    hdp-ganglia::config::generate_monitor { 'HDPHBaseMaster':}
-#  }
-#  if ($service_exists['hdp-hadoop::datanode'] == true) {
-#    hdp-ganglia::config::generate_monitor { 'HDPSlaves':}
-#  }
-
   if ($hdp::params::is_namenode_master) {
-    hdp-ganglia::config::generate_monitor { 'HDPNameNode':}
+    hdp-ganglia::config::generate_daemon { 'HDPNameNode':}
   }
   if ($hdp::params::is_jtnode_master) {
-    hdp-ganglia::config::generate_monitor { 'HDPJobTracker':}
+    hdp-ganglia::config::generate_daemon { 'HDPJobTracker':}
   }
   if ($hdp::params::is_rmnode_master) {
-    hdp-ganglia::config::generate_monitor { 'HDPResourceManager':}
+    hdp-ganglia::config::generate_daemon { 'HDPResourceManager':}
   }
   if ($hdp::params::is_hsnode_master) {
-    hdp-ganglia::config::generate_monitor { 'HDPHistoryServer':}
+    hdp-ganglia::config::generate_daemon { 'HDPHistoryServer':}
   }
   if ($hdp::params::is_hbase_master) {
-    hdp-ganglia::config::generate_monitor { 'HDPHBaseMaster':}
+    hdp-ganglia::config::generate_daemon { 'HDPHBaseMaster':}
+  }
+  
+  if ($hdp::params::is_slave) {
+    hdp-ganglia::config::generate_daemon { 'HDPSlaves':}
   }
-  hdp-ganglia::config::generate_monitor { 'HDPSlaves':}
 
-  Hdp-ganglia::Config::Generate_monitor<||>{
+  Hdp-ganglia::Config::Generate_daemon<||>{
     ganglia_service => 'gmond',
     role => 'monitor'
   }
    # 
-  anchor{'hdp-ganglia::monitor::config-gen::begin':} -> Hdp-ganglia::Config::Generate_monitor<||>
-> anchor{'hdp-ganglia::monitor::config-gen::end':}
+  anchor{'hdp-ganglia::monitor::config-gen::begin':} -> Hdp-ganglia::Config::Generate_daemon<||>
-> anchor{'hdp-ganglia::monitor::config-gen::end':}
 }
 
 class hdp-ganglia::monitor::gmond(

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/13d73239/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
index 83fe2d7..418c4cb 100644
--- 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
@@ -61,7 +61,7 @@ class hdp-ganglia::monitor_and_server(
     class {'hdp-ganglia::monitor::config-gen': }      
     
     
-    hdp-ganglia::config::generate_server { 'gmetad':
+    hdp-ganglia::config::generate_daemon { 'gmetad':
       ganglia_service => 'gmetad'
     }
 
@@ -71,7 +71,7 @@ class hdp-ganglia::monitor_and_server(
 
     #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_server['gmetad']
->
+      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/incubator-ambari/blob/13d73239/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
index 2cbc9be..4ac7c8f 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/server.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp-ganglia/manifests/server.pp
@@ -52,45 +52,49 @@ class hdp-ganglia::server(
     service_state       => $service_state 
   }
 
-  if ($hdp::params::is_namenode_master) {
-    hdp-ganglia::config::generate_server { 'HDPNameNode':
+  if ($hdp::params::has_namenodes) {
+    hdp-ganglia::config::generate_daemon { 'HDPNameNode':
       ganglia_service => 'gmond',
       role => 'server'
     }
   }
-  if ($hdp::params::is_jtnode_master) {
-    hdp-ganglia::config::generate_server { 'HDPJobTracker':
+  
+  if ($hdp::params::has_jobtracker) {
+    hdp-ganglia::config::generate_daemon { 'HDPJobTracker':
       ganglia_service => 'gmond',
       role => 'server'
     }
   }
-  if ($hdp::params::is_hbase_master) {
-    hdp-ganglia::config::generate_server { 'HDPHBaseMaster':
+  
+  if ($hdp::params::has_hbase_masters) {
+    hdp-ganglia::config::generate_daemon { 'HDPHBaseMaster':
       ganglia_service => 'gmond',
       role => 'server'
     }
   }
 
-  if ($hdp::params::is_rmnode_master) {
-    hdp-ganglia::config::generate_server { 'HDPResourceManager':
+  if ($hdp::params::has_resourcemanager) {
+    hdp-ganglia::config::generate_daemon { 'HDPResourceManager':
       ganglia_service => 'gmond',
       role => 'server'
     }
   }
   
-  if ($hdp::params::is_hsnode_master) {
-    hdp-ganglia::config::generate_server { 'HDPHistoryServer':
+  if ($hdp::params::has_histroryserver) {
+    hdp-ganglia::config::generate_daemon { 'HDPHistoryServer':
       ganglia_service => 'gmond',
       role => 'server'
     }
   }
-	
-  hdp-ganglia::config::generate_server { 'HDPSlaves':
-    ganglia_service => 'gmond',
-    role => 'server'
+
+  if ($hdp::params::has_slaves) {
+    hdp-ganglia::config::generate_daemon { 'HDPSlaves':
+      ganglia_service => 'gmond',
+      role => 'server'
+    }
   }
 
-  hdp-ganglia::config::generate_server { 'gmetad':
+  hdp-ganglia::config::generate_daemon { 'gmetad':
     ganglia_service => 'gmetad',
     role => 'server'
   }
@@ -121,7 +125,7 @@ class hdp-ganglia::server(
 
   #top level does not need anchors
   Class['hdp-ganglia'] -> Class['hdp-ganglia::server::packages'] -> Class['hdp-ganglia::config']
->
-    Hdp-ganglia::Config::Generate_server<||> ->
+    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']
  }

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/13d73239/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
index a131db4..21e2251 100644
--- a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
@@ -761,4 +761,12 @@ class hdp::params()
   $is_rmnode_master   = $hdp::params::hostname in $rm_host
   $is_hsnode_master   = $hdp::params::hostname in $hs_host
   $is_hbase_master    = $hdp::params::hostname in $hbase_master_hosts
+  $is_slave           = $hdp::params::hostname in $slave_hosts
+  
+  $has_namenodes = hdp_is_empty($namenode_host) == false
+  $has_jobtracker = hdp_is_empty($jtnode_host) == false
+  $has_resourcemanager = hdp_is_empty($rm_host) == false
+  $has_histroryserver = hdp_is_empty($hs_host) == false
+  $has_hbase_masters = hdp_is_empty($hbase_master_hosts) == false
+  $has_slaves = hdp_is_empty($slave_hosts) == false
 }


Mime
View raw message