AMBARI-21125. Ambari STS2 checker should use principal in secure cluster (Mingjie Tang via rlevas)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ad6a78ee Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ad6a78ee Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ad6a78ee Branch: refs/heads/branch-feature-AMBARI-12556 Commit: ad6a78eeed591cf5b6ea481161194c05eaa5e4b7 Parents: 1e3d64b Author: Mingjie Tang <mt...@hortonworks.com> Authored: Thu May 25 15:59:49 2017 -0400 Committer: Robert Levas <rle...@hortonworks.com> Committed: Thu May 25 15:59:49 2017 -0400 ---------------------------------------------------------------------- .../1.2.1/package/scripts/alerts/alert_spark_thrift_port.py | 5 ++++- .../2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ad6a78ee/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py index 503360e..93a2de8 100644 --- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py +++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py @@ -128,7 +128,10 @@ def execute(configurations={}, parameters={}, host_name=None): if host_name is None: host_name = socket.getfqdn() - beeline_url = ['jdbc:hive2://{host_name}:{port}/', "transportMode={transport_mode}"] + if security_enabled: + beeline_url = ["'jdbc:hive2://{host_name}:{port}/default;principal={hive_principal}'","transportMode={transport_mode}"] + else: + beeline_url = ["'jdbc:hive2://{host_name}:{port}/default'","transportMode={transport_mode}"] # append url according to used transport beeline_cmd = os.path.join(spark_home, "bin", "beeline") http://git-wip-us.apache.org/repos/asf/ambari/blob/ad6a78ee/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py index 12d2cda..1ce4aca 100644 --- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py +++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py @@ -129,7 +129,10 @@ def execute(configurations={}, parameters={}, host_name=None): if host_name is None: host_name = socket.getfqdn() - beeline_url = ['jdbc:hive2://{host_name}:{port}/', "transportMode={transport_mode}"] + if security_enabled: + beeline_url = ["'jdbc:hive2://{host_name}:{port}/default;principal={hive_principal}'","transportMode={transport_mode}"] + else: + beeline_url = ["'jdbc:hive2://{host_name}:{port}/default'","transportMode={transport_mode}"] # append url according to used transport beeline_cmd = os.path.join(spark_home, "bin", "beeline")