AMBARI-22214.Livy protocol to be set to https in Zeppelin's interpreter 
setting(Venkata Sairam)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 3c3b1b810ee05490fe2fe370de6132ba31bf8b72
Parents: b86f53f
Author: Venkata Sairam <venkatasairam.la...@gmail.com>
Authored: Thu Oct 12 17:05:12 2017 +0530
Committer: Venkata Sairam <venkatasairam.la...@gmail.com>
Committed: Thu Oct 12 17:05:12 2017 +0530

----------------------------------------------------------------------
 .../common-services/ZEPPELIN/0.7.0/package/scripts/master.py   | 6 ++++--
 .../common-services/ZEPPELIN/0.7.0/package/scripts/params.py   | 6 ++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3c3b1b81/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
index 09944bd..eaa2cb9 100644
--- 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
+++ 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
@@ -530,14 +530,16 @@ class Master(Script):
 
       elif interpreter['group'] == 'livy' and interpreter['name'] == 'livy':
         if params.livy_livyserver_host:
-          interpreter['properties']['zeppelin.livy.url'] = "http://"; + 
params.livy_livyserver_host + \
+          interpreter['properties']['zeppelin.livy.url'] = 
params.livy_livyserver_protocol + \
+                                                           "://" + 
params.livy_livyserver_host + \
                                                            ":" + 
params.livy_livyserver_port
         else:
           del interpreter_settings[setting_key]
 
       elif interpreter['group'] == 'livy' and interpreter['name'] == 'livy2':
         if params.livy2_livyserver_host:
-          interpreter['properties']['zeppelin.livy.url'] = "http://"; + 
params.livy2_livyserver_host + \
+          interpreter['properties']['zeppelin.livy.url'] = 
params.livy2_livyserver_protocol + \
+                                                           "://" + 
params.livy2_livyserver_host + \
                                                            ":" + 
params.livy2_livyserver_port
         else:
           del interpreter_settings[setting_key]

http://git-wip-us.apache.org/repos/asf/ambari/blob/3c3b1b81/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
index 3242f26..b7d3df0 100644
--- 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
@@ -219,17 +219,23 @@ livy2_hosts = 
default("/clusterHostInfo/livy2_server_hosts", [])
 
 livy_livyserver_host = None
 livy_livyserver_port = None
+livy_livyserver_protocol = 'http'
 livy2_livyserver_host = None
 livy2_livyserver_port = None
+livy2_livyserver_protocol = 'http'
 if stack_version_formatted and check_stack_feature(StackFeature.SPARK_LIVY, 
stack_version_formatted) and \
     len(livy_hosts) > 0:
   livy_livyserver_host = str(livy_hosts[0])
   livy_livyserver_port = 
config['configurations']['livy-conf']['livy.server.port']
+  if 'livy.keystore' in config['configurations']['livy-conf']:
+    livy_livyserver_protocol = 'https'
 
 if stack_version_formatted and check_stack_feature(StackFeature.SPARK_LIVY2, 
stack_version_formatted) and \
     len(livy2_hosts) > 0:
   livy2_livyserver_host = str(livy2_hosts[0])
   livy2_livyserver_port = 
config['configurations']['livy2-conf']['livy.server.port']
+  if 'livy.keystore' in config['configurations']['livy2-conf']:
+    livy2_livyserver_protocol = 'https'
 
 hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
 security_enabled = config['configurations']['cluster-env']['security_enabled']

Reply via email to