HBASE 单机部署

下载页面:

https://www.apache.org/dyn/closer.lua/hbase/2.2.5/hbase-2.2.5-bin.tar.gz

下载

https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/2.2.5/hbase-2.2.5-bin.tar.gz

添加变量

vim /etc/profile
# 添加
# hbase
export PATH=$PATH:/usr/local/hbase-2.2.5/bin

切换目录

/usr/local/hbase-2.2.5

直接启动试试:

[root@hadoop logs]# start-hbase.sh 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop-3.2.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hbase-2.2.5/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
running master, logging to /usr/local/hbase-2.2.5/bin/../logs/hbase-root-master-hadoop.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop-3.2.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hbase-2.2.5/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[root@hadoop logs]# 

jps 没有任何HBASE的进程 好吧,看下日志

2020-06-26 16:28:36,935 INFO  [Thread-2] server.NIOServerCnxn: Stat command output
2020-06-26 16:28:36,936 INFO  [Thread-2] server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:57168 (no session established for client)
2020-06-26 16:28:36,936 INFO  [main] zookeeper.MiniZooKeeperCluster: Started MiniZooKeeperCluster and ran successful 'stat' on client port=2182
2020-06-26 16:28:36,937 ERROR [main] master.HMasterCommandLine: Master exiting
java.io.IOException: Could not start ZK at requested port of 2181.  ZK was started at port: 2182.  Aborting as clients (e.g. shell) will not be able to find this ZK quorum.
	at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:217)
	at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
	at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
	at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2945)

借鉴于此

zk运行的端口应该是2182而不是默认的2181
解决:

vim conf/hbase-site.xml
# 插入以下内容
<property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2182</value>
</property>

在重启下

stop-hbase.sh
start-hbase.sh

检查下

[root@hadoop conf]# jps
25680 SecondaryNameNode
25473 DataNode
26099 NodeManager
25048 QuorumPeerMain
25946 ResourceManager
29133 HMaster
29325 Jps
# 嗯 还不错起来一个hmaster

这段搞了一下午 改了好他妈多的东西,最终总结的配置文件是这样子:

# hbase-env.sh 文件加入
export JAVA_HOME=/usr/local/java
export HBASE_MANAGES_ZK=false
export HBASE_CLASSPATH=/usr/local/hbase/conf
# hbase-site.xml 文件加入


           hbase.master
            
           hadoop:6000
   
   
           hbase.master.maxclockskew
           180000
   
   
           hbase.rootdir
            
           hdfs://hadoop:9000/hbase
   
   
           hbase.cluster.distributed
           true
   
   
           hbase.zookeeper.quorum
           
           hadoop
   
   
           hbase.zookeeper.property.dataDir
           /data/zookeeper
   
   
           dfs.replication
           1
   

hbase.master.info.port
60010


    zookeeper.session.timeout
    300000
   


  hbase.unsafe.stream.capability.enforce
  false


# regionservers文件内容(Hadoop是添加在hosts解析中的主机名)
hadoop

启动,访问60010端口检查

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