簡體   English   中英

oozie-hive beeline無法與kerberos一起使用

[英]oozie-hive beeline not working with kerberos

我們最近已從舊的HDP集群(無kerberos)遷移到新的HDP集群(有kerberos)。 在新的clutser上運行ozzie作業時,我們面臨一些身份驗證問題。 請參考下面的workflow.xml。 第一個動作“ hive-101”工作正常,但是第二個動作“ hive-102”失敗。

<credentials>
    <credential name="hs2-creds" type="hive2">
        <property>
            <name>hive2.server.principal</name>
            <value>${jdbcPrincipal}</value>
        </property>
        <property>
            <name>hive2.jdbc.url</name>
            <value>${jdbcURL}</value>
        </property>
    </credential>
</credentials>

<start to="hive-101"/>

<action name="hive-101" cred="hs2-creds">
    <hive2 xmlns="uri:oozie:hive2-action:0.2">
        <jdbc-url>${jdbcURL}</jdbc-url>
        <password>${hivepassword}</password>
          <query>SELECT count(*)  FROM table1;</query>
    </hive2>
    <ok to="hive-102"/>
    <error to="fail"/>
</action>


<action name="hive-102" retry-max="${maxretry}" retry-interval="${retryinterval}">
    <shell xmlns="uri:oozie:shell-action:0.3">
        <exec>beeline</exec>
        <argument>jdbc:hive2://zk01.abc.com:2181,zk02.abc.com:2181,zk03.abc.com:2181/${hivedatabase};principal=hive/_HOST@ABC.COM;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2</argument>
        <argument>--outputformat=vertical</argument>
        <argument>--silent=true</argument>
        <argument>-e</argument>
        <argument>
            SELECT max(id) as mx_id FROM ${hivedatabase}.table1;

        </argument>
        <capture-output/>
    </shell>
    <ok to="end"/>
    <error to="fail"/>
</action>

下面是錯誤的詳細信息

ERROR transport.TSaslTransport: SASL negotiation failure
javax.security.sasl.SaslException: GSS initiate failed
at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:211) ~[?:1.8.0_212]

Caused by: org.ietf.jgss.GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:147) ~[?:1.8.0_212]
at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:122) ~[?:1.8.0_212]

WARN jdbc.HiveConnection: Failed to connect to nn02.abc.com:10000
WARN jdbc.HiveConnection: Could not open client transport with JDBC Uri: jdbc:hive2://nn02.abc.com:10000/db_test;principal=hive/_HOST@ABC.COM;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2: GSS initiate failed Retrying 0 of 1
ERROR transport.TSaslTransport: SASL negotiation failure
javax.security.sasl.SaslException: GSS initiate failed
at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:211) ~[?:1.8.0_212]

Caused by: org.ietf.jgss.GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:147) ~[?:1.8.0_212]

shell操作將以啟動Oozie工作流程的Unix用戶的身份在任意數據節點上運行。 嘗試運行shell命令的用戶不會自動通過Kerberos進行身份驗證。

我相信您必須在每個數據節點上為用戶放置一個Kerberos密鑰表。 然后,您的Oozie shell操作將需要運行一個腳本,該腳本使用keytab運行kinit,然后運行beeline命令。

來自Mohammad Kamrul Islam和Aravind Srinivasan的Apache Oozie

在不安全的Hadoop群集上,shell命令將以運行TaskTracker(Hadoop 1)或YARN容器(Hadoop 2)的Unix用戶身份執行。 這通常是系統定義的用戶。 在運行Kerberos的安全Hadoop群集上,shell命令將以Unix用戶身份運行,該用戶提交了包含操作的工作流。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM