0

J'essaie d'exécuter un serveur Eureka dans AWS.Le serveur Eureka ne peut pas détecter AWS

J'ai créé une application Springboot annotée avec @EnableEurekaServer mais à chaque fois que l'application a commencé en AWS je reçu le message de journal suivant:

2017-03-29 04:11:39.886 INFO 19046 --- [  Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false 

Craignant que je l'avais fait quelque chose de mal dans mon application, j'ai essayé le Eureka Spring échantillon de nuage de https://github.com/spring-cloud-samples/eureka.git

J'ai exactement le même problème - même si je cours sur une instance EC2, Eureka ne parvient pas à détecter cela.

Le serveur lui-même démarre mais ignore toutes les configurations spécifiques à AWS telles que la liaison EIP.

est ici la sortie complète du journal de l'exécution mvn clean spring-boot:run

[INFO] --- spring-boot-maven-plugin:1.4.3.RELEASE:run (default-cli) @ eureka --- 
2017-03-29 04:17:16.178 INFO 19466 --- [   main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]1a19b36d: startup date [Wed Mar 29 04:17:16 UTC 2017]; root of context hierarchy 
2017-03-29 04:17:16.575 INFO 19466 --- [   main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 
2017-03-29 04:17:16.607 INFO 19466 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$2d153893] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 

    . ____   _   __ _ _ 
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \ 
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 
\\/ ___)| |_)| | | | | || (_| | )))) 
    ' |____| .__|_| |_|_| |_\__, |//// 
=========|_|==============|___/=/_/_/_/ 
:: Spring Boot ::  (v1.4.3.RELEASE) 

2017-03-29 04:17:16.927 INFO 19466 --- [   main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888 
2017-03-29 04:17:17.006 WARN 19466 --- [   main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/eureka/default": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused) 
2017-03-29 04:17:17.007 INFO 19466 --- [   main] eurekademo.EurekaApplication    : No active profile set, falling back to default profiles: default 
2017-03-29 04:17:17.020 INFO 19466 --- [   main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]5a6e74a7: startup date [Wed Mar 29 04:17:17 UTC 2017]; parent: org.spring[email protected]1a19b36d 
2017-03-29 04:17:17.715 WARN 19466 --- [   main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 
2017-03-29 04:17:17.852 INFO 19466 --- [   main] o.s.cloud.context.scope.GenericScope  : BeanFactory id=512ba4fc-847f-3775-a8eb-3c9786c9462f 
2017-03-29 04:17:17.899 INFO 19466 --- [   main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 
2017-03-29 04:17:17.931 INFO 19466 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$2d153893] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2017-03-29 04:17:18.149 INFO 19466 --- [   main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8761 (http) 
2017-03-29 04:17:18.159 INFO 19466 --- [   main] o.apache.catalina.core.StandardService : Starting service Tomcat 
2017-03-29 04:17:18.160 INFO 19466 --- [   main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.6 
2017-03-29 04:17:18.246 INFO 19466 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]  : Initializing Spring embedded WebApplicationContext 
2017-03-29 04:17:18.247 INFO 19466 --- [ost-startStop-1] o.s.web.context.ContextLoader   : Root WebApplicationContext: initialization completed in 1227 ms 
2017-03-29 04:17:18.608 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'metricsFilter' to: [/*] 
2017-03-29 04:17:18.608 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 
2017-03-29 04:17:18.608 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 
2017-03-29 04:17:18.608 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 
2017-03-29 04:17:18.609 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 
2017-03-29 04:17:18.609 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webRequestTraceFilter' to: [/*] 
2017-03-29 04:17:18.609 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'servletContainer' to urls: [/eureka/*] 
2017-03-29 04:17:18.609 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*] 
2017-03-29 04:17:18.609 INFO 19466 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 
2017-03-29 04:17:18.677 INFO 19466 --- [ost-startStop-1] c.s.j.s.i.a.WebApplicationImpl   : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM' 
2017-03-29 04:17:18.732 INFO 19466 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson 
2017-03-29 04:17:18.733 INFO 19466 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson 
2017-03-29 04:17:18.819 INFO 19466 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml 
2017-03-29 04:17:18.820 INFO 19466 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml 
2017-03-29 04:17:19.119 INFO 19466 --- [   main] o.s.c.n.eureka.InstanceInfoFactory  : Setting initial instance status as: STARTING 
2017-03-29 04:17:19.159 INFO 19466 --- [   main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data. 
2017-03-29 04:17:19.167 INFO 19466 --- [   main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1490761039167 with initial instances count: 0 
2017-03-29 04:17:19.231 INFO 19466 --- [   main] c.n.eureka.DefaultEurekaServerContext : Initializing ... 
2017-03-29 04:17:19.233 INFO 19466 --- [   main] c.n.eureka.cluster.PeerEurekaNodes  : Adding new peer nodes [http://localhost:8761/eureka/] 
2017-03-29 04:17:19.339 INFO 19466 --- [   main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson 
2017-03-29 04:17:19.339 INFO 19466 --- [   main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson 
2017-03-29 04:17:19.339 INFO 19466 --- [   main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml 
2017-03-29 04:17:19.339 INFO 19466 --- [   main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml 
2017-03-29 04:17:19.432 INFO 19466 --- [   main] c.n.eureka.cluster.PeerEurekaNodes  : Replica node URL: http://localhost:8761/eureka/ 
2017-03-29 04:17:19.440 INFO 19466 --- [   main] c.n.e.registry.AbstractInstanceRegistry : Finished initializing remote region registries. All known remote regions: [] 
2017-03-29 04:17:19.440 INFO 19466 --- [   main] c.n.eureka.DefaultEurekaServerContext : Initialized 
2017-03-29 04:17:20.003 INFO 19466 --- [   main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot[email protected]5a6e74a7: startup date [Wed Mar 29 04:17:17 UTC 2017]; parent: org.spring[email protected]1a19b36d 
2017-03-29 04:17:20.093 INFO 19466 --- [   main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/lastn],methods=[GET]}" onto public java.lang.String org.springframework.cloud.netflix.eureka.server.EurekaController.lastn(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.Object>) 
2017-03-29 04:17:20.094 INFO 19466 --- [   main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public java.lang.String org.springframework.cloud.netflix.eureka.server.EurekaController.status(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.Object>) 
2017-03-29 04:17:20.096 INFO 19466 --- [   main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 
2017-03-29 04:17:20.096 INFO 19466 --- [   main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 
2017-03-29 04:17:20.125 INFO 19466 --- [   main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 
2017-03-29 04:17:20.125 INFO 19466 --- [   main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 
2017-03-29 04:17:20.158 INFO 19466 --- [   main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 
2017-03-29 04:17:20.562 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/env],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.value(java.util.Map<java.lang.String, java.lang.String>) 
2017-03-29 04:17:20.562 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/env/reset],methods=[POST]}" onto public java.util.Map<java.lang.String, java.lang.Object> org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.reset() 
2017-03-29 04:17:20.564 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.565 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/health || /health.json],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(java.security.Principal) 
2017-03-29 04:17:20.565 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.566 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException 
2017-03-29 04:17:20.566 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/resume || /resume.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke() 
2017-03-29 04:17:20.566 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/pause || /pause.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke() 
2017-03-29 04:17:20.567 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.568 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/refresh || /refresh.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke() 
2017-03-29 04:17:20.569 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String) 
2017-03-29 04:17:20.569 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/env || /env.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.571 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String) 
2017-03-29 04:17:20.571 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.572 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/features || /features.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.574 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.575 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/archaius || /archaius.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.575 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.575 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/restart || /restart.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.restart.RestartMvcEndpoint.invoke() 
2017-03-29 04:17:20.576 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.576 INFO 19466 --- [   main] o.s.b.a.e.mvc.EndpointHandlerMapping  : Mapped "{[/info || /info.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() 
2017-03-29 04:17:20.669 INFO 19466 --- [   main] o.s.ui.freemarker.SpringTemplateLoader : SpringTemplateLoader for FreeMarker: using resource loader [org.springframework.boot[email protected]5a6e74a7: startup date [Wed Mar 29 04:17:17 UTC 2017]; parent: org.spring[email protected]1a19b36d] and template loader path [classpath:/templates/] 
2017-03-29 04:17:20.670 INFO 19466 --- [   main] o.s.w.s.v.f.FreeMarkerConfigurer   : ClassTemplateLoader for Spring macros added to FreeMarker configuration 
2017-03-29 04:17:20.744 WARN 19466 --- [   main] c.n.c.sources.URLConfigurationSource  : No URLs will be polled as dynamic configuration sources. 
2017-03-29 04:17:20.744 INFO 19466 --- [   main] c.n.c.sources.URLConfigurationSource  : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. 
2017-03-29 04:17:20.749 WARN 19466 --- [   main] c.n.c.sources.URLConfigurationSource  : No URLs will be polled as dynamic configuration sources. 
2017-03-29 04:17:20.749 INFO 19466 --- [   main] c.n.c.sources.URLConfigurationSource  : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. 
2017-03-29 04:17:20.816 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Registering beans for JMX exposure on startup 
2017-03-29 04:17:20.823 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Bean with name 'refreshScope' has been autodetected for JMX exposure 
2017-03-29 04:17:20.824 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Bean with name 'environmentManager' has been autodetected for JMX exposure 
2017-03-29 04:17:20.826 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure 
2017-03-29 04:17:20.826 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Bean with name 'refreshEndpoint' has been autodetected for JMX exposure 
2017-03-29 04:17:20.827 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Bean with name 'restartEndpoint' has been autodetected for JMX exposure 
2017-03-29 04:17:20.829 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager] 
2017-03-29 04:17:20.840 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Located managed bean 'restartEndpoint': registering with JMX server as MBean [org.springframework.cloud.context.restart:name=restartEndpoint,type=RestartEndpoint] 
2017-03-29 04:17:20.849 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope] 
2017-03-29 04:17:20.856 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=5a6e74a7,type=ConfigurationPropertiesRebinder] 
2017-03-29 04:17:20.861 INFO 19466 --- [   main] o.s.j.e.a.AnnotationMBeanExporter  : Located managed bean 'refreshEndpoint': registering with JMX server as MBean [org.springframework.cloud.endpoint:name=refreshEndpoint,type=RefreshEndpoint] 
2017-03-29 04:17:21.053 INFO 19466 --- [   main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0 
2017-03-29 04:17:21.067 INFO 19466 --- [   main] c.n.e.EurekaDiscoveryClientConfiguration : Registering application eureka with eureka with status UP 
2017-03-29 04:17:21.070 INFO 19466 --- [  Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Setting the eureka configuration.. 
2017-03-29 04:17:21.070 INFO 19466 --- [  Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Eureka data center value eureka.datacenter is not set, defaulting to default 
2017-03-29 04:17:21.070 INFO 19466 --- [  Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Eureka environment value eureka.environment is not set, defaulting to test 
2017-03-29 04:17:21.097 INFO 19466 --- [  Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false 
2017-03-29 04:17:21.098 INFO 19466 --- [  Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Initialized server context 
2017-03-29 04:17:21.098 INFO 19466 --- [  Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node 
2017-03-29 04:17:21.098 INFO 19466 --- [  Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 1 
2017-03-29 04:17:21.098 INFO 19466 --- [  Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP 
2017-03-29 04:17:21.105 INFO 19466 --- [  Thread-10] e.s.EurekaServerInitializerConfiguration : Started Eureka Server 
2017-03-29 04:17:21.154 INFO 19466 --- [   main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8761 (http) 
2017-03-29 04:17:21.155 INFO 19466 --- [   main] c.n.e.EurekaDiscoveryClientConfiguration : Updating port to 8761 
2017-03-29 04:17:21.158 INFO 19466 --- [   main] eurekademo.EurekaApplication    : Started EurekaApplication in 5.439 seconds (JVM running for 8.49) 
2017-03-29 04:17:26.523 INFO 19466 --- [nio-8761-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]  : Initializing Spring FrameworkServlet 'dispatcherServlet' 
2017-03-29 04:17:26.523 INFO 19466 --- [nio-8761-exec-1] o.s.web.servlet.DispatcherServlet  : FrameworkServlet 'dispatcherServlet': initialization started 
2017-03-29 04:17:26.534 INFO 19466 --- [nio-8761-exec-1] o.s.web.servlet.DispatcherServlet  : FrameworkServlet 'dispatcherServlet': initialization completed in 11 ms 

Je pense que si isAws était égal à vrai, alors seraient résolus mes problèmes, mais il n'y a pas d'autres détails à ce message pour expliquer pourquoi Eureka pense qu'il ISN ne fonctionne pas dans AWS, même si c'est le cas.

J'ai également essayé de transmettre le paramètre -Deureka.datacenter = cloud sans aucun effet.

Pour tester cela, lancez n'importe quelle instance ec2 (un t2.medium dans mon cas), installez git et maven (java8 devrait déjà être installé), passez à la commande https://github.com/spring-cloud-samples/eureka.git, exécutez l'application sprintboot.

Répondre

1

Alors je l'ai compris. En dehors de la boîte, Springboot Eureka n'inclut pas la dépendance requise pour travailler si elle est dans AWS ou non.

j'ajouté ce qui suit au POM:

<dependency> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-aws-autoconfigure</artifactId> 
     <version>1.2.1.RELEASE</version> 
    </dependency> 

Une fois que je l'avais fait alors Eureka a pu déterminer qu'il était dans AWS.

Notez que je pense que vous pouvez jouer avec cette dépendance - je pense que tout ce qui est requis est la dépendance AWS ec2 com.amazonaws/aws-java-sdk-ec2 mais je n'ai jamais testé cela.