问题描述
我们在使用安全 mapr 集群设置 oozie 服务时遇到问题。
我们使用 MapR 安装程序来设置 MapR 集群。以下是我们遵循的配置和步骤。
MapR 版本 - 6.1
操作系统 - Ubuntu 16.04
身份验证 - Kerberos
节点 - 单节点
- 我们通过使用安装程序中的
Enable Secure Cluster
选项启用了 Mapr 安全性。
参考文档 - https://docs.datafabric.hpe.com/61/AdvancedInstallation/using_enable_secure_cluster_option.html
- 我们已经在机器中安装了 kerberos。
参考文档 - https://linuxconfig.org/how-to-install-kerberos-kdc-server-and-client-on-ubuntu-18-04
- 以下是我们为 MapR 集群设置 kerberos 身份验证所执行的命令
参考文档 - https://docs.datafabric.hpe.com/61/SecurityGuide/Configuring-Kerberos-User-Authentication.html https://docs.datafabric.hpe.com/61/SecurityGuide/ConfiguringSPNEGOonMapR.html
sudo kadmin.local
addprinc -randkey mapr/my.cluster.com
ktadd -k /opt/mapr/conf/mapr.keytab mapr/my.cluster.com
addprinc -randkey HTTP/<instance-name>@<realm-name>
ktadd -k /opt/mapr/conf/http.keytab HTTP/<instance-name>@<realm-name>
addprinc -randkey mapr/<instance-name>@<realm-name>
ktadd -k /opt/mapr/conf/mapr2.keytab mapr/<instance-name>@<realm-name>
sudo chown mapr:mapr /opt/mapr/conf/mapr.keytab /opt/mapr/conf/http.keytab /opt/mapr/conf/mapr2.keytab
sudo chmod 777 /opt/mapr/conf/mapr.keytab /opt/mapr/conf/http.keytab /opt/mapr/conf/mapr2.keytab
ktutil
rkt /opt/mapr/conf/mapr.keytab
rkt /opt/mapr/conf/http.keytab
rkt /opt/mapr/conf/mapr2.keytab
wkt /opt/mapr/conf/mapr.keytab
sudo /opt/mapr/server/configure.sh -N my.cluster.com -C <CLDB Node>:7222 -Z <ZookeeperNode>:5181 -K -P "mapr/my.cluster.com@<realm-name>"
注意:
文档中提到的命令 (configure.sh -K -P "<cldbPrincipal>"
) 抛出错误,但上述命令有效。
kinit
maprlogin kerberos
hadoop fs -ls
3.1 ) 我们能够访问 mapr 文件系统。
3.2) 我们使用下面的命令来运行一个简单的 mapreduce 作业,它运行良好。
hadoop jar /opt/mapr/hadoop/hadoop-2.7.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.0-mapr-1808.jar pi 16 1000
- 使用 kerberos 身份验证的 Oozie 配置 参考文档 - https://docs.datafabric.hpe.com/61/Oozie/ConfiguringOozieonaSecureCluster.html
<property>
<name>oozie.authentication.type</name>
<value>kerberos</value>
<description>
Defines authentication used for Oozie HTTP endpoint.
Supported values are: simple | kerberos | #AUTHENTICATION_HANDLER_CLASSNAME#
</description>
</property>
<property>
<name>oozie.service.HadoopAccessorService.keytab.file</name>
<value>/opt/mapr/conf/mapr.keytab</value>
<description>
Location of the Oozie user keytab file.
</description>
</property>
<property>
<name>local.realm</name>
<value>{local.realm}</value>
<description>
Kerberos Realm used by Oozie and Hadoop. Using 'local.realm' aligns with Hadoop configuration
</description>
</property>
<property>
<name>oozie.service.HadoopAccessorService.kerberos.principal</name>
<value>mapr/<hostname>@${local.realm}</value>
<description>
Kerberos principal for Oozie service.
</description>
</property>
<property>
<name>oozie.authentication.kerberos.principal</name>
<value>HTTP/<hostname>@${local.realm}</value>
<description>
Indicates the Kerberos principal to be used for the HTTP endpoint. The principal MUST start with 'HTTP/' per the Kerberos HTTP SPNEGO specification.
</description>
</property>
- 我们正在使用
bin/oozie admin -status -auth KERBEROS
命令检查 oozie 状态,但出现以下错误。
java.io.IOException:连接 Oozie 服务器时出错。重试次数 = 1。异常 = 无法进行身份验证,身份验证失败,状态:302
请帮助我们解决此问题
解决方法
Oozie 总的来说是一个可怕的噩梦。添加 Kerberos 并不容易。随便说说。
您所描述的问题似乎是某些组件没有获得关于您正在使用的 Kerberos 身份的备忘录,或者没有访问/权限来验证访问。这是一个常见问题,通常需要逐步交互以解决已知和未知(但通常是假设的)的问题。不过,我绝对不是这类问题的专家。
这里有一份非常出色的问题报告,正是支持团队可以使用的那种东西。
您是否有积极的支持或合作伙伴?