In standalone mode, we build hbase manager and hbase region manager, ZooKeeper quorum peer on the same jvm, and to finish this mode, we only need to start hbase-master after installing hbase, then we can open rest apis for users in simple way by running hbase-rest service. If we wanna change rest port, update your hbase-site.xml .
<property> <name>hbase.rest.port</name> <value>60050</value> </property>
what we need to pay attention in this mode is that hbase-master start-up will begin hbase-master, hbase-regionmanager and zookeeper quorum together using the same jvm.
In pseudo-distributed mode, we also start hbase-master, hbase-regionmanager and zookeeper quorum in the same server but share the jvm which split up into several ones from the whole. We need to update the hbase-site.xml telling to run in distributed mode, like the belowing:
<property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.rootdir</name> <value>hdfs://myhost:8020/hbase</value> (which refers to hdfs port pointed in core-site.xml) </property>
In this mode, we need to install hbase-regionmanager by ourselves.
$ sudo yum install hbase-regionserver $ sudo service hbase-regionserver start
Certainly hbase-master should be started in advance.
$ sudo service hbase-master start
At last, open thrift for consumers like the following.
$ sudo service hbase-thrift start
Also there is something we need to pay attention is that : ‘Thrift can be run collocated along with the region servers, but should not be collocated with the NameNode or the JobTracker.’
Distributed cluster mode
In this mode, what we need to be in caution is the relations between zookeeper and hbase, it is easy to make mistakes.
We need to start a independent zookeeper service which cloudera recommends us to start it in namenode and hbase-master server. First, we should start zookeeper server, then update the hbase-site.xml as the following :
<property> <name>hbase.zookeeper.quorum</name> <value>hmaster's domain</value> </property>
Then start hbase-master in hmaster, hbase-regionmanager in hslave (we do not need to start hbase-regionmanager in hmaster). Start hbase-thrift in hslave at last.