nacos1.3初探
Posted 通密全栈
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nacos1.3初探相关的知识,希望对你有一定的参考价值。
好久没用nacos,今天一用,竟然启动不了,报未知主机异常java.net.UnknownHostException: jmenv.tbsite.net。详细的报错如下:
Caused by: java.net.UnknownHostException: jmenv.tbsite.net
at java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:797)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:111)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.alibaba.nacos.common.http.BaseHttpClient.execute(BaseHttpClient.java:45)
at com.alibaba.nacos.common.http.NacosSyncHttpClient.get(NacosSyncHttpClient.java:46)
at com.alibaba.nacos.core.cluster.lookup.AddressServerMemberLookup.syncFromAddressUrl(AddressServerMemberLookup.java:155)
at com.alibaba.nacos.core.cluster.lookup.AddressServerMemberLookup.run(AddressServerMemberLookup.java:101)
121 common frames omitted
查看/etc/hosts文件
[root@instance-8595xzys logs]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.16.5 instance-8595xzys instance-8595xzys.novalocal
[root@instance-8595xzys logs]#
看到,官方本来就有这个问题的解决方案:
https://github.com/alibaba/nacos/issues/2902
很遗憾,是启动模式没设置导致的。
sh startup.sh -m standalone
关注「通密全栈」让你每天进步一点点
以上是关于nacos1.3初探的主要内容,如果未能解决你的问题,请参考以下文章