You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/01/27 14:29:24 UTC

ambari git commit: AMBARI-9352. Ambari HDFS service check fails in HDFS HA https policy setup (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 9fbcce8a3 -> 68b35a509


AMBARI-9352. Ambari HDFS service check fails in HDFS HA https policy setup (aonishuk)


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

Branch: refs/heads/trunk
Commit: 68b35a509bccb35cdf32ed34a376d98dde10e915
Parents: 9fbcce8
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jan 27 15:29:17 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jan 27 15:29:17 2015 +0200

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/configuration/hdfs-site.xml              | 7 +++++++
 .../HDFS/2.1.0.2.0/package/files/checkWebUI.py              | 9 ++++++---
 .../HDFS/2.1.0.2.0/package/scripts/params.py                | 9 ++++++++-
 .../HDFS/2.1.0.2.0/package/scripts/service_check.py         | 2 +-
 4 files changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/68b35a50/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hdfs-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hdfs-site.xml b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hdfs-site.xml
index ac3e88a..8cad375 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hdfs-site.xml
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hdfs-site.xml
@@ -369,6 +369,13 @@
   </property>
 
   <property>
+    <name>dfs.journalnode.https-address</name>
+    <value>0.0.0.0:8481</value>
+    <description>The address and port the JournalNode HTTPS server listens on.
+      If the port is 0 then the server will start on a free port. </description>
+  </property>
+
+  <property>
     <name>dfs.journalnode.edits.dir</name>
     <value>/grid/0/hdfs/journal</value>
     <description>The path where the JournalNode daemon will store its local state. </description>

http://git-wip-us.apache.org/repos/asf/ambari/blob/68b35a50/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/files/checkWebUI.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/files/checkWebUI.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/files/checkWebUI.py
index f8e9c1a..8ae6d2e 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/files/checkWebUI.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/files/checkWebUI.py
@@ -28,15 +28,17 @@ def main():
   parser = optparse.OptionParser(usage="usage: %prog [options] component ")
   parser.add_option("-m", "--hosts", dest="hosts", help="Comma separated hosts list for WEB UI to check it availability")
   parser.add_option("-p", "--port", dest="port", help="Port of WEB UI to check it availability")
+  parser.add_option("-s", "--https", dest="https", help="\"True\" if value of dfs.http.policy is \"HTTPS_ONLY\"")
 
   (options, args) = parser.parse_args()
   
   hosts = options.hosts.split(',')
   port = options.port
+  https = options.https
 
   for host in hosts:
     try:
-      conn = httplib.HTTPConnection(host, port)
+      conn = httplib.HTTPConnection(host, port) if not https.lower() == "true" else httplib.HTTPSConnection(host, port)
       # This can be modified to get a partial url part to be sent with request
       conn.request("GET", "/")
       httpCode = conn.getresponse().status
@@ -45,9 +47,10 @@ def main():
       httpCode = 404
 
     if httpCode != 200:
-      print "Cannot access WEB UI on: http://" + host + ":" + port
+      if not https:
+        print "Cannot access WEB UI on: http://" + host + ":" + port if not https.lower() == "true" else "Cannot access WEB UI on: https://" + host + ":" + port
+
       exit(1)
-      
 
 if __name__ == "__main__":
   main()

http://git-wip-us.apache.org/repos/asf/ambari/blob/68b35a50/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
index 4d120b1..12a010d 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
@@ -209,7 +209,14 @@ if dfs_ha_enabled:
       namenode_id = nn_id
       namenode_rpc = nn_host
 
-journalnode_address = default('/configurations/hdfs-site/dfs.journalnode.http-address', None)
+
+if dfs_http_policy == "HTTPS_ONLY":
+  https_only = True
+  journalnode_address = default('/configurations/hdfs-site/dfs.journalnode.https-address', None)
+else:
+  https_only = False
+  journalnode_address = default('/configurations/hdfs-site/dfs.journalnode.http-address', None)
+
 if journalnode_address:
   journalnode_port = journalnode_address.split(":")[1]
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/68b35a50/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py
index fc04c60..0196300 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py
@@ -90,7 +90,7 @@ class HdfsServiceCheck(Script):
       checkWebUIFileName = "checkWebUI.py"
       checkWebUIFilePath = format("{tmp_dir}/{checkWebUIFileName}")
       comma_sep_jn_hosts = ",".join(params.journalnode_hosts)
-      checkWebUICmd = format("python {checkWebUIFilePath} -m {comma_sep_jn_hosts} -p {journalnode_port}")
+      checkWebUICmd = format("python {checkWebUIFilePath} -m {comma_sep_jn_hosts} -p {journalnode_port} -s {https_only}")
       File(checkWebUIFilePath,
            content=StaticFile(checkWebUIFileName),
            mode=0775)