You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2013/04/23 23:21:12 UTC

svn commit: r1471147 - in /incubator/ambari/trunk: ./ ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/ ambari-agent/src/main/puppet/modules/hdp-nagios/templates/ ambari-agent/src/main/puppet/modules/hdp/manifests/ ambari-server/src/main/java/...

Author: smohanty
Date: Tue Apr 23 21:21:11 2013
New Revision: 1471147

URL: http://svn.apache.org/r1471147
Log:
AMBARI-1994. Adding component to Host should should wire-up + adjust associated Nagios alerts. (smohanty)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/configfile.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
    incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1471147&r1=1471146&r2=1471147&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Apr 23 21:21:11 2013
@@ -774,6 +774,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1994. Adding component to Host should should wire-up + adjust
+ associated Nagios alerts. (smohanty)
+
  AMBARI-1753. Puppet paramter configuration not working as expected. (swagle)
 
  AMBARI-1978. Deploying HDP-1.3.0 results in several alerts - is it related to 

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp?rev=1471147&r1=1471146&r2=1471147&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp Tue Apr 23 21:21:11 2013
@@ -75,6 +75,7 @@ class hdp-nagios::params() inherits hdp:
     namenode => {host_member_info => 'namenode_host'},
     snamenode => {host_member_info => 'snamenode_host'},
     slaves => {host_member_info => 'slave_hosts'},
+    tasktracker-servers => {host_member_info => 'mapred_tt_hosts'},
     nagios-server => {host_member_info => 'nagios_server_host'},
     jobtracker  => {host_member_info => 'jtnode_host'},
     ganglia-server => {host_member_info => 'ganglia_server_host'},

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb?rev=1471147&r1=1471146&r2=1471147&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb Tue Apr 23 21:21:11 2013
@@ -332,7 +332,7 @@ define service {
 
 # MAPREDUCE::TASKTRACKER Checks 
 define service {
-        hostgroup_name          slaves
+        hostgroup_name          tasktracker-servers
         use                     hadoop-service
         service_description     TASKTRACKER::TaskTracker process down
         servicegroups           MAPREDUCE

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/configfile.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/configfile.pp?rev=1471147&r1=1471146&r2=1471147&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/configfile.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/configfile.pp Tue Apr 23 21:21:11 2013
@@ -30,6 +30,7 @@ define hdp::configfile(
   $jtnode_host = $hdp::params::jtnode_host,
   $snamenode_host = $hdp::params::snamenode_host,
   $slave_hosts = $hdp::params::slave_hosts,
+  $mapred_tt_hosts = $hdp::params::mapred_tt_hosts,
   $hbase_rs_hosts = $hdp::params::hbase_rs_hosts,
   $zookeeper_hosts = $hdp::params::zookeeper_hosts,
   $hbase_master_hosts = $hdp::params::hbase_master_hosts,

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp?rev=1471147&r1=1471146&r2=1471147&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp Tue Apr 23 21:21:11 2013
@@ -64,7 +64,12 @@ class hdp::params()
   $zookeeper_hosts = hdp_default("zookeeper_hosts")
 
   $hbase_master_hosts = hdp_default("hbase_master_hosts", "")
-  $hbase_rs_hosts = hdp_default("hbase_rs_hosts",$slave_hosts) #if hbase_rs_hosts not given it is assumed that region servers on same nodes as slaves
+
+  #if hbase_rs_hosts not given it is assumed that region servers on same nodes as slaves
+  $hbase_rs_hosts = hdp_default("hbase_rs_hosts", $slave_hosts)
+
+  #if mapred_tt_hosts not given it is assumed that tasktracker servers on same nodes as slaves
+  $mapred_tt_hosts = hdp_default("mapred_tt_hosts", $slave_hosts)
 
   $hive_server_host = hdp_default("hive_server_host", "")
   $oozie_server =  hdp_default("oozie_server", "")

Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java?rev=1471147&r1=1471146&r2=1471147&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java (original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java Tue Apr 23 21:21:11 2013
@@ -97,7 +97,7 @@ public class StageUtils {
     componentToClusterInfoKeyMap.put("GANGLIA_SERVER",
         "ganglia_server_host");
     componentToClusterInfoKeyMap.put("DATANODE", "slave_hosts");
-    componentToClusterInfoKeyMap.put("TASKTRACKER", "slave_hosts");
+    componentToClusterInfoKeyMap.put("TASKTRACKER", "mapred_tt_hosts");
     componentToClusterInfoKeyMap.put("HBASE_REGIONSERVER", "hbase_rs_hosts");
     componentToClusterInfoKeyMap.put("KERBEROS_SERVER", "kdc_host");
     componentToClusterInfoKeyMap.put("KERBEROS_ADMIN_CLIENT",

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java?rev=1471147&r1=1471146&r2=1471147&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java Tue Apr 23 21:21:11 2013
@@ -121,6 +121,27 @@ public class TestStageUtils {
     }
   }
 
+  public static void addMapreduceService(Cluster cl, String [] hostList,
+                                     Injector injector) throws AmbariException {
+    cl.setDesiredStackVersion(new StackId("HDP-0.2"));
+    cl.addService("MAPREDUCE");
+    cl.getService("MAPREDUCE").addServiceComponent("JOBTRACKER");
+    cl.getService("MAPREDUCE").addServiceComponent("TASKTRACKER");
+    cl.getService("MAPREDUCE")
+        .getServiceComponent("JOBTRACKER")
+        .addServiceComponentHost(
+            serviceComponentHostFactory.createNew(cl.getService("MAPREDUCE")
+                .getServiceComponent("JOBTRACKER"), hostList[0], false));
+    for (int i = 1; i < hostList.length; i++) {
+      cl.getService("MAPREDUCE")
+          .getServiceComponent("TASKTRACKER")
+          .addServiceComponentHost(
+              serviceComponentHostFactory.createNew(cl.getService("MAPREDUCE")
+                  .getServiceComponent("TASKTRACKER"), hostList[i],
+                  false));
+    }
+  }
+
   @Test
   public void testGetATestStage() {
     Stage s = StageUtils.getATestStage(1, 2, "host2");
@@ -180,9 +201,12 @@ public class TestStageUtils {
     String [] hostList = {"h1", "h2", "h3" };
     addHdfsService(fsm.getCluster("c1"), hostList, injector);
     addHbaseService(fsm.getCluster("c1"), hostList, injector);
+    addMapreduceService(fsm.getCluster("c1"), hostList, injector);
     Map<String, List<String>> info = StageUtils.getClusterHostInfo(fsm
         .getCluster("c1"), new HostsMap(injector.getInstance(Configuration.class)), injector);
     assertEquals(2, info.get("slave_hosts").size());
+    assertEquals(2, info.get("mapred_tt_hosts").size());
+    assertEquals(2, info.get("hbase_rs_hosts").size());
     assertEquals(1, info.get("hbase_master_hosts").size());
     assertEquals("h1", info.get("hbase_master_hosts").get(0));