CentOS 7 搭建 Hbase 2.2.3

参考文档:
https://blog.csdn.net/fenggms/article/details/82932697


补充:
1、版本下载错了,下了个还没编译的,src,其实要下载名字带 bin 的那个版本,运行hbase -version,如果报下面的错误就要换一个安装包,或者下载安装Maven,自行编译HBase.参考文档

Error: Could not find or load main class org.apache.hadoop.hbase.util.HBaseConfTool

传送门
在这里插入图片描述
2、各个节点的hbase-site.xml是一样的,注意里面的

<property>
	<name>hbase.rootdir</name>
	<value>hdfs://node100:9000/hbase</value>
</property>

注意: node100:9000是你的hadoop主节点,可能有的人就专门设置得不一样

3、三个节点的regionservers内容是一样的,都是写着从节点的主机名;三个节点的backup-masters也是一样的。

4、没有关闭防火墙导致的错误

INFO  [Thread-17] hdfs.DataStreamer: Exception in createBlockOutputStream
java.net.NoRouteToHostException: No route to host
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
	at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
	at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:531)
	at org.apache.hadoop.hdfs.DataStreamer.createSocketForPipeline(DataStreamer.java:259)
	at org.apache.hadoop.hdfs.DataStreamer.createBlockOutputStream(DataStreamer.java:1692)
	at org.apache.hadoop.hdfs.DataStreamer.nextBlockOutputStream(DataStreamer.java:1648)
	at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:704)

......

WARN  [Thread-17] hdfs.DataStreamer: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be written to 0 of the 1 minReplication nodes. There are 2 datanode(s) running and 2 node(s) are excluded in this operation.
	at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:2135)
	at org.apache.hadoop.hdfs.server.namenode.FSDirWriteFileOp.chooseTargetForNewBlock(FSDirWriteFileOp.java:294)
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2771)
	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:876)
	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:567)
	at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:524)
	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1025)
	at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:876)
	at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:822)
	at java.security.AccessController.doPrivileged(Native Method)

......

关闭防火墙:

systemctl stop firewalld.service         #停止firewall
systemctl disable firewalld.service      #禁止firewall开机启动

5、关了防火墙还是报错呀

ERROR [master/node100:16000:becomeActiveMaster] master.HMaster: Failed to become active master
java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper operation during component failures, but the underlying filesystem does not support doing so. Please check the config value of 'hbase.procedure.store.wal.use.hsync' to set the desired level of robustness and ensure the config value of 'hbase.wal.dir' points to a FileSystem mount that can provide it.
	at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.rollWriter(WALProcedureStore.java:1092)
	at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.recoverLease(WALProcedureStore.java:424)
	at org.apache.hadoop.hbase.procedure2.ProcedureExecutor.init(ProcedureExecutor.java:586)
	at org.apache.hadoop.hbase.master.HMaster.createProcedureExecutor(HMaster.java:1523)
	at org.apache.hadoop.hbase.master.HMaster.finishActiveMasterInitialization(HMaster.java:938)
	at org.apache.hadoop.hbase.master.HMaster.startActiveMasterManager(HMaster.java:2110)
	at org.apache.hadoop.hbase.master.HMaster.lambda$run$0(HMaster.java:580)
	at java.lang.Thread.run(Thread.java:748)

参考,在hbase-site.xml中添加:

<property>
  <name>hbase.unsafe.stream.capability.enforce</name>
  <value>false</value>
</property> 

设置这个是啥意思呢,参考文档

	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.

你可能感兴趣的:(大数据)