這是hbase 從0.9.x升級到1.x后HMaster與HRegionServer端口沖突問題
在hbase升級到1.0.0版本后,默認端口做了改動。其中16020端口是hmaster服務和hregionserver服務各自使用的默認端口,導致端口沖突。
官方文檔相關信息如下
The HMaster server controls the HBase cluster. You can start up to 9 backup HMaster servers, which makes 10 total HMasters, counting the primary. To start a backup HMaster, use the local-master-backup.sh. For each backup master you want to start, add a parameter representing the port offset for that master. Each HMaster uses three ports (16010, 16020, and 16030 by default). The port offset is added to these ports, so using an offset of 2, the backup HMaster would use ports 16012, 16022, and 16032. The following command starts 3 backup servers using ports 16012/16022/16032, 16013/16023/16033, and 16015/16025/16035.
The HRegionServer manages the data in its StoreFiles as directed by the HMaster. Generally, one HRegionServer runs per node in the cluster. Running multiple HRegionServers on the same system can be useful for testing in
pseudo-distributed mode. The local-regionservers.sh command allows you to run multiple RegionServers. It works in a similar way to the local-master-backup.sh command, in that each parameter you provide represents the port offset for an instance. Each RegionServer requires two ports, and the default ports are 16020 and 16030. However, the base ports for additional RegionServers are not the default ports since the default ports are used by the HMaster, which is also a RegionServer since HBase version 1.0.0. The base ports are 16200 and 16300 instead. You can run 99 additional RegionServers that are not a HMaster or backup HMaster, on a server. The following command starts four additional RegionServers, running on sequential ports starting at 16202/16302 (base ports 16200/16300 plus 2).
解決方法:
按理說不使用默認配置,定義自己的端口配置就可以解決該問題
<property>
<name>hbase.master.port</name>
<value>16000</value>
</property>
<property>
<name>hbase.master.info.port</name>
<value>16010</value>
</property>
<property>
<name>hbase.regionserver.port</name>
<value>16201</value>
</property>
<property>
<name>hbase.regionserver.info.port</name>
<value>16301</value>
</property>
但是實際上 使用start-hbase.sh 腳本啟動regionserver還是會報端口沖突問題,可能通過這個腳本啟動程序存在問題。沒有深究看源碼。
該問題可以通過 使用單獨的regionserver啟動腳本程序啟動regionserver來規避。
使用方法:
bin/local-regionservers.sh start 1
部分轉載自:http://blog.csdn.net/xishanxinyue/article/details/45874063
