diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java index 445f80f2731..8f5b6f56f2c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java @@ -1111,8 +1111,12 @@ public abstract class BaseLoadBalancer implements LoadBalancer { private static final Random RANDOM = new Random(System.currentTimeMillis()); private static final Log LOG = LogFactory.getLog(BaseLoadBalancer.class); - // Master carries no regions by default. - private static final String[] DEFAULT_TABLES_ON_MASTER = new String[] {}; + // Regions of these tables are put on the master by default. + private static final String[] DEFAULT_TABLES_ON_MASTER = + new String[] {AccessControlLists.ACL_TABLE_NAME.getNameAsString(), + TableName.NAMESPACE_TABLE_NAME.getNameAsString(), + TableName.META_TABLE_NAME.getNameAsString()}; + public static final String TABLES_ON_MASTER = "hbase.balancer.tablesOnMaster"; @@ -1123,18 +1127,18 @@ public abstract class BaseLoadBalancer implements LoadBalancer { protected MasterServices services; /** - * By default, master carries no regions. This method returns null. - * If you want master to carry system tables say, then set - * TABLES_ON_MASTER to AccessControlLists.ACL_TABLE_NAME.getNameAsString(), - * TableName.NAMESPACE_TABLE_NAME.getNameAsString(), - * TableName.META_TABLE_NAME.getNameAsString() + * By default, regions of some small system tables such as meta, + * namespace, and acl are assigned to the active master. If you don't + * want to assign any region to the active master, you need to + * configure "hbase.balancer.tablesOnMaster" to "none". */ protected static String[] getTablesOnMaster(Configuration conf) { String valueString = conf.get(TABLES_ON_MASTER); if (valueString == null) { return DEFAULT_TABLES_ON_MASTER; } - if (valueString == null || valueString.trim().isEmpty()) { + valueString = valueString.trim(); + if (valueString.equalsIgnoreCase("none")) { return null; } return StringUtils.getStrings(valueString);