本地机器连接线上hbase集群是发生“java.net.NoRouteToHostException: No route to host”;线上服务起中hbase集群配置region使用的内网域名,本地链接访问时不能正常访问;解决方案是;需要在本地hosts配置对应的解析,或者配置内部的DNS解析。
例:
[root@localhost etc]# chattr -i /etc/resolv.conf [root@localhost etc]# chmod 777 /etc/resolv.conf [root@localhost etc]# vim /etc/resolv.conf 此处在resolv.conf中添加 nameserver xxx.xxx.xxx.xxx 还可以添加一个本地解析服务,解析自己配置的hosts nameserver 本机网关 因为采用自动获取ip的方式,会重写 /etc/resolv.conf 以下是操作是为了/etc/resolv.conf 不可更改,root用户也不行 [root@localhost etc]# chmod 644 /etc/resolv.conf [root@localhost etc]# chattr +i /etc/resolv.conf