JAVA连接hbase伪分布失败_hbase伪分布安装配置

hbase.rootdir  --hbase持久保存的目录

hdfs:192.168.8.101:9000/hbase

hbase.cluster.distributed --是否是分布式

true

hbase.zookeeper.property.clientPort --指定要连接zk的端口

2181

hbase.zookeeper.quorum --指定要连接zk的节点

192.168.8.101

dfs.replication

1

regionservers  192.168.8.101

为了防止因为hbase和hadoop版本不一致而出现的问题,可以看下{hbase_home}/lib/下相关hadoop*.jar的jar包,跟你的hadoop是否是同一个版本,如果不是可以从{hadoop_home}/ share/hadoop/ 下复制

启动hbase(启动的hbase的时候要保证hadoop集群已经启动)

/hbase/bin/start-hbase.sh

查看hbase的进程

48304ba5e6f9fe08f3fa1abda7d326ab.png

[root@node4 bin]# ./start-hbase.sh

localhost: starting zookeeper, logging to /home/zhangxs/hbase/bin/../logs/hbase-root-zookeeper-node4.out

starting master, logging to /usr/local/development/hbase-1.2.4/logs/hbase-node4-master-node4.out

starting regionserver, logging to /usr/local/development/hbase-1.2.4/logs/hbase-node4-1-regionserver-node4.out

[root@node4 bin]# jps

8057 Jps

3166 NodeManager

7830 HRegionServer

2933 SecondaryNameNode

2561 NameNode

5568 QuorumPeerMain

7706 HMaster

3071 ResourceManager

2650 DataNode

5749 GetConf

48304ba5e6f9fe08f3fa1abda7d326ab.png

4cf9dc0ab3507cb4f48390a854d8a41e.png

如果报这个错误是因为用的jdk是1.8的

需要注释掉以下:

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

# Configure PermSize. Only needed in JDK7. You can safely remove it for JDK8+

export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"

export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"

没注释以前start-hbase.sh启动后HMaster hregionserver会出现一次.....

输入hbase shell(进入shell命令行)

48304ba5e6f9fe08f3fa1abda7d326ab.png

[root@node4 bin]# hbase shell

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/local/development/hbase-1.2.4/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/usr/local/development/hadoop-2.6.4/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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]

HBase Shell; enter 'help' for list of supported commands.

Type "exit" to leave the HBase Shell

Version 1.2.4, r67592f3d062743907f8c5ae00dbbe1ae4f69e5af, Tue Oct 25 18:10:20 CDT 2016

hbase(main):001:0>

48304ba5e6f9fe08f3fa1abda7d326ab.png

fe59063760c2dabc82c5261177bc2670.png

通过web页面访问hbase

8f0b1b1b34a469701ac8cea414f06d14.png

hbase.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值