Task and node management in cluster

For small clusters, it is recommended designating one node in your cluster as the HBase Master node. On this node, you will typically run the HBase Master and a ZooKeeper quorum peer. These master processes may be collocated with the Hadoop NameNode and JobTracker for small clusters.

Designate the remaining nodes as RegionServer nodes. On each node, runn a RegionServer, which may be collocated with a Hadoop TaskTracker (MRv1) and a DataNode. When co-locating with TaskTrackers, be sure that the resources of the machine are not oversubscribed – it’s safest to start with a small number of MapReduce slots and work up slowly.

The HBase Thrift service is light-weight, and can be run on any node in the cluster.

Class Cluster

A list of ‘host:port’ addresses of HTTP servers operating as a single entity, for example multiple redundant web service gateways.

Field

  • protected String lastHost
  • protected List<String> nodes

Constructor

  • Cluster()
  • Cluster(List<String> nodes)

Method

  • Cluster add(String node)          Add a node to the cluster
  • Cluster add(String name, int port)       Add a node to the cluster
  • boolean isEmpty()
  • Cluster remove(String node)    Remove a node from the cluster
  • Cluster remove(String name, int port) Remove a node from the cluster

Class ClusterStatus

As of release 2.0.0, this will be removed in HBase 3.0.0 Use ClusterMetrics instead.

@InterfaceAudience.Public

@Deprecated

public class ClusterStatus

extends Object

implements ClusterMetrics

Status information on the HBase cluster. ClusterStatus provides clients with information such as:

  • The count and names of region servers in the cluster.
  • The count and names of dead region servers in the cluster.
  • The name of the active master for the cluster.
  • The name(s) of the backup master(s) for the cluster, if they exist.
  • The average cluster load.
  • The number of regions deployed on the cluster.
  • The number of requests since last report.
  • Detailed region server loading and resource usage information, per server and per region.
  • Regions in transition at master
  • The unique cluster ID

ClusterMetrics.Option provides a way to get desired ClusterStatus information. The following codes will get all the cluster information.

// Original version still works

Admin admin = connection.getAdmin();

ClusterStatus status = admin.getClusterStatus();

// or below, a new version which has the same effects

ClusterStatus status = admin.getClusterStatus(EnumSet.allOf(Option.class));

If information about live servers is the only wanted. then codes in the following way:

Admin admin = connection.getAdmin();

ClusterStatus status = admin.getClusterStatus(EnumSet.of(Option.LIVE_SERVERS));

Method

  • List<ServerName> getBackupMasterNames()
  • List<ServerName> getBackupMasters() As of release 2.0.0, this will be removed in HBase 3.0.0 Use getBackupMasterNames() instead.
  • int getBackupMastersSize() As of release 2.0.0, this will be removed in HBase 3.0.0 Use getBackupMasterNames() instead.
  • Boolean getBalancerOn()
  • String getClusterId()
  • List<ServerName> getDeadServerNames()
  • int getDeadServers() As of release 2.0.0, this will be removed in HBase 3.0.0 (HBASE-13656). Use getDeadServerNames().
  • int getDeadServersSize() As of release 2.0.0, this will be removed in HBase 3.0.0 Use getDeadServerNames().
  • String getHBaseVersion()
  • long getLastMajorCompactionTsForRegion(byte[] region) As of release 2.0.0, this will be removed in HBase 3.0.0 Use ClusterMetrics.getLastMajorCompactionTimestamp(byte[]) instead.
  • long getLastMajorCompactionTsForTable(TableName table) As of release 2.0.0, this will be removed in HBase 3.0.0 Use ClusterMetrics.getLastMajorCompactionTimestamp(TableName) instead.
  • Map<ServerName,ServerMetrics> getLiveServerMetrics()
  • ServerLoad getLoad(ServerName sn) As of release 2.0.0, this will be removed in HBase 3.0.0 Use getLiveServerMetrics() instead.
  • ServerName getMaster() As of release 2.0.0, this will be removed in HBase 3.0.0 Use getMasterName() instead.
  • List<String> getMasterCoprocessorNames()
  • String[] getMasterCoprocessors()   As of release 2.0.0, this will be removed in HBase 3.0.0 Use getMasterCoprocessorNames() instead.
  • int getMasterInfoPort()
  • ServerName getMasterName() Returns detailed information about the current master ServerName.
  • int getRegionsCount() As of release 2.0.0, this will be removed in HBase 3.0.0 Use ClusterMetrics.getRegionCount().
  • List<org.apache.hadoop.hbase.master.RegionState> getRegionStatesInTransition()
  • int getRequestsCount() As of release 2.0.0, this will be removed in HBase 3.0.0 Use ClusterMetrics.getRequestCount() instead.
  • Collection<ServerName> getServers() As of release 2.0.0, this will be removed in HBase 3.0.0 Use getLiveServerMetrics() instead.
  • List<ServerName> getServersName()
  • int getServersSize() As of release 2.0.0, this will be removed in HBase 3.0.0 Use getLiveServerMetrics().
  • byte getVersion()   As of release 2.0.0, this will be removed in HBase 3.0.0
  • int hashCode()
  • boolean isBalancerOn() As of release 2.0.0, this will be removed in HBase 3.0.0 No flag in 2.0
Share this post
[social_warfare]
Schema definition and HBaseAdmin
Data import and export

Get industry recognized certification – Contact us

keyboard_arrow_up