看到有的教程用到了hadoop、zookeeper,我初学时不想牵扯到那么多软件,就想知道单hbase的用法,文件就存储在本地系统上,hbase里面也集成了zookeeper吧,就不用外部的zookeeper了。
我将hbase.rootdir指向了file:///mnt/hgfs/VMshared/hbase-1.1.2/testuser,刚开始用create、list、put、scan都可用,后面竟然出问题了。
1、运行hbase shell会报org.apache.zookeeper.KeeperException$ConnectionLossException。
2、虽然报了这个意外但还是能进入hbase shell,输create 'test2', 'cf'后报client.ConnectionManager$HConnectionImplementation: Can't get connection to ZooKeeper。是不是没开zookeeper?怎么开?我第一次用也没开什么zookeeper怎么就没问题?需要开zookeeper吗,我看一些教程都没说要开zookeeper啊。我想了下比之前多做的改动,就是添加了HADOOP_HOME环境变量,再把HADOOP_HOME去掉后也还是不行。
3、jps看一下,start-hbase.sh后会开一个HMaster,是否还应该有HQuorumPeer、regionserver?hbase shell后会再多一个Main。
4、HMaster虽然启动了,但是发现几分钟后会自动关闭,怎么回事?
5、用hbase-daemon.sh start zookeeper开启zookeeper后就开不了HMaster了,hbase-root-master-master.out文件说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.
6、此时在hbase shell执行create、ls命令,报The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
现在要做的是简单的单机单hbase测试,创建表格,并显示所创建的内容。