apache spark thrift服务器错误:kerberos主体应包含3个部分

bxjv4tth  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(674)

我正在尝试启动启用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 princial名称应该是3个部分,这很奇怪,因为它已经设置为 thrift/iman@EXAMPLE.COM 在xml配置中。
此外,我还尝试注解hive.server2.authentication.kerberos.principal属性,以查看它是否有任何效果,事实上,当我这样做时,它会给出不同的错误“no principal specified”。
有人知道问题出在哪里吗?感谢您的帮助。

5w9g7ksd

5w9g7ksd1#

您需要将以下内容添加到 core-site.xml 文件:

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

<property>
   <name>hadoop.security.authentication</name>
   <value>kerberos</value>
</property>

相关问题