中间件启动报:Causedby:java.net.UnknownHostException: localhost.localdomain: 未知的名称或服务
由 何 善才 在 超过一年 之前添加
环境:专用机 银河麒麟v10+飞腾2000
原因:通过配置管理安装后,启动失败
异常:
iava.net.UnknownHostException:成功启动apusic.service.Muxer-Thread 1] 启动失败11成功启动atjava.net.InetAddress . getLocalHost(InetAddress.java:1506)成功启动localhost.localdomain: localhost.localdomain: 未知的名称或服成功启动atcom.apusic.net.Muxer.startService(Unknown Source)atcom.apusic.service.Service.start(Unknown Source)atsun.reflect.NativeMethodAccessorimpl.invoke0(Native Method)atsun. reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun. reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:4.atjava.lang.reflect.Method.invoke(Method.java:498)atcom.apusic.jmx.MBeanDescriptor.invoke(Unknown Source)atcom.apusic.jmx.DynamicMBeanSupport.invoke(Unknown Source)atcom. sun. jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerIntercer.java:819atcom.sun. jmx. mbeanserver.JmxMBeanServer,invoke(JmxMBeanServer. java:801)atcom.apusic.server.J2EEServer.start(Unknown Source)atcom.apusic.server.J2EEServerat.startup(Unknown Source)com.apusic.server.Main.main(Unknown Source)Causedby:java.net.UnknownHostException: localhost.localdomain: 未知的名称或服务atjava.net.Inet4AddressImpl. lookupAllHostAddr(Native Method)atInetAddresss2.lookupAlHostAddr(InetAddress.java:929)java.net.atjava.net .InetAddress.getAddressesFromNameService(InetAddress.java:1324)atjava.net.InetAddress.getLocalHost(InetAddress.java:1501)13 more
解决:
尝试一:
修改:/etc/hosts文件
执行命令:hostnamectl set-hostname hostname
source /etc/hosts
重启后失败。
尝试二:
执行 命令:hostname ip地址
问题解决。