Skip to content

Commit 99dc133

Browse files
woj-iMarcelo Vanzin
authored andcommitted
[SPARK-11821] Propagate Kerberos keytab for all environments
andrewor14 the same PR as in branch 1.5 harishreedharan Author: woj-i <wojciechindyk@gmail.com> Closes apache#9859 from woj-i/master. (cherry picked from commit 6a8cf80) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
1 parent 843a31a commit 99dc133

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ object SparkSubmit {
545545
if (args.isPython) {
546546
sysProps.put("spark.yarn.isPython", "true")
547547
}
548+
}
549+
550+
// assure a keytab is available from any place in a JVM
551+
if (clusterManager == YARN || clusterManager == LOCAL) {
548552
if (args.principal != null) {
549553
require(args.keytab != null, "Keytab must be specified when principal is specified")
550554
if (!new File(args.keytab).exists()) {

docs/running-on-yarn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,14 +358,14 @@ If you need a reference to the proper location to put log files in the YARN so t
358358
<td>
359359
The full path to the file that contains the keytab for the principal specified above.
360360
This keytab will be copied to the node running the YARN Application Master via the Secure Distributed Cache,
361-
for renewing the login tickets and the delegation tokens periodically.
361+
for renewing the login tickets and the delegation tokens periodically. (Works also with the "local" master)
362362
</td>
363363
</tr>
364364
<tr>
365365
<td><code>spark.yarn.principal</code></td>
366366
<td>(none)</td>
367367
<td>
368-
Principal to be used to login to KDC, while running on secure HDFS.
368+
Principal to be used to login to KDC, while running on secure HDFS. (Works also with the "local" master)
369369
</td>
370370
</tr>
371371
<tr>

docs/sql-programming-guide.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,8 @@ This command builds a new assembly jar that includes Hive. Note that this Hive a
16141614
on all of the worker nodes, as they will need access to the Hive serialization and deserialization libraries
16151615
(SerDes) in order to access data stored in Hive.
16161616

1617-
Configuration of Hive is done by placing your `hive-site.xml` file in `conf/`. Please note when running
1617+
Configuration of Hive is done by placing your `hive-site.xml`, `core-site.xml` (for security configuration),
1618+
`hdfs-site.xml` (for HDFS configuration) file in `conf/`. Please note when running
16181619
the query on a YARN cluster (`cluster` mode), the `datanucleus` jars under the `lib_managed/jars` directory
16191620
and `hive-site.xml` under `conf/` directory need to be available on the driver and all executors launched by the
16201621
YARN cluster. The convenient way to do this is adding them through the `--jars` option and `--file` option of the
@@ -2028,7 +2029,7 @@ Beeline will ask you for a username and password. In non-secure mode, simply ent
20282029
your machine and a blank password. For secure mode, please follow the instructions given in the
20292030
[beeline documentation](https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients).
20302031

2031-
Configuration of Hive is done by placing your `hive-site.xml` file in `conf/`.
2032+
Configuration of Hive is done by placing your `hive-site.xml`, `core-site.xml` and `hdfs-site.xml` files in `conf/`.
20322033

20332034
You may also use the beeline script that comes with Hive.
20342035

@@ -2053,7 +2054,7 @@ To start the Spark SQL CLI, run the following in the Spark directory:
20532054

20542055
./bin/spark-sql
20552056

2056-
Configuration of Hive is done by placing your `hive-site.xml` file in `conf/`.
2057+
Configuration of Hive is done by placing your `hive-site.xml`, `core-site.xml` and `hdfs-site.xml` files in `conf/`.
20572058
You may run `./bin/spark-sql --help` for a complete list of all available
20582059
options.
20592060

0 commit comments

Comments
 (0)