Ambari 开启kerberos报错add_principal:分析主体时主体的格式不正确怎么解决

发布时间:2021-12-23 18:48:36 作者:柒染
来源:亿速云 阅读:372

Ambari 开启kerberos报错add_principal:分析主体时主体的格式不正确怎么解决,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

问题描述

ambari开启kerberos时,stop services后create principals报错如下:

Ambari 开启kerberos报错add_principal:分析主体时主体的格式不正确怎么解决

通过命令验证该错误是mycluster-112020@admin/admin@OCDP.COM这个principal语法不合法

kadmin.local:  addprinc mycluster-112020@admin/admin@OCDP.COM
add_principal: Malformed representation of principal while parsing principal
usage: add_principal [options] principal
	options are:
		[-randkey|-nokey] [-x db_princ_args]* [-expire expdate] [-pwexpire pwexpdate] [-maxlife maxtixlife]
		[-kvno kvno] [-policy policy] [-clearpolicy]
		[-pw password] [-maxrenewlife maxrenewlife]
		[-e keysaltlist]
		[{+|-}attribute]
	attributes are:
		allow_postdated allow_forwardable allow_tgs_req allow_renewable
		allow_proxiable allow_dup_skey allow_tix requires_preauth
		requires_hwauth needchange allow_svr password_changing_service
		ok_as_delegate ok_to_auth_as_delegate no_auth_data_required
		lockdown_keys

where,
	[-x db_princ_args]* - any number of database specific arguments.
			Look at each database documentation for supported arguments

那么为啥ambari会给我们生成一个这样的Principal名称呢,有点奇怪

ambari数据库里有四张关于kerberos的表如下图:

Ambari 开启kerberos报错add_principal:分析主体时主体的格式不正确怎么解决

在以下三张表中找到报错记录:

Ambari 开启kerberos报错add_principal:分析主体时主体的格式不正确怎么解决

Ambari 开启kerberos报错add_principal:分析主体时主体的格式不正确怎么解决

Ambari 开启kerberos报错add_principal:分析主体时主体的格式不正确怎么解决

解决办法

ambari会去数据库里拿principal名称,现在这个不正常的名称导致报错,所以要把数据库中相关记录删除

<font color='red'>这几张表有外键检查,所以删除前先把外键检查关掉,删除完了再恢复即可</font>

--关掉外键检查
show global variables like "%foreign_key_checks%";
set global foreign_key_checks=0;
show global variables like "%foreign_key_checks%";

--删除kerberos三个表中报错principl
delete  from kerberos_keytab where keytab_path="/etc/security/keytabs/kerberos.service_check.112020.keytab";

delete from kerberos_principal where principal_name="mycluster-112020@admin/admin@OCDP.COM";

delete from kerberos_keytab_principal where keytab_path="/etc/security/keytabs/kerberos.service_check.112020.keytab";

--恢复外键检查
set global foreign_key_checks=1;
show global variables like "%foreign_key_checks%";

再去重试kerberos打开正常

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注亿速云行业资讯频道,感谢您对亿速云的支持。

推荐阅读:
  1. ambari+hdp安装
  2. Ambari Server 服务迁移

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ambari kerberos

上一篇:Snowflake的独特技术优势是什么

下一篇:linux中如何删除用户组

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》