Index: src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (版本 1142646) +++ src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (工作副本) @@ -705,9 +705,16 @@ HServerInfo hsiWithoutLoad = new HServerInfo( serverInfo.getServerAddress(), serverInfo.getStartCode(), serverInfo.getInfoPort(), serverInfo.getHostname()); - this.regions.put(regionInfo, hsiWithoutLoad); - addToServers(hsiWithoutLoad, regionInfo); - this.regions.notifyAll(); + + if (isServerOnline(hsiWithoutLoad.getServerName())) { + this.regions.put(regionInfo, hsiWithoutLoad); + addToServers(hsiWithoutLoad, regionInfo); + this.regions.notifyAll(); + } else { + LOG.info("The server is not in online servers, ServerName=" + + hsiWithoutLoad.getServerName() + ", region=" + + regionInfo.getEncodedName()); + } } // Remove plan if one. clearRegionPlan(regionInfo); @@ -2156,4 +2163,11 @@ public void stop() { this.timeoutMonitor.interrupt(); } + + /** + * Check whether the RegionServer is online. + */ + public boolean isServerOnline(String serverName) { + return this.serverManager.isServerOnline(serverName); + } }