GitHub user jerryshao opened a pull request:
https://github.com/apache/spark/pull/18616
[SPARK-21377][YARN] Make jars specify with --jars/--packages load-able in
AM's credential renwer
## What changes were proposed in this pull request?
In this issue we have a long running Spark application with secure HBase,
which requires `HBaseCredentialProvider` to get tokens periodically, we specify
HBase related jars with `--packages`, but these dependencies are not added into
AM classpath, so when `HBaseCredentialProvider` tries to initialize HBase
connections to get tokens, it will be failed.
Currently because jars specified with `--jars` or `--packages` are not
added into AM classpath, the only way to extend AM classpath is to use
"spark.driver.extraClassPath" which supposed to be used in yarn cluster mode.
So in this fix, we proposed to use/reuse a classloader for
`AMCredentialRenewer` to acquire new tokens.
Also in this patch, we fixed AM cannot get tokens from HDFS issue, it is
because FileSystem is gotten before kerberos logged, so using this FS to get
tokens will throw exception.
## How was this patch tested?
Manual verification.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jerryshao/apache-spark SPARK-21377
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18616.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #18616
----
commit c49cbabf03fd43d6a7a29b8ddcd1fe47797dbbb4
Author: jerryshao <[email protected]>
Date: 2017-07-12T23:46:57Z
Using a separate classloader for AMCredentialRenewer to get tokens
Change-Id: I0747be12a34149223cfef0fe466c50205402e588
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]