AMBARI-22223.jdbc(spark[2]) URLs not configured correctly for secure 
clusters(Prabhjyot Singh via Venkata Sairam)


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

Branch: refs/heads/feature-branch-AMBARI-21307
Commit: 2a8ac0ded9a9916dd71b84ac21a2a6165db60284
Parents: d4458da
Author: Venkata Sairam <venkatasairam.la...@gmail.com>
Authored: Mon Oct 16 18:15:58 2017 +0530
Committer: Venkata Sairam <venkatasairam.la...@gmail.com>
Committed: Mon Oct 16 18:15:58 2017 +0530

----------------------------------------------------------------------
 .../ZEPPELIN/0.7.0/package/scripts/master.py         | 12 ++++++++----
 .../ZEPPELIN/0.7.0/package/scripts/params.py         | 15 +++++++++------
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a8ac0de/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 6a84d79..9d179b8 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
@@ -492,8 +492,10 @@ class Master(Script):
           interpreter['properties']['spark.proxy.user.property'] = 
'hive.server2.proxy.user'
           interpreter['properties']['spark.url'] = 'jdbc:hive2://' + \
               params.spark_thrift_server_hosts + ':' + 
params.spark_hive_thrift_port + '/'
-          if params.spark_hive_principal:
-            interpreter['properties']['spark.url'] += ';principal=' + 
params.spark_hive_principal
+          if params.hive_principal:
+            interpreter['properties']['spark.url'] += ';principal=' + 
params.hive_principal
+          if params.hive_transport_mode:
+            interpreter['properties']['spark.url'] += ';transportMode=' + 
params.hive_transport_mode
           if 'spark.splitQueries' not in interpreter['properties']:
             interpreter['properties']['spark.splitQueries'] = "true"
 
@@ -504,8 +506,10 @@ class Master(Script):
           interpreter['properties']['spark2.proxy.user.property'] = 
'hive.server2.proxy.user'
           interpreter['properties']['spark2.url'] = 'jdbc:hive2://' + \
               params.spark2_thrift_server_hosts + ':' + 
params.spark2_hive_thrift_port + '/'
-          if params.spark_hive_principal:
-            interpreter['properties']['spark2.url'] += ';principal=' + 
params.spark2_hive_principal
+          if params.hive_principal:
+            interpreter['properties']['spark2.url'] += ';principal=' + 
params.hive_principal
+          if params.hive_transport_mode:
+            interpreter['properties']['spark2.url'] += ';transportMode=' + 
params.hive_transport_mode
           if 'spark2.splitQueries' not in interpreter['properties']:
             interpreter['properties']['spark2.splitQueries'] = "true"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a8ac0de/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 e69037c..2290a7f 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
@@ -162,13 +162,19 @@ if 'hive_server_interactive_hosts' in master_configs and 
len(master_configs['hiv
 spark_thrift_server_hosts = None
 spark_hive_thrift_port = None
 spark_hive_principal = None
+hive_principal = None
+hive_transport_mode = None
+
+if 'hive-site' in config['configurations']:
+  if 'hive.server2.authentication.kerberos.principal' in 
config['configurations']['hive-site']:
+    hive_principal = 
config['configurations']['hive-site']['hive.server2.authentication.kerberos.principal']
+  if 'hive.server2.transport.mode' in config['configurations']['hive-site']:
+    hive_transport_mode = 
config['configurations']['hive-site']['hive.server2.transport.mode']
+
 if 'spark_thriftserver_hosts' in master_configs and 
len(master_configs['spark_thriftserver_hosts']) != 0:
   spark_thrift_server_hosts = 
str(master_configs['spark_thriftserver_hosts'][0])
   if config['configurations']['spark-hive-site-override']:
     spark_hive_thrift_port = 
config['configurations']['spark-hive-site-override']['hive.server2.thrift.port']
-  if config['configurations']['spark-thrift-sparkconf'] and \
-      'spark.sql.hive.hiveserver2.jdbc.url.principal' in 
config['configurations']['spark-thrift-sparkconf']:
-    spark_hive_principal = 
config['configurations']['spark-thrift-sparkconf']['spark.sql.hive.hiveserver2.jdbc.url.principal']
 
 spark2_thrift_server_hosts = None
 spark2_hive_thrift_port = None
@@ -177,9 +183,6 @@ if 'spark2_thriftserver_hosts' in master_configs and 
len(master_configs['spark2_
   spark2_thrift_server_hosts = 
str(master_configs['spark2_thriftserver_hosts'][0])
   if config['configurations']['spark2-hive-site-override']:
     spark2_hive_thrift_port = 
config['configurations']['spark2-hive-site-override']['hive.server2.thrift.port']
-  if config['configurations']['spark2-thrift-sparkconf'] and \
-      'spark.sql.hive.hiveserver2.jdbc.url.principal' in 
config['configurations']['spark2-thrift-sparkconf']:
-    spark2_hive_principal = 
config['configurations']['spark2-thrift-sparkconf']['spark.sql.hive.hiveserver2.jdbc.url.principal']
 
 
 # detect hbase details if installed

Reply via email to