AMBARI-21304.Zeppelin should have a preconfigured %jdbc(spark) interpreter(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/8da634c7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8da634c7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8da634c7 Branch: refs/heads/branch-feature-logsearch-ui Commit: 8da634c70042e6bbd99a93dd08211021798875a7 Parents: 16dc405 Author: Venkata Sairam <venkatasairam.la...@gmail.com> Authored: Mon Jun 26 12:23:43 2017 +0530 Committer: Venkata Sairam <venkatasairam.la...@gmail.com> Committed: Mon Jun 26 12:23:43 2017 +0530 ---------------------------------------------------------------------- .../0.6.0.2.5/package/scripts/master.py | 19 ++++++++++++++++ .../0.6.0.2.5/package/scripts/params.py | 23 ++++++++++++++++++++ 2 files changed, 42 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/8da634c7/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py index 75ca6a5..8b5f821 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py @@ -377,6 +377,25 @@ class Master(Script): params.hive_server_interactive_hosts + \ ':' + params.hive_server_port + if params.spark_thrift_server_hosts: + interpreter['properties']['spark.driver'] = 'org.apache.hive.jdbc.HiveDriver' + interpreter['properties']['spark.user'] = 'hive' + interpreter['properties']['spark.password'] = '' + 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.spark2_thrift_server_hosts: + interpreter['properties']['spark2.driver'] = 'org.apache.hive.jdbc.HiveDriver' + interpreter['properties']['spark2.user'] = 'hive' + interpreter['properties']['spark2.password'] = '' + 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.zookeeper_znode_parent \ and params.hbase_zookeeper_quorum: http://git-wip-us.apache.org/repos/asf/ambari/blob/8da634c7/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py index 2340df9..f1ecbb1 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py @@ -152,6 +152,29 @@ if 'hive_server_interactive_hosts' in master_configs and len(master_configs['hiv hive_zookeeper_quorum = config['configurations']['hive-site']['hive.zookeeper.quorum'] hive_server2_support_dynamic_service_discovery = config['configurations']['hive-site']['hive.server2.support.dynamic.service.discovery'] +spark_thrift_server_hosts = None +spark_hive_thrift_port = None +spark_hive_principal = None +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 +spark2_hive_principal = None +if 'spark2_thriftserver_hosts' in master_configs and len(master_configs['spark2_thriftserver_hosts']) != 0: + 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 zookeeper_znode_parent = None hbase_zookeeper_quorum = None