kerberos用户的krb5.conf ,user.keytab文件是否在程序运行时加载到了,我之前遇到的kerberos问题是flink读kafka获取不到数据,通过yarn-session模式运行,认证阶段是在yarn-session发布完成的. 最后问题出在kafka通信协议,可以看下hbase端的配置,实现不行 也可以解耦hbase跟flink中间加一个kafka
在 2019-11-26 14:50:32,"venn" <wxchunj...@163.com> 写道: >各位大佬: > > 请教一个flink 认证的问题: Flink on yarn 运行在不用认证的 Hadoop >集群上,怎样访问带kerberos 认证集群的 hbase ? > > > >下面是一些我们使用的描述和发现的问题: > > 我们有两个hadoop 集群,一个使用 Kerberos 认证模式,一个是 simple >认证模式,Flink 1.9.0 部署在 simple 认证的集群上。 > >最近在使用flink 读取 Kerberos 认证的集群的 hbase 上遇到了问题。配置 >flink-conf.yaml 中的配置参数:security.kerberos.login.keytab 、 >security.kerberos.login.principal 。 > > 我们计划在 map 中同步的读取 hbase 的数据,从输入数据中获取 >rowkey,使用get 方式获取hbase 数据,程序启动后,呈现 “卡” 在map 算子上,直 >到hbase get 超时,无法读取任何数据。在 taskmanager.log 中有发现有这样的日 >志: > > >org.apache.flink.yarn.YarnTaskExecutorRunner - OS current user: yarn > >org.apache.flink.yarn.YarnTaskExecutorRunner - current Hadoop/Kerberos >user: admin (注:登陆用户) > > > >org.apache.flink.yarn.YarnTaskExecutorRunner - YARN daemon is running as: >admin Yarn client user obtainer: admin > >org.apache.flink.runtime.security.modules.HadoopModule - Hadoop user set to >admin (auth:SIMPLE) > > > > 看过对应位置的代码,将 “Hadoop.security.authentication = >kerberos” 参数添加到 Hadoop 的 配置文件中(注: 使用 simple 认证的 hadoop集 >群使用 amberi 部署 的 hdp 集群,不开启 Kerberos 认证 参数 “Hadoop.security. >authentication” 的值为 simple ),使程序认证通过,但是 flink job 一直处于 >created 状态,taskmanager.log 中一直报 “server asks us to fall back to >SIMPLE auth. But the client is configured to only allow secure connections” > > > > > >看到官网文档有这样的描述: >https://ci.apache.org/projects/flink/flink-docs-release-1.9/ops/security-ker >beros.html > > >Hadoop Security Module > >This module uses the Hadoop UserGroupInformation (UGI) class to establish a >process-wide login user context. The login user is then used for all >interactions with Hadoop, including HDFS, HBase, and YARN. > >If Hadoop security is enabled (in core-site.xml), the login user will have >whatever Kerberos credential is configured. Otherwise, the login user >conveys only the user identity of the OS account that launched the cluster. > > > > > > >