在linux系统下部署Java产品的集群环境时,后台报出如下异常,系统报找不到名为“iZbp18ie9kfhwdt5s8sxyyZ”的主机:
java.net.UnknownHostException: iZbp18ie9kfhwdt5s8sxyyZ: iZbp18ie9kfhwdt5s8sxyyZ: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)[:1.8.0_131]
at io.fabric8.insight.log.support.LogQuerySupport.<init>(LogQuerySupport.java:55)[insight-log-core-1.2.0.Beta4.jar:1.2.0.Beta4]
at io.fabric8.insight.log.log4j.Log4jLogQuery.<init>(Log4jLogQuery.java:72)[insight-log4j-1.2.0.Beta4.jar:1.2.0.Beta4]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_131]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_131]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_131]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_131]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1092)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1044)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)[spring-beans-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)[spring-context-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)[spring-context-4.1.8.RELEASE.jar:4.1.8.RELEASE]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-3.18.jar:3.18]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-3.18.jar:3.18]
at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.13.0.jar:5.13.0]
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.13.0.jar:5.13.0]
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.13.0.jar:5.13.0]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.13.0.jar:5.13.0]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.13.0.jar:5.13.0]
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.13.0.jar:5.13.0]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.13.0.jar:5.13.0]
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.13.0.jar:5.13.0]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.13.0.jar:5.13.0]
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.13.0.jar:5.13.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_131]
at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.13.0]
at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.13.0]
修改 /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 iZbp18ie9kfhwdt5s8sxyyZ
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
iZbp18ie9kfhwdt5s8sxyyZ 172.16.243.15