4、配置Zookeeper集群
在开始启动HBase集群之前,要先启动Zookeeper集群,保证其运行正常。
5、启动HBase集群
启动HBase集群了,执行如下脚本:
start-hbase.sh
你可以使用jps查看一下,当前master上启动的全部进程,如下所示:
Hadoop@master:~/installation/hbase-0.90.4$ jps 15899 SecondaryNameNode 15553 NameNode 21677 Jps 21537 HMaster
其中,HMaster进程就是HBase集群的主结点服务进程。
slaves结点上启动的进程,以slave-03为例:
hadoop@slave-03:~/installation/hbase-0.90.4$ jps 6919 HRegionServer 4212 QuorumPeerMain 7053 Jps 3483 DataNode
上面,HReginServer是HBase集群的从结点服务进程,QuorumPeerMain是ZooKeeper集群的结点服务进程。
或者,查看日志,是否出现启动异常:
master上 : tail -500f $HBASE_HOME/logs/hbase-hadoop-master-master.log slave-01上: tail -500f $HBASE_HOME/logs/hbase-hadoop-zookeeper-slave-01.log slave-02上: tail -500f $HBASE_HOME/logs/hbase-hadoop-zookeeper-slave-02.log slave-03上: tail -500f $HBASE_HOME/logs/hbase-hadoop-zookeeper-slave-03.log
6、验证HBase安装启动HBase shell,如果能够显示如下信息则说明HBase集群启动成功:
hadoop@master:~/installation/hbase-0.90.4$ hbase shell 12/01/09 01:14:09 WARN conf.Configuration: hadoop.native.lib is deprecated. Instead, use io.native.lib.available 12/01/09 01:14:09 WARN conf.Configuration: hadoop.native.lib is deprecated. Instead, use io.native.lib.available 12/01/09 01:14:09 WARN conf.Configuration: hadoop.native.lib is deprecated. Instead, use io.native.lib.available HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 0.90.4, r1150278, Sun Jul 24 15:53:29 PDT 2011 hbase(main):001:0> help HBase Shell, version 0.90.4, r1150278, Sun Jul 24 15:53:29 PDT 2011 Type 'help "COMMAND"', (e.g. 'help "get"' -- the quotes are necessary) for help on a specific command. Commands are grouped. Type 'help "COMMAND_GROUP"', (e.g. 'help "general"') for help on a command group. COMMAND GROUPS: Group name: general Commands: status, version Group name: ddl Commands: alter, create, describe, disable, drop, enable, exists, is_disabled, is_enabled, list Group name: dml Commands: count, delete, deleteall, get, get_counter, incr, put, scan, truncate Group name: tools Commands: assign, balance_switch, balancer, close_region, compact, flush, major_compact, move, split, unassign, zk_dump Group name: replication Commands: add_peer, disable_peer, enable_peer, remove_peer, start_replication, stop_replication SHELL USAGE: Quote all names in HBase Shell such as table and column names. Commas delimit command parameters. Type <RETURN> after entering a command to run it. Dictionaries of configuration used in the creation and alteration of tables are Ruby Hashes. They look like this: {'key1' => 'value1', 'key2' => 'value2', ...} and are opened and closed with curley-braces. Key/values are delimited by the '=>' character combination. Usually keys are predefined constants such as NAME, VERSIONS, COMPRESSION, etc. Constants do not need to be quoted. Type 'Object.constants' to see a (messy) list of all constants in the environment. If you are using binary keys or values and need to enter them in the shell, use double-quote'd hexadecimal representation. For example: hbase> get 't1', "key\x03\x3f\xcd" hbase> get 't1', "key\003\023\011" hbase> put 't1', "test\xef\xff", 'f1:', "\x01\x33\x40" The HBase shell is the (J)Ruby IRB with the above HBase-specific commands added. For more on the HBase Shell, see hbase(main):002:0> status 3 servers, 0 dead, 0.0000 average load hbase(main):003:0> version 0.90.4, r1150278, Sun Jul 24 15:53:29 PDT 2011 hbase(main):004:0>