Tomcat启动报错:Name or service not known
Tomcat启动报错:Name or service not known
今天把项目发布到线上Tomcat服务器的时候 使用./start.sh 启动以后,在logs目录中使用tail -f catalina.out的时候
发现报错如下:
Unable to set localhost. This prevents creation of a GUID. Cause was: ecs-b5aa-0001.novalocal: ecs-b5aa-0001.novalocal: Name or service not known
java.net.UnknownHostException: ecs-b5aa-0001.novalocal: ecs-b5aa-0001.novalocal: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
按照经验应该是这个名字ecs-b5aa-0001.novalocal的问题
解决方案:
修改/etc/hosts文件,添加相应配置,问题解决
如下:
127.0.0.1 ecs-b5aa-0001.novalocal
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。