Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d1df4d9aa -> ca6ce335d


AMBARI-21765. Missing hdfs_scheme variable in params.py file for Apache Knox 
(Sandeep More via smohanty)


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

Branch: refs/heads/branch-2.5
Commit: ca6ce335d7bd3d50e5892a3169d90acbdada963d
Parents: d1df4d9
Author: Sumit Mohanty <smoha...@hortonworks.com>
Authored: Mon Aug 21 14:00:40 2017 -0700
Committer: Sumit Mohanty <smoha...@hortonworks.com>
Committed: Mon Aug 21 14:02:12 2017 -0700

----------------------------------------------------------------------
 .../0.5.0.2.2/package/scripts/params_linux.py   | 27 ++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ca6ce335/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
index 9b0bbfc..f54abef 100644
--- 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
@@ -157,17 +157,30 @@ else:
 
 has_namenode = not namenode_host == None
 namenode_http_port = "50070"
+namenode_https_port = "50470"
 namenode_rpc_port = "8020"
 
 if has_namenode:
   if 'dfs.namenode.http-address' in config['configurations']['hdfs-site']:
     namenode_http_port = 
get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.http-address'])
+  if 'dfs.namenode.https-address' in config['configurations']['hdfs-site']:
+    namenode_https_port = 
get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.https-address'])
   if dfs_ha_enabled and namenode_rpc:
     namenode_rpc_port = get_port_from_url(namenode_rpc)
   else:
     if 'dfs.namenode.rpc-address' in config['configurations']['hdfs-site']:
       namenode_rpc_port = 
get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.rpc-address'])
 
+dfs_http_policy = default('/configurations/hdfs-site/dfs.http.policy', None)
+
+hdfs_https_on = False
+hdfs_scheme = 'http'
+if dfs_http_policy  !=  None :
+   hdfs_https_on = (dfs_http_policy.upper() == 'HTTPS_ONLY')
+   hdfs_scheme = 'http' if not hdfs_https_on else 'https'
+   hdfs_port = str(namenode_http_port)  if not hdfs_https_on else 
str(namenode_https_port)
+   namenode_http_port = hdfs_port
+
 webhdfs_service_urls = ""
 
 def buildUrlElement(protocol, hdfs_host, port, servicePath) :
@@ -188,6 +201,13 @@ else:
   webhdfs_service_urls = buildUrlElement("http", namenode_host, 
namenode_http_port, "/webhdfs")
 
 
+yarn_http_policy = default('/configurations/yarn-site/yarn.http.policy', None )
+yarn_https_on = False
+yarn_scheme = 'http'
+if yarn_http_policy !=  None :
+   yarn_https_on = ( yarn_http_policy.upper() == 'HTTPS_ONLY')
+   yarn_scheme = 'http' if not yarn_https_on else 'https'
+   
 rm_hosts = default("/clusterHostInfo/rm_host", None)
 if type(rm_hosts) is list:
   rm_host = rm_hosts[0]
@@ -227,17 +247,24 @@ if type(hbase_master_hosts) is list:
 else:
   hbase_master_host = hbase_master_hosts
 
+oozie_https_port = None
 oozie_server_hosts = default("/clusterHostInfo/oozie_server", None)
 if type(oozie_server_hosts) is list:
   oozie_server_host = oozie_server_hosts[0]
 else:
   oozie_server_host = oozie_server_hosts
 
+oozie_scheme = 'http'
 has_oozie = not oozie_server_host == None
 oozie_server_port = "11000"
 
 if has_oozie:
   oozie_server_port = 
get_port_from_url(config['configurations']['oozie-site']['oozie.base.url'])
+  oozie_https_port = default("/configurations/oozie-site/oozie.https.port", 
None)
+  
+if oozie_https_port is not None:
+   oozie_scheme = 'https'
+   oozie_server_port = oozie_https_port
 
 # Knox managed properties
 knox_managed_pid_symlink= format('{stack_root}/current/knox-server/pids')

Reply via email to