ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gau...@apache.org
Subject ambari git commit: AMBARI-13138. Use ranger port value from configs for alerts in Ambari (HDP-2.2)
Date Tue, 27 Oct 2015 05:50:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 26492104c -> 9c6300e42


AMBARI-13138. Use ranger port value from configs for alerts in Ambari (HDP-2.2)


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

Branch: refs/heads/branch-2.1
Commit: 9c6300e42d363eeaac36bd84f46a6a911e9a9810
Parents: 2649210
Author: Gautam Borad <gautam@apache.org>
Authored: Thu Oct 15 11:26:38 2015 +0530
Committer: Gautam Borad <gautam@apache.com>
Committed: Tue Oct 27 11:20:08 2015 +0530

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog210.java       | 42 ++++++++++++++++++++
 .../common-services/RANGER/0.4.0/alerts.json    | 23 ++++++-----
 .../RANGER/0.4.0/configuration/ranger-site.xml  |  3 +-
 3 files changed, 57 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9c6300e4/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
index dc633e3..ac5df7c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
@@ -1289,6 +1289,48 @@ public class UpgradeCatalog210 extends AbstractUpgradeCatalog {
                 rootJson.toString(), UUID.randomUUID().toString());
           }
 
+          // update ranger admin alerts from type port(2.2) to web(2.3)
+          AlertDefinitionEntity rangerAdminDefinitionEntity = alertDefinitionDAO.findByName(
+            cluster.getClusterId(), "ranger_admin_process");
+
+          if (rangerAdminDefinitionEntity != null) {
+            String source = rangerAdminDefinitionEntity.getSource();
+            JsonObject rootJson = new JsonParser().parse(source).getAsJsonObject();
+            JsonObject uriJson = new JsonObject();
+            JsonObject reporting = rootJson.getAsJsonObject("reporting");
+            JsonObject ok = reporting.getAsJsonObject("ok");
+            JsonObject warning = reporting.getAsJsonObject("warning");
+            JsonObject critical = reporting.getAsJsonObject("critical");            
+
+            rootJson.remove("type");
+            rootJson.remove("default_port");
+            rootJson.addProperty("type", "WEB");
+
+            uriJson.addProperty("http", "{{admin-properties/policymgr_external_url}}");
+            uriJson.addProperty("https", "{{admin-properties/policymgr_external_url}}");
+            uriJson.addProperty("https_property", "{{ranger-site/http.enabled}}");
+            uriJson.addProperty("https_property_value", "false");
+            uriJson.addProperty("connection_timeout", 5.0f);
+
+            rootJson.remove("uri");
+            rootJson.add("uri", uriJson);
+
+            ok.remove("text");
+            ok.addProperty("text", "HTTP {0} response in {2:.3f}s");
+
+            warning.remove("text");
+            warning.remove("value");
+            warning.addProperty("text", "HTTP {0} response from {1} in {2:.3f}s ({3})");
+
+            critical.remove("text");
+            critical.remove("value");
+            critical.addProperty("text", "Connection failed to {1} ({3})");
+
+            // save the changes
+            updateAlertDefinitionEntitySource("ranger_admin_process",
+              rootJson.toString(), UUID.randomUUID().toString());
+          }
+
           // update oozie web ui alert
           AlertDefinitionEntity oozieWebUIAlertDefinitionEntity = alertDefinitionDAO.findByName(
               cluster.getClusterId(), "oozie_server_webui");

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c6300e4/ambari-server/src/main/resources/common-services/RANGER/0.4.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/alerts.json b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/alerts.json
index 05ccc1d..62f29eb 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/alerts.json
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/alerts.json
@@ -5,24 +5,27 @@
       {
         "name": "ranger_admin_process",
         "label": "Ranger Admin Process",
-        "description": "This host-level alert is triggered if the Ranger Admin cannot be
determined to be up.",
+        "description": "This host-level alert is triggered if the Ranger Admin Web UI is
unreachable.",
         "interval": 1,
-        "scope": "HOST",
+        "scope": "ANY",
         "source": {
-          "type": "PORT",
-          "uri": "{{ranger-site/HTTP_SERVICE_PORT}}",
-          "default_port": 6080,
+          "type": "WEB",
+          "uri": {
+              "http": "{{admin-properties/policymgr_external_url}}",
+              "https": "{{admin-properties/policymgr_external_url}}",
+              "https_property": "{{ranger-site/http.enabled}}",
+              "https_property_value": "false",
+              "connection_timeout": 5.0
+            },
           "reporting": {
             "ok": {
-              "text": "TCP OK - {0:.3f}s response on port {1}"
+              "text": "HTTP {0} response in {2:.3f}s"
             },
             "warning": {
-              "text": "TCP OK - {0:.3f}s response on port {1}",
-              "value": 1.5
+              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
             },
             "critical": {
-              "text": "Connection failed: {0} to {1}:{2}",
-              "value": 5.0
+              "text": "Connection failed to {1} ({3})"
             }
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c6300e4/ambari-server/src/main/resources/common-services/RANGER/0.4.0/configuration/ranger-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/configuration/ranger-site.xml
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/configuration/ranger-site.xml
index 293c925..daab4ec 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/configuration/ranger-site.xml
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/configuration/ranger-site.xml
@@ -41,7 +41,8 @@
 
   <property>
     <name>https.attrib.keystorePass</name>
-    <value>ranger</value>
+    <value>xasecure</value>
+    <property-type>PASSWORD</property-type>
     <description>The keystore pass to be used </description>
   </property>
 


Mime
View raw message