• 阅读: 207 回复: 0
    行竹

    kerberos认证相关配置教程

    楼主 发表于 2019-07-11 18:58:27

    若您的集群开启了kerberos认证,请先参考之前的《配置集群客户端教程》:

    1.【Apache】配置集群客户端教程

    2.【CDH】配置集群客户端教程

    3.【HDP】配置集群客户端教程

    4.【阿里云 EMR】配置集群客户端步骤

    5.【华为 FusionInsight MRS】配置集群客户端教程

     

    当您部署好集群客户端后,可以按照如下教程在执行代理服务器上进行配置。 

    sudo yum install krb5-server krb5-libs krb5-workstation

    根据下载的keytab查询对应的Principal

    klist -ket /etc/security/keytabs/user.keytab 结果如下: Keytab name: FILE:/etc/security/keytabs/user.keytab KVNO Timestamp Principal ---- ------------------- ------------------------------------------------------ 7 03/27/2019 20:16:46 test1@HADOOP.COM (aes256-cts-hmac-sha1-96) 7 03/27/2019 20:16:46 test1@HADOOP.COM (aes128-cts-hmac-sha1-96)

    使用keytab验证Principal的权限

    kinit -kt /etc/security/keytabs/user.keytab test1@HADOOP.COM

    验证

    # 进入spark目录,请注意:spark目录可能因集群版本而改变 cd /opt/client/Spark2x/spark # 执行sparkPi,指定调度队列为dev,请注意:spark-examples的jar包版本可能因集群版本而改变 ./bin/spark-submit --class org.apache.spark.examples.SparkPi --master yarn --queue root.dev --name sparkPi examples/jars/spark-examples_2.11-2.1.0.jar 100 # 结果: ...... 17/10/14 14:52:30 INFO Submitted application application_1507947630013_0003 17/10/14 14:53:12 INFO scheduler.DAGScheduler: Job 0 finished: reduce at SparkPi.scala:38, took 1.976050 s Pi is roughly 3.1411539141153915 ......

     

  • 未登录

    回复楼主

    登录后可回复
    /1000