配置hbase

1.上传tar包
hbase-2.2.2-bin.tar.gz

2.解压tar包

# 解压目录
tar -xzvf hbase-2.2.2-bin.tar.gz
 
# 删除docs目录
rm -rf docs/

3.添加hbase的环境变量
进入 /etc/profile文件

vim /etc/profile

添加以下内容

#HBASE_HOME
export HBASE_HOME=/opt/hbase-2.2.2
export PATH=$PATH:$HBASE_HOME/bin

使配置环境生效

source /etc/profile

查看是否生效

hbase version

4.进入hbase的 conf 文件

cd hbase-2.2.2/conf

5.修改配置文件:hbase-env.sh

export HBASE_MANAGES_ZK=false

export JAVA_HOME=/usr/java/jdk1.8.0_221-amd64

在这里插入图片描述

6.修改配置文件:regionservers (配置的是regionserver)

node1
node2
node3

7.修改配置文件:backup-masters (配置的是backup-masters)

cp regionservers backup-masters

添加以下内容

node2

8.修改配置文件:hbase-site.xml (配置的是备用节点)

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>	
	<property>		
		<name>hbase.rootdir</name>		

		<!--			
		file://表示的是本地目录			
		hdfs://表示的是hdfs的目录;			
		hdfs://namenode.example.org:/hbase(一定是active的namenode)		 
		-->		
		<value>hdfs://node1(namenode存活的hostname):9000/hbase</value>	
	</property>	
	<property>		
		<name>hbase.unsafe.stream.capability.enforce</name>		
		<value>false</value>		
		<description>检查兼容性,如果设置为false,数据有可能丢失(这是一个警告) Controls whether HBase will check for stream capabilities (hflush/hsync)  Disable this if you intend to run on LocalFileSystem, denoted by a rootdir  with the 'file://' scheme, but be mindful of the NOTE below.  WARNING: Setting this to false blinds you to potential data loss and inconsistent system state in the event of process and/or node failures. If HBase is complaining of an inability to use hsync or hflush it's most	likely not a false positive.		
		</description>	
	</property>		

	<!--配置 zookeepr-->	
	<property>		
		<name>hbase.zookeeper.quorum</name>		
		<value>node1:2181,node2:2181,node3:2181</value>	
	</property>	
	
	<property>		
		<name>hbase.zookeeper.property.dataDir</name>		
		<!-- zookeeper的目录:data目录 -->		
		<value>/opt/zookeeper-3.4.13/data/hbase</value>
	</property>

	<!-- 开启集群模式 -->	
	<property>		
		<name>hbase.cluster.distributed</name>		
		<value>true</value>	
	</property>

</configuration>

9.在想当master服务器启动hbase;(我这里用的是node1)

bin/start-hbase.sh 

10.关闭hbase

bin/stop-hbase.sh 

------安--装--成--功---------

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值