0

我正在尝试在启用 Kerberos 身份验证的情况下启动 Spark thrift 服务器。为此,我有以下配置conf/hive-site.xml

<configuration>
<!--
    <property>
       <name>hive.server2.transport.mode</name>
       <value>http</value>
    </property>
-->
        <property>
             <name>hive.server2.authentication</name>
             <value>KERBEROS</value>
        </property>
        <property>
              <name>hive.metastore.kerberos.principal</name>
              <value>thrift/iman@EXAMPLE.COM</value>
        </property>
        <property>
              <name>hive.server2.authentication.kerberos.principal</name>
              <value>thrift/iman@EXAMPLE.COM</value>
        </property>
        <property>
             <name>hive.server2.authentication.kerberos.keytab</name>
             <value>/opt/nginx/iman.keytab</value>
             <description>Keytab file for Spark Thrift server principal</description>  
        </property>
</configuration>

当我运行start-thriftserver.sh脚本时,我在日志中收到以下错误:

18/02/19 18:16:57 ERROR ThriftCLIService: Error starting HiveServer2: could not start ThriftBinaryCLIService
javax.security.auth.login.LoginException: Kerberos principal should have 3 parts: spark
        at org.apache.hive.service.auth.HiveAuthFactory.getAuthTransFactory(HiveAuthFactory.java:148)
        at org.apache.hive.service.cli.thrift.ThriftBinaryCLIService.run(ThriftBinaryCLIService.java:58)
        at java.lang.Thread.run(Thread.java:748)
18/02/19 18:16:57 INFO HiveServer2: Shutting down HiveServer2

说 Kerberos 主体名称应该是 3 部分,这很奇怪,因为它已经thrift/iman@EXAMPLE.COM在 XML 配置中设置。

此外,我尝试注释掉hive.server2.authentication.kerberos.principal属性以查看它是否有任何影响,事实上,当我这样做时,它确实给出了一个不同的错误“没有指定主体”。

有谁知道问题是什么?任何帮助表示赞赏。

4

1 回答 1

0

您需要在文件中添加以下内容core-site.xml

<property>
   <name>hadoop.security.authorization</name>
   <value>true</value>
</property>

<property>
   <name>hadoop.security.authentication</name>
   <value>kerberos</value>
</property>
于 2018-07-10T05:44:47.040 回答