apache / shardingsphere-elasticjob

Distributed scheduled job
Apache License 2.0
8.15k stars 3.29k forks source link

启动时报Temporary failure错误 #131

Closed 091313422 closed 8 years ago

091313422 commented 8 years ago

[ERROR] 2016-09-07 15:37:24,354 --main-- [org.apache.zookeeper.server.NIOServerCnxnFactory] Thread Thread[main,5,main] died org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.dangdang.ddframe.job.spring.schedule.SpringJobScheduler#0': Invocation of init method failed; nested exception is com.dangdang.ddframe.job.exception.JobException: java.net.UnknownHostException: eplatmgmtbak: eplatmgmtbak: Temporary failure in name resolution at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:725) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE] at com.dangdang.example.elasticjob.spring.main.SpringJobMain.main(SpringJobMain.java:31) ~[elastic-job-example-1.1.1.jar:na] Caused by: com.dangdang.ddframe.job.exception.JobException: java.net.UnknownHostException: eplatmgmtbak: eplatmgmtbak: Temporary failure in name resolution at com.dangdang.ddframe.job.internal.env.LocalHostService.getLocalHost(LocalHostService.java:103) ~[elastic-job-core-1.1.1.jar:na] at com.dangdang.ddframe.job.internal.env.LocalHostService.getHostName(LocalHostService.java:95) ~[elastic-job-core-1.1.1.jar:na] at com.dangdang.ddframe.job.internal.server.ServerService.persistServerOnline(ServerService.java:57) ~[elastic-job-core-1.1.1.jar:na] at com.dangdang.ddframe.job.internal.schedule.SchedulerFacade.registerStartUpInfo(SchedulerFacade.java:83) ~[elastic-job-core-1.1.1.jar:na] at com.dangdang.ddframe.job.internal.executor.JobExecutor.init(JobExecutor.java:88) ~[elastic-job-core-1.1.1.jar:na] at com.dangdang.ddframe.job.api.JobScheduler.init(JobScheduler.java:59) ~[elastic-job-core-1.1.1.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_75] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_75] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1696) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1635) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE] ... 12 common frames omitted Caused by: java.net.UnknownHostException: eplatmgmtbak: eplatmgmtbak: Temporary failure in name resolution at java.net.InetAddress.getLocalHost(InetAddress.java:1473) ~[na:1.7.0_75] at com.dangdang.ddframe.job.internal.env.LocalHostService.getLocalHost(LocalHostService.java:101) ~[elastic-job-core-1.1.1.jar:na]

terrymanu commented 8 years ago

hosts文件设置的有问题吧?

terrymanu commented 8 years ago

长期未更新反馈,怀疑是hosts文件配置问题,如有问题请reopen后再讨论

091313422 commented 8 years ago

确实是hosts文件的问题,centos的hosts与network主机名称不一致造成的,谢谢了