Kerberos常见错误及解决方案

1、 Kerberos启动后台日志提示异常:No such file or directory – while initializing database for realm HADOOP.COM
在/var/log/krb5kdc.log中发现No such file or directory – while initializing database for realm HADOOP.COM。
解决方案:

①: 检查kdc.conf和krb5.conf文件是否配置正确,修改配置,注意:配置文件的[kdcdefaults],[logging]、[libdefaults]等的里面不能有空格

② 停止服务

service krb5kdc stop
service kadmin stop

③ 删除Kerberos数据库重新创建数据库

rm -rf /var/kerberos/krb5kdc/principal

kdb5_util create -s -r HADOOP.COM

④ 创建管理员

kadmin.local -q “addprinc admin/admin”

⑤ 启动服务

service krb5kdc start
service kadmin start

2、 kinit通过keytab认证出现异常

通过 Linux 的 brack 主体执行kinit -kt /root/brack.keytab brack出现下面情况:

kinit: ??? while getting initial credentials
或者
kinit: Permission denied while getting initial credenti

解决方式:

① 使用root用户修改brack.keytab的所属用户:

chown brack /root/brack.keytab

② 修改 brack.keytab 的权限为660

chmod 660 /root/brack.keytab

3、 kinit认证时密码输入正确却提示密码错误

[root@hadoop102 ~]# kinit brack
Password for [email protected]:
kinit: Password incorrect while getting initial credentials

这是因为atguigu已经生成了keytab,所以此时通过这种方式不能认证,需要通过keytab文件来认证,或者修改密码后再认证(修改密码后之前的keytab文件会失效)。

[root@hadoop102 ~]# kinit -kt /root/brack.keytab atguigu
[root@hadoop102 ~]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]

Valid starting Expires Service principal
03/27/19 16:00:39 03/28/19 16:00:39 krbtgt/[email protected]
renew until 03/27/19 16:00:39

4、创建数据库异常

Bad krb5 admin server hostname while initializing kadmin interface

原因:在 krb5.conf 文件中为 admin_server 配置了无效的主机名。

解决方案:

修改krb5文件,检查admin_server配置是否正确的主机名,修改后,重启执行创建数据库的命令。
5、 Zookeeper集群启动异常

异常信息:Could not configure server because SASL configuration did not allow the ZooKeeper server to authenticate itself properly: javax.security.auth.login.LoginException: No password provided

问题:属于认证凭证更新问题

解决办法:ZooKeeper 启动安全机制,重新生成Krb5凭证。

每个主机重新更新凭证方法:全部服务停止和Cloudera Manager服务停止,修改Kerberos配置中的 Kerberos 加密类型随便添加一个,就可以主机更新Krb5凭证,然后在改回去在重新生成一次
6、 Hue启动,Kerberos Ticket Renewer起不来

[root@hadoop102 ~]# kinit hue
Password for [email protected]:

[root@hadoop102 ~]# kadmin.local
Authenticating as principal hue/[email protected] with password.

kadmin.local: modprinc -maxrenewlife 90day krbtgt/[email protected]
Principal “krbtgt/[email protected]” modified.

kadmin.local: modprinc -maxrenewlife 90day +allow_renewable krbtgt/[email protected]
Principal “krbtgt/[email protected]” modified.

猜你喜欢

转载自blog.csdn.net/shkstart/article/details/108327606