ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-17396 Performance issues with ambari metrics (and Metrics Collector keeps going down) (dsen)
Date Thu, 23 Jun 2016 15:31:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7d317cc29 -> c4dcf6f6b


AMBARI-17396 Performance issues with ambari metrics (and Metrics Collector keeps going down)
(dsen)


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

Branch: refs/heads/trunk
Commit: c4dcf6f6b1596710dce7ee3c97b9cba1915659de
Parents: 7d317cc
Author: Dmytro Sen <dsen@apache.org>
Authored: Thu Jun 23 18:31:16 2016 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Thu Jun 23 18:31:16 2016 +0300

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog240.java       | 14 +++++
 .../0.1.0/configuration/ams-hbase-site.xml      |  2 +-
 .../server/upgrade/UpgradeCatalog240Test.java   | 55 ++++++++++++++++++++
 3 files changed, 70 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c4dcf6f6/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
index b0d5211..e029aea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
@@ -194,6 +194,8 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
   public static final String TEZ_SITE_QUEUE_NAME = "tez.queue.name";
   public static final String YARN_ENV_QUEUE_NAME = "service_check.queue.name";
   public static final String MAPRED_SITE_QUEUE_NAME = "mapreduce.job.queuename";
+  private static final String AMS_HBASE_SITE = "ams-hbase-site";
+  private static final String HBASE_RPC_TIMEOUT_PROPERTY = "hbase.rpc.timeout";
 
   static {
     // Manually create role order since there really isn't any mechanism for this
@@ -1835,6 +1837,18 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
             newProperties.put("content", updateAmsGrafanaIni(content));
             updateConfigurationPropertiesForCluster(cluster, "ams-grafana-ini", newProperties,
true, true);
           }
+
+          Config amsHbaseSite = cluster.getDesiredConfigByType(AMS_HBASE_SITE);
+          if (amsHbaseSite != null) {
+            Map<String, String> amsHbaseSiteProperties = amsHbaseSite.getProperties();
+            Map<String, String> newProperties = new HashMap<>();
+            if (amsHbaseSiteProperties.containsKey(HBASE_RPC_TIMEOUT_PROPERTY) &&
+                "30000".equals(amsHbaseSiteProperties.get(HBASE_RPC_TIMEOUT_PROPERTY))) {
+              newProperties.put(HBASE_RPC_TIMEOUT_PROPERTY, String.valueOf(300000));
+            }
+            updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_SITE, newProperties,
true, true);
+          }
+
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c4dcf6f6/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
index f4e5fb2..a7d8228 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
@@ -284,7 +284,7 @@
   </property>
   <property>
     <name>hbase.rpc.timeout</name>
-    <value>30000</value>
+    <value>300000</value>
     <description>
       This is for the RPC layer to define how long HBase client applications
       take for a remote call to time out. It uses pings to check connections

http://git-wip-us.apache.org/repos/asf/ambari/blob/c4dcf6f6/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
index d2bb499..4ff751d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
@@ -1358,6 +1358,61 @@ public class UpgradeCatalog240Test {
   }
 
   @Test
+  public void testAmsHbaseSiteUpdateConfigs() throws Exception{
+
+    Map<String, String> oldPropertiesAmsHbaseSite = new HashMap<String, String>()
{
+      {
+        put("hbase.rpc.timeout", "30000");
+      }
+    };
+    Map<String, String> newPropertiesAmsHbaseSite = new HashMap<String, String>()
{
+      {
+        put("hbase.rpc.timeout", "300000");
+      }
+    };
+    EasyMockSupport easyMockSupport = new EasyMockSupport();
+
+    Clusters clusters = easyMockSupport.createNiceMock(Clusters.class);
+    final Cluster cluster = easyMockSupport.createNiceMock(Cluster.class);
+    Config mockAmsHbaseSite = easyMockSupport.createNiceMock(Config.class);
+
+    expect(clusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
+      put("normal", cluster);
+    }}).once();
+    expect(cluster.getDesiredConfigByType("ams-hbase-site")).andReturn(mockAmsHbaseSite).atLeastOnce();
+    expect(mockAmsHbaseSite.getProperties()).andReturn(oldPropertiesAmsHbaseSite).anyTimes();
+
+    Injector injector = easyMockSupport.createNiceMock(Injector.class);
+    expect(injector.getInstance(Gson.class)).andReturn(null).anyTimes();
+    expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null).anyTimes();
+    expect(injector.getInstance(KerberosHelper.class)).andReturn(createNiceMock(KerberosHelper.class)).anyTimes();
+
+    replay(injector, clusters, mockAmsHbaseSite, cluster);
+
+    AmbariManagementControllerImpl controller = createMockBuilder(AmbariManagementControllerImpl.class)
+      .addMockedMethod("createConfiguration")
+      .addMockedMethod("getClusters", new Class[] { })
+      .addMockedMethod("createConfig")
+      .withConstructor(createNiceMock(ActionManager.class), clusters, injector)
+      .createNiceMock();
+
+    Injector injector2 = easyMockSupport.createNiceMock(Injector.class);
+    Capture<Map> propertiesCapture = EasyMock.newCapture();
+
+    expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes();
+    expect(controller.getClusters()).andReturn(clusters).anyTimes();
+    expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture),
anyString(),
+      anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once();
+
+    replay(controller, injector2);
+    new UpgradeCatalog240(injector2).updateAMSConfigs();
+    easyMockSupport.verifyAll();
+
+    Map<String, String> updatedProperties = propertiesCapture.getValue();
+    assertTrue(Maps.difference(newPropertiesAmsHbaseSite, updatedProperties).areEqual());
+  }
+
+  @Test
   public void testUpdateKerberosConfiguration() throws Exception {
     final AmbariManagementController controller = createNiceMock(AmbariManagementController.class);
     final DBAccessor dbAccessor = createNiceMock(DBAccessor.class);


Mime
View raw message