我们好像zookeeper 没有开安全认证,从Java 代码也没有添加 jaas.conf 文件,而且
看 日志里面有 关于 zookeeper 已经建立连接相关的日志。


问题其实还没到这一步,我现在的问题是:“Flink on yarn 运行在不用认证的hadoop
集群上,是否可以访问带kerberos 认证的hadoop集群的 hbase”

现在是这两种现象:
        1、直接在不认证的hadoop集群提交 读认证hbase 的任务,可以从日志看到,
hadoop 运行在 simple 模式(默认模式,不认证模式),对应日志“Hadoop user set
to xxx (auth: SIMPLE) ”,任务卡在读hbase 的地方,直到超时
        2、修改提交节点的 core-site.xml/hdfs-site.xml,注入一个新的
core-site.xml 带配置参数 " Hadoop.security.authentication  = kerberos",可以
在日志中看到 "Hadoop user set to xxx (auth: KERBEROS)",但是任务一直处于
“created” 状态,日志报:“server asks us to fall back to SIMPLE auth. But
the client is configured to only allow secure connections”




-----邮件原件-----
发件人: user-zh-return-1559-wxchunjhyy=163....@flink.apache.org
<user-zh-return-1559-wxchunjhyy=163....@flink.apache.org> 代表 guoshuai
发送时间: Wednesday, November 27, 2019 2:26 PM
收件人: user-zh@flink.apache.org
主题: Re:回复: flink on yarn 的 kerberos 认证问题



HBase认证需要ZooKeeper和Kerberos安全认证,跟ZooKeeper认证“jaas.conf”文件也
加载进去了吗?

LoginUtil.setJaasConf(ZOOKEEPER_DEFAULT_LOGIN_CONTEXT_NAME, userName,
userKeytabFile);
LoginUtil.setZookeeperServerPrincipal(ZOOKEEPER_SERVER_PRINCIPAL_KEY,
ZOOKEEPER_DEFAULT_SERVER_PRINCIPAL);
LoginUtil.login(userName, userKeytabFile, krb5File, conf);








在 2019-11-27 14:00:15,"venn" <wxchunj...@163.com> 写道:
>我们kafka 可以正常认证、消费数据,认证hbase 和kafka 好像不一样,我们是不认
证
>读不到数据,认证了,任务又提交不到 yarn 上去了
>
>如下:
>>            看过对应位置的代码,将 “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”
>
>
>
>-----邮件原件-----
>发件人: user-zh-return-1557-wxchunjhyy=163....@flink.apache.org
><user-zh-return-1557-wxchunjhyy=163....@flink.apache.org> 代表 guoshuai
>发送时间: Wednesday, November 27, 2019 1:31 PM
>收件人: user-zh@flink.apache.org
>主题: Re:flink on yarn 的 kerberos 认证问题
>
>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/securi
>>t
>>y-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.
>>
>> 
>>
>> 
>>
>> 
>>

回复