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 2016/07/13 10:09:13 UTC
ambari git commit: AMBARI-17650 Wire encryption enabled,
atlas alerts are failing. (dsen)
Repository: ambari
Updated Branches:
refs/heads/trunk 3bcd1304b -> 07696c87d
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/07696c87
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/07696c87
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/07696c87
Branch: refs/heads/trunk
Commit: 07696c87dfe8e2cc816c0634f8c86cfdd2e54d9b
Parents: 3bcd130
Author: Dmytro Sen <ds...@apache.org>
Authored: Wed Jul 13 13:09:04 2016 +0300
Committer: Dmytro Sen <ds...@apache.org>
Committed: Wed Jul 13 13:09:04 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/07696c87/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 7ef12a7..644e5c1 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();
@@ -2302,6 +2303,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/07696c87/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/07696c87/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 91d84e9..2854f1d 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);