用户可以通过ThriftServer来访问HBase服务,它的特点如下:
如果HBase集群开启了Kerberos认证(E-MapReduce可一键创建安全集群,非常方便),那么用户怎么通过ThriftServer访问HBase服务呢?
ThriftServer其实是HBase服务的客户端,既然HBase开启了Kerberos认证,那么ThrifServer也必须配置Kerberos的信息才能正常访问HBase集群服务。
在ThriftServer的hbase-site.xml文件中添加新配置:
<property>
<name>hbase.security.authentication</name>
<value>kerberos</value>
</property>
<property>
<name>hbase.thrift.kerberos.principal</name>
<value>hbase/[email protected]</value>
</property>
<property>
<name>hbase.thrift.keytab.file</name>
<value>/etc/ecm/hbase-conf/hbase-thrift.keytab</value>
</property>
上述配置中实际值以用户为准(principle和keytab需对应)。
用户使用python/java/php等Thrift客户端访问ThrifServer有两种方式:
任何用户都可以通过ThriftServer访问HBase服务,而且都是以ThriftServer本身配置的hbase.thrift.kerberos.principal中的用户名去访问HBase服务,即对HBase服务来说只有一个固定的用户来访问。
如下图所示:
这种方式使得HBase集群的Kerberos认证无效,不适合使用开启了Kerberos的场景。
ThriftServer可以开启对Client进行身份认证,而且以实际的用户身份访问HBase服务。

需要做如下配置:
<property>
<name>hbase.thrift.security.qop</name>
<value>auth</value>
</property>
其中hbase.thrift.security.qop可以是auth/auth-init/auth-conf中的一个
<property>
<name>hadoop.proxyuser.$user.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.$user.groups</name>
<value>*</value>
</property>
备注:
a) $user为ThriftServer本身配置的hbase.thrift.kerberos.principal中的用户
b) 重启HBase集群(无需重启HDFS)
上述2.2.2节的场景代码
参考github上一个项目:
https://github.com/joshelser/hbase-thrift1-python-sasl
使用方式在README.md中:
-> 在客户端运行的账号下kinit初始化好Kerberos的TGT
-> ./setup.sh
-> python get_row.py
备注: get_row.py需要根据实际集群的配置修改相关参数
HBase官方的example jar有示例代码:
https://github.com/apache/hbase/tree/master/hbase-examples
-> 在客户端运行的账号下kinit初始化好Kerberos的TGT
->
export HBASE_EXAMPLE_CLASSPATH=`hbase classpath`;
java -cp /usr/lib/hbase-current/lib/hbase-examples-1.1.1.jar:$HBASE_EXAMPLE_CLASSPATH org.apache.hadoop.hbase.thrift.DemoClient $thrift_server_host $thrift_serve_port true
有兴趣或者有需求的用户可以关注一下E-MapReduce的安全相关的功能,有问题及时联系和反馈。

来源:https://yq.aliyun.com/articles/335976
参考博文 官方文档 参考博文2 前言 本文是在参考了两篇博文和官方文档基础上写成的,更多的是想通过自己学完复述一遍的方式加深理解。 Kerberos在希腊神话中是守护地狱之门的三头犬。在使用Kerberos中涉及到KDC(有些资料可能会叫做AS,即认证服务器)、客户端、服务器三方的身份认证问题,因此用Kerberos来进行命名还是十分贴切的。 概念学习 在开始正式的Kerberos学习之前,我们需...
Kerberos: The Network Authentication Protocol 1 引言 0编写目的 针对DataIDE和C70集群中均采用kerberos进行通讯安全认证,为方便日后对kerberos的学习,形成文档。 1kerberos简介 Kerberos简单来说就是一个用于安全认证第三方协议,它采用了传统的共享**的方式,实现了在网络环境不一定保证安全的...
登录7180管理平台,在各组件配置页面,执行下面操作 Hbase修改hbase.security.authentication为simple,取消勾选hbase.security.authorization HDFS修改hadoop.security.authentication为simple,取消勾选hadoop.security.authorization,将dat...
1 Kerberos Kerberos是诞生于上个世纪90年代的计算机认证协议,被广泛应用于各大操作系统和Hadoop生态系统中。了解Kerberos认证的流程将有助于解决Hadoop集群中的安全配置过程中的问题。 2 Kerberos可以用来做什么 简单地说,Kerberos提供了一种单点登录(SSO)的方法。考虑这样一个场景,在一个网络中有不同的服务器,比如,打印服务器、邮件服务器和文件服务器...
安全协议:Kerberos认证协议 一、简介 Kerberos由MIT于1988年开发,用于分布式环境中,完成服务器与用户之间的相互认证。设计者的设计初衷是要用Kerberos的三个头来守卫网络之门。三个头分别包括:认证、账目清算和审计。 Kerberos要解决的问题 在一个开放的分布式网络环境中,用户通过工作站访问服务器提供的服务,存在许多问题: 工作站上的用户可以冒充另一个用户操作 用户可以改...
示例 ==> 小明要去电影院看一场电影: 1.前期需求,使用自己的账户密码登录票务中心,确定自己想看什么电影,位于哪个影院,什么时间观看; 2.购票机制,通过付费购票,来让小明从未授权的影院访问者变成被授权访问的状态; 3.验票机制,验证票据持有者的身份,和票务中心核对验证票据的合法性、电影名称、电影院位置、时间; 4.观看电影,一切验证通过后得到想要的内容; 5.再次观看,需要重新购票走流...
摄像头的8种颜色:橙、黄、绿、紫、灰、蓝、棕、白 分别对应双绞线的8种颜色:橙白、橙、绿白、蓝、蓝白、绿、棕白、棕 简化一点用网线的568B顺序分别对接就是:橙白(接橙色)、橙(接黄色)、绿白(接绿色)、蓝(接紫色)、蓝白(接灰色)、绿(接蓝色)、棕白(接棕色)、棕(接白色) 568A标准:绿白,绿,橙白,蓝,蓝白,橙,棕白,棕 橙绿蓝棕 排列好,先4-6交叉,再1-3、2-6 RJ-4...
静态资源访问失效,是应为其地址无法自动添加项目路径 以下model.html 以下index.html 以下index_1.html 以下controller.java 结果...
配置日志并测试 进入到hive目录修改日志文件名称 在hive目录下创建logs目录 修改hive-log4j.properties配置文件hive.log.dir 把hive.log.dir=${java.io.tmpdir}/${user.name} 修改为 /opt/modules/hive-0.13.1/logs 退出hive 进入hive进行测试 进入 日志文件产生 在hive控制台打印...
最近用beeline替代hive cli,发现之前在hive-site.xml 的 Hive 客户端高级配置代码段(安全阀)的配置项,beeline居然不生效,如下图所示,而hive cli是生效的 查看了执行机器上/etc/hive/conf/hive-site.xml文件,发现配置确实是修改了,一直以为是环境变量的原因,找了几个小时,网上也没相关解释,最后在hive-site.xml 的 Hi...
I'm trying to suppress IE's default handling of Ctrl+O. I've got a onKeyDown handler which get's called, but even though I call event.cancelBubble and return false, the default File|Open command still...
Recently i've picked up Oracle SQL, Right now i'm trying to write a function that later will be used in a view to generate a list. but for now im stuck on the function itself... The function makes use...
I have a problem regarding of creating table. I want to do this: But I got this: I have tried everything and I'm realize that I have problem with the looping. I've tried to put @endforeach before <...
I have a WPF 3D application (C# .NET 4.0) that has a lot of 3D geometries. Now I need to color these geometries by applying a texture. The source for the texture is one large .PNG file like the follow...
after filling the inputs in the view and clicking the submit button, the records gets saved just fine if I use Firefox. The same goes for IE if I'm quick enough. But when I wait 10 seconds, the POST d...