Skip to content

kerberos+hbase 启动认证失败 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zoeminghong opened this issue Apr 29, 2019 · 2 comments
Open

kerberos+hbase 启动认证失败 #3

zoeminghong opened this issue Apr 29, 2019 · 2 comments
Labels
kerberos Further information is requested
Milestone

Comments

@zoeminghong
Copy link
Owner

描述:

java.lang.IllegalArgumentException: Illegal principal name [email protected]: org.apache.hadoop.security.authentication.util.KerberosName$NoMatchingRule: No rules applied to [email protected]

方案:

krb5.conf 文件中 default_realm 不是当前环境域配置,需要进行切换一下

参考文档:

@zoeminghong
Copy link
Owner Author

描述:

Caused by: java.io.IOException: Call to dev-dmp7.fengdai.org/10.200.168.9:16020 failed on local exception: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Fail to create credential. (63) - No service creds)]

方案:

krb5.conf 文件中 default_realm 不是当前环境域配置,需要进行切换一下

参考文档:

@zoeminghong
Copy link
Owner Author

描述:

spark 连接 hbase 时,在Executor 上,出现如下认证失败的情况

19/04/28 14:19:33 INFO RpcRetryingCallerImpl: Call exception, tries=6, retries=6, started=5189 ms ago, cancelled=false, msg=Call to dev-dmp6.fengdai.org/8.8.8.8:16020 failed on local exception: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)], details=row 'DMP:DEV5_FD.FENGDAI.CREDITTONE_REPORT' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=dev-dmp6.fengdai.org,16020,1555920324932, seqNum=-1

方案:

使用该方案解决了

 UserGroupInformation.loginUserFromKeytabAndReturnUGI(hbaseAuth.principal, hbaseAuth.keyTab)
        .doAs(new PrivilegedExceptionAction[Unit] {
          override def run(): Unit = {
            connection = hbaseTemplate.getConnection
          }
        }
        )

参考文档:

@zoeminghong zoeminghong added the kerberos Further information is requested label Apr 29, 2019
@zoeminghong zoeminghong added this to the 大数据 milestone Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kerberos Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant