关于内网或者本机域名解析导致服务无法正常运行

来源:互联网 发布:js onclick 变量 编辑:程序博客网 时间:2024/05/29 19:53

     本地机器连接线上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还可以添加一个本地解析服务,解析自己配置的hostsnameserver 本机网关因为采用自动获取ip的方式,会重写 /etc/resolv.conf以下是操作是为了/etc/resolv.conf 不可更改,root用户也不行[root@localhost etc]# chmod 644 /etc/resolv.conf[root@localhost etc]# chattr +i /etc/resolv.conf


原创粉丝点击