可以看出,这台regionserver机器启动成功了,但是RPC的监听ip地址却是本机的地址(127.0.0.1)。这样的话,master机器就无法与这台regionserver正常通信了,正确的监听地址应该是10.131.18.3才对。
查看代码,RPC监听地址的代码如下:
/** @return Bind address */
public String getBindAddress() {
final InetAddress addr = address.getAddress();
if (addr != null) {
return addr.getHostAddress();
} else {
LogFactory. getLog(HServerAddress.class).error( "Could not resolve the"
+ " DNS name of " + stringValue );
return null;
}
}
代码没有错,看来是机器的某些配置导致java读取本机的ip地址出现了错误。最后查看这台机器的hosts文件:
[hadoop@hp2 logs]$ vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 hp2 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.131.18.8 dell1
10.131.18.5 dell2
10.131.18.6 dell3
10.131.18.7 dell4
10.131.18.2 hp1
10.131.18.3 hp2
10.131.18.4 hp3
问题找到了,其实是hosts文件的配置原因,接下来修改hosts文件为如下:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.131.18.8 dell1
10.131.18.5 dell2
10.131.18.6 dell3
10.131.18.7 dell4
10.131.18.2 hp1
10.131.18.3 hp2
10.131.18.4 hp3
再次启动整个集群,问题解决。
更多关于HBase的文章,可以参考:?Where=Nkey&Keyword=HBase