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-17650 Wire encryption enabled, atlas alerts are failing. (dsen)
Date Wed, 13 Jul 2016 10:10:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 42a8610f6 -> 2e6917a47


AMBARI-17650 Wire encryption enabled, atlas alerts are failing. (dsen)


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

Branch: refs/heads/branch-2.4
Commit: 2e6917a473b8813630bec93dfa6a13ba5e37ef4c
Parents: 42a8610f
Author: Dmytro Sen <dsen@apache.org>
Authored: Wed Jul 13 13:09:04 2016 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Wed Jul 13 13:10:16 2016 +0300

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog240.java       | 22 +++++++++++++++++
 .../common-services/ATLAS/0.1.0.2.3/alerts.json | 25 --------------------
 .../server/upgrade/UpgradeCatalog240Test.java   |  3 +++
 3 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2e6917a4/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 67495b5..4ddcfa1 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
@@ -408,6 +408,7 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
     removeHiveOozieDBConnectionConfigs();
     updateClustersAndHostsVersionStateTableDML();
     removeStandardDeviationAlerts();
+    removeAtlasMetaserverAlert();
     updateClusterInheritedPermissionsConfig();
     consolidateUserRoles();
     createRolePrincipals();
@@ -2287,6 +2288,27 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
   }
 
   /**
+   * Removes the Atlas meta-server alert definition, including all history, notifications
and groupings.
+   *
+   * @throws SQLException
+   */
+  void removeAtlasMetaserverAlert() throws SQLException {
+    AlertDefinitionDAO alertDefinitionDAO = injector.getInstance(AlertDefinitionDAO.class);
+    Clusters clusters = injector.getInstance(Clusters.class);
+    Map<String, Cluster> clusterMap = getCheckedClusterMap(clusters);
+    String atlas_metastore_alert_name = "metadata_server_process";
+
+    for (final Cluster cluster : clusterMap.values()) {
+      long clusterId = cluster.getClusterId();
+
+      AlertDefinitionEntity definition = alertDefinitionDAO.findByName(clusterId, atlas_metastore_alert_name);
+      if (null != definition) {
+        alertDefinitionDAO.remove(definition);
+      }
+    }
+  }
+
+  /**
    * Ensures that each user has only one explicit role.
    * <p>
    * Before Ambari 2.4.0, users were allowed to have multiple permissions, which were like
roles.

http://git-wip-us.apache.org/repos/asf/ambari/blob/2e6917a4/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
index acc7982..8a2a415 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
@@ -3,31 +3,6 @@
     "service": [],
     "ATLAS_SERVER": [
       {
-        "name": "metadata_server_process",
-        "label": "Atlas Metadata Server Process",
-        "description": "This host-level alert is triggered if the individual Metadata server
process cannot be established to be up and listening on the network.",
-        "interval": 1,
-        "scope": "ANY",
-        "source": {
-          "type": "PORT",
-          "uri": "{{application-properties/atlas.server.http.port}}",
-          "default_port": 21000,
-          "reporting": {
-            "ok": {
-              "text": "TCP OK - {0:.3f}s response on port {1}"
-            },
-            "warning": {
-              "text": "TCP OK - {0:.3f}s response on port {1}",
-              "value": 1.5
-            },
-            "critical": {
-              "text": "Connection failed: {0} to {1}:{2}",
-              "value": 5.0
-            }
-          }
-        }
-      },
-      {
         "name": "metadata_server_webui",
         "label": "Metadata Server Web UI",
         "description": "This host-level alert is triggered if the Metadata Server Web UI
is unreachable.",

http://git-wip-us.apache.org/repos/asf/ambari/blob/2e6917a4/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 54f0e57..819616b 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
@@ -585,6 +585,7 @@ public class UpgradeCatalog240Test {
     Method addSliderClientConfig = UpgradeCatalog240.class.getDeclaredMethod("addSliderClientConfig");
     Method updateRequestScheduleEntityUserIds = UpgradeCatalog240.class.getDeclaredMethod("updateRequestScheduleEntityUserIds");
     Method updateRecoveryConfigurationDML = UpgradeCatalog240.class.getDeclaredMethod("updateRecoveryConfigurationDML");
+    Method removeAtlasMetaserverAlert = UpgradeCatalog240.class.getDeclaredMethod("removeAtlasMetaserverAlert");
 
     Capture<String> capturedStatements = newCapture(CaptureType.ALL);
 
@@ -629,6 +630,7 @@ public class UpgradeCatalog240Test {
             .addMockedMethod(addSliderClientConfig)
             .addMockedMethod(updateRequestScheduleEntityUserIds)
             .addMockedMethod(updateRecoveryConfigurationDML)
+            .addMockedMethod(removeAtlasMetaserverAlert)
             .createMock();
 
     Field field = AbstractUpgradeCatalog.class.getDeclaredField("dbAccessor");
@@ -668,6 +670,7 @@ public class UpgradeCatalog240Test {
     upgradeCatalog240.addSliderClientConfig();
     upgradeCatalog240.updateRequestScheduleEntityUserIds();
     upgradeCatalog240.updateRecoveryConfigurationDML();
+    upgradeCatalog240.removeAtlasMetaserverAlert();
 
     replay(upgradeCatalog240, dbAccessor);
 


Mime
View raw message