Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25328

When spark_transport_mode is set to 'http' then STS server fails to start in Ambari 2.7

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      When the "hive.server2.transport.mode" is set tp "http" (instead of "binary") inside the "spark2-hive-site-override" configuration then the "Spark2 Thrift Server" start operation fails via Ambari UI with the following error:

        File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 150, in _call_wrapper
          result = _call(command, **kwargs_copy)
        File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 314, in _call
          raise ExecutionFailed(err_msg, code, out, err)
      ExecutionFailed: Execution of '! /usr/hdp/current/spark2-thriftserver/bin/beeline -u 'jdbc:hive2://kerlatest4.example.com:10002/default;transportMode=http'  -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL' -e 'Error: Could not open'' returned 1. Error: Could not open client transport with JDBC Uri: jdbc:hive2://kerlatest4.example.com:10002/default;transportMode=http: Could not create http connection to jdbc:hive2://kerlatest4.example.com:10002/default;transportMode=http. HTTP Response code: 405 (state=08S01,code=0)
      Error: Could not open client transport with JDBC Uri: jdbc:hive2://kerlatest4.example.com:10002/default;transportMode=http: Could not create http connection to jdbc:hive2://kerlatest4.example.com:10002/default;transportMode=http. HTTP Response code: 405 (state=08S01,code=0)
      

      This is because the "spark_service.py" script is not appending the "httpPath=cliservice" when the "hive.server2.transport.mode" is set to "http" in the "beeline_url" inside the "/var/lib/ambari-server/resources/stacks/HDP/3.0/services/SPARK2/package/scripts/spark_service.py" script (On Ambari Agent "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/SPARK2/package/scripts/spark_service.py").

      Manual Workaround:
      Update the "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/SPARK2/package/scripts/spark_service.py" on agent and amabri server as following with additional If else block to check the spark_transport_mode == 'http':

      146c146,149
      <           beeline_url = ["jdbc:hive2://{fqdn}:{spark_thrift_port}/default;principal={hive_kerberos_principal}","transportMode={spark_transport_mode}"]
      ---
      >           if params.spark_transport_mode == 'http':
      >             beeline_url = ["jdbc:hive2://{fqdn}:{spark_thrift_port}/default;principal={hive_kerberos_principal}","transportMode={spark_transport_mode}","httpPath=cliservice"]
      >           else:
      >             beeline_url = ["jdbc:hive2://{fqdn}:{spark_thrift_port}/default;principal={hive_kerberos_principal}","transportMode={spark_transport_mode}"]
      148c151,154
      <           beeline_url = ["jdbc:hive2://{fqdn}:{spark_thrift_port}/default","transportMode={spark_transport_mode}"]
      ---
      >           if params.spark_transport_mode == 'http':
      >             beeline_url = ["jdbc:hive2://{fqdn}:{spark_thrift_port}/default","transportMode={spark_transport_mode}","httpPath=cliservice"]
      >           else:
      >             beeline_url = ["jdbc:hive2://{fqdn}:{spark_thrift_port}/default","transportMode={spark_transport_mode}"]
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ihorlukianov Ihor Lukianov
            jaysensharma Jay SenSharma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment