Hbase伪分布式安装

客官°小女子只卖身不卖艺 2021-09-26 04:52 493阅读 0赞

安装Hbase版本为0.94.7

1、修改hbase-0.94.7下的conf目录下的配置文件hbase-env.sh和hbase-site.xml

hbase-env.sh修改如下:

  1. export JAVA_HOME=/usr/Java/jdk1.6

hbase-site.xml修改如下:

  1. <configuration>
  2. <property>
  3. <name>hbase.rootdir</name>
  4. <value>hdfs://localhost:9000/hbase</value>
  5. </property>
  6. <property>
  7. <name>dfs.replication</name>
  8. <value>1</value>
  9. </property>
  10. <property>
  11. <name>hbase.cluster.distributed</name>
  12. <value>true</value>
  13. </property>
  14. </configuration>

完成以上操作,就可以正常启动Hbase了,启动顺序:先启动Hadoop——>再启动Hbase,关闭顺序:先关闭Hbase——>再关闭Hadoop。

启动hbase:

zcf@zcf-K42JZ:/usr/local/hbase$ bin/start-hbase.sh

査看进程jps:

4798 SecondaryNameNode
16790 Jps
4275 NameNode
5154 TaskTracker
16269 HQuorumPeer
4908 JobTracker
16610 HRegionServer
5305
4549 DataNode
16348 HMaster

进入shell模式: bin/hbase shell

HBase Shell; enter ‘help‘ for list of supported commands.
Type “exit“ to leave the HBase Shell
Version 0.94.7, r1471806, Wed Apr 24 18:44:36 PDT 2013

hbase(main):001:0>

先停止hbase,再停止hadoop。

我们也可以通过WEB页面来管理查看HBase数据库。

HMaster:http://192.168.0.10:60010/master.jsp

注:Hbase默认的hbase.master端口是60000

  1. <property>
  2. <name>hbase.master</name>
  3. <value>192.168.0.10:60000</value>
  4. </property>

如果在配置文件修改了master端口,在用java api的时候要为configuration指定下xml文件configuration.addResource(new FileInputStream(new File("hbase-site.xml")));,否则会报:org.apache.hadoop.hbase.MasterNotRunningException: com.google.protobuf.ServiceException: java.io.IOException: Call to master1/172.22.2.170:60000的错误

发表评论

表情:
评论列表 (有 0 条评论,493人围观)

还没有评论,来说两句吧...

相关阅读