在Hadoop集群部署Hbase并开启kerberos

集群现有环境:node*6;jdk1.7.0_55;已安装zookeeper、hdfs(HA)、yarn、historyserver和httpfs并已开启kerberos(kdc部署在cluster的一个节点上)。

所需安装的包:所有节点-> yum install hbase  主节点-> yum install hbase-master hbase-thrift hbase-rest  从节点-> yum install hbase-regionserver

所需修改的配置文件如下:

主配置文件及内容: /etc/hbase/conf/hbase-site.xml 


<configuration>

<property>

<name>hbase.cluster.distributed</name>

<value>true</value>

</property>

<property>

<name>hbase.rootdir</name>

<value>hdfs://irs-hdp-HA/hbase</value>

</property>

<property>

<name>hbase.rest.port</name>

<value>60050</value>

</property>

<property>

<name>hbase.zookeeper.quorum</name>

<value>cdh01.hypers.com,cdh02.hypers.com,cdh03.hypers.com</value>

</property>

<property>

<name>hbase.replication</name>

<value>true</value>

</property>

<property>

<name>hbase.security.authorization</name>

<value>true</value>

</property>

<property>

<name>hbase.coprocessor.master.classes</name>

<value>org.apache.hadoop.hbase.security.access.AccessController</value>

</property>

<property>

<name>hbase.coprocessor.region.classes</name>

<value>org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.AccessController</value>

</property>

<property>

<name>hbase.security.authentication</name>

<value>kerberos</value>

</property>

<property>

<name>hbase.rpc.engine</name>

<value>org.apache.hadoop.hbase.ipc.SecureRpcEngine</value>

</property>

<property>

<name>hbase.regionserver.kerberos.principal</name>

<value>hbase/_HOST@HADOOP.COM</value>

</property>

<property>

<name>hbase.regionserver.keytab.file</name>

<value>/etc/hadoop/conf/hbase.keytab</value>

</property>

<property>

<name>hbase.master.kerberos.principal</name>

<value>hbase/_HOST@HADOOP.COM</value>

</property>

<property>

<name>hbase.master.keytab.file</name>

<value>/etc/hadoop/conf/hbase.keytab</value>

</property>

<property>

<name>hbase.thrift.keytab.file</name>

<value>/etc/hadoop/conf/hbase.keytab</value>

</property>

<property>

<name>hbase.thrift.kerberos.principal</name>

<value>hbase/_HOST@HADOOP.COM</value>

</property>

<property>

<name>hbase.rest.keytab.file</name>

<value>/etc/hadoop/conf/hbase.keytab</value>

</property>

<property>

<name>hbase.rest.kerberos.principal</name>

<value>hbase/_HOST@HADOOP.COM</value>

</property>

<property>

<name>hbase.rest.authentication.type</name>

<value>kerberos</value>

</property>

<property>

<name>hbase.rest.authentication.kerberos.principal</name>

<value>HTTP/_HOST@HADOOP.COM</value>

</property>

<property>

<name>hbase.rest.authentication.kerberos.keytab</name>

<value>/etc/hadoop/conf/hbase.keytab</value>

</property>

</configuration>

安全相关配置文件 /etc/hbase/conf/zk-jaas.conf

Client {

com.sun.security.auth.module.Krb5LoginModule required

useKeyTab=true

useTicketCache=false

keyTab="/etc/hadoop/conf/hbase.keytab"

principal="hbase/cdh01.hypers.com@HADOOP.COM";

};

hbase相关的环境变量文件: /etc/hbase/conf/hbase-env.sh

export HBASE_OPTS="-XX:+UseConcMarkSweepGC"

export HBASE_OPTS="$HBASE_OPTS -Djava.security.auth.login.config=/etc/hbase/conf/zk-jaas.conf"

export HBASE_MANAGES_ZK=false

zookeeper配置文件(仅末尾两行是hbase配置所需追加的): /usr/lib/zookeeper/conf/zoo.cfg

maxClientCnxns=50

tickTime=2000

initLimit=5

syncLimit=2

dataDir=/var/lib/zookeeper

clientPort=2181

server.1=cdh01.hypers.com:2888:3888

server.2=cdh02.hypers.com:2888:3888

server.3=cdh03.hypers.com:2888:3888

authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider

jaasLoginRenew=3600000

kerberos.removeHostFromPrincipal=true

kerberos.removeRealmFromPrincipal=true 

-----------------------------------------------------End-----------------------------------------------------

Hadoop+HBase搭建云存储总结 PDF

HBase 结点之间时间不一致造成regionserver启动失败

Hadoop+ZooKeeper+HBase集群配置

Hadoop集群安装&HBase实验环境搭建

基于Hadoop集群的HBase集群的配置

Hadoop安装部署笔记之-HBase完全分布模式安装

单机版搭建HBase环境图文教程详解


参考文档说明(hortonworks会简称hdp;cloudera则cdh):

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/22fbe238511ac5e72ce53ea1618f0096.html