hbase配置高可用

前戏

四台虚拟机要免密钥
先启动zookeeper
启动hadoop;hbase要四台虚拟机所有的文件都放到hdfs上

开整

配置文件:(conf/regionservers )(配置的是小弟)
node7-1
node7-3
node7-4
配置文件:(conf/backup-masters )(配置的是二哥,大哥挂掉,二哥顶上)(复制的regionservers 新建的)
node7-1
node7-3
配置文件:(conf/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:8020/hbase(一定是active的namenode)
		 -->
		<value>hdfs://node7-1:8020/data/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>node7-1:2181,node7-2:2181,node7-3:2181</value>
	</property>
	<property>
		<name>hbase.zookeeper.property.dataDir</name>
		<!-- zookeeper的目录:data目录 -->
		<value>/data/hbase/zookeeper_data</value>
	</property>
<!-- 开启集群模式 -->
	<property>
		<name>hbase.cluster.distributed</name>
		<value>true</value>
	</property>
</configuration>

配置文件:(conf/hbase-env.sh )

配置jdk路径,将hbase自带的zookeeper关掉

在这里插入图片描述

在想当大哥的服务器启动hbase;(node7-2)

bin/start-hbase.sh

关掉

bin/stop-hbase.sh

访问

http://node7-2:16010/
在这里插入图片描述
在这里插入图片描述

注:1.因为Hbase连接hadoop是通过hdfs协议的,所有hadoop的配置文件是无法读取的;
我们要把hadoop所有的配置文件拷贝过来;就可以生效;
2.如果想清空hbase的所有数据重新来一遍
清空hdfs
清空zookeeper

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值