Приложение Eureka запускается чистым, но браузер получает 404 (приложение не размещается по ожидаемому адресу)? - PullRequest
0 голосов
/ 18 октября 2019

Полный журнал запуска находится ниже. Когда я перехожу к:

http://localhost:8010/eureka

, журнал событий не выводится, поэтому очевидно, что адрес неверный.

...

...

Мой URL, определенный в POM,

eureka.client.serviceUrl.defaultZone = http://localhost:8010/eureka

...

...

ПОЖАЛУЙСТА, ОБРАТИТЕ ВНИМАНИЕ: У меня есть VirtualBox и 2 виртуальных Ethernet-адаптера (которые раньше даже не вызывали проблем ни с одним из приложений Springboot, но это мой первый разработает Eureka)

...

...

Вывод журнала консоли при запуске:

2019-10-18 13:35:29.693  INFO 10428 --- [           main] .p.d.PhotoAppDiscoveryServiceApplication : No active profile set, falling back to default profiles: default
2019-10-18 13:35:30.195  WARN 10428 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2019-10-18 13:35:30.356  INFO 10428 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=829b0077-09b9-383d-8219-ef5903892aeb
2019-10-18 13:35:30.415  INFO 10428 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$cee4ddf2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-10-18 13:35:30.597  INFO 10428 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8010 (http)
2019-10-18 13:35:30.616  INFO 10428 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-10-18 13:35:30.617  INFO 10428 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.26]
2019-10-18 13:35:30.724  INFO 10428 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-10-18 13:35:30.724  INFO 10428 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1019 ms
2019-10-18 13:35:30.799  WARN 10428 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2019-10-18 13:35:30.799  INFO 10428 --- [           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.
2019-10-18 13:35:30.805  INFO 10428 --- [           main] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@166c2c17
2019-10-18 13:35:32.263  INFO 10428 --- [           main] o.s.cloud.commons.util.InetUtils         : Cannot determine local hostname
2019-10-18 13:35:32.470  INFO 10428 --- [           main] c.s.j.s.i.a.WebApplicationImpl           : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM'
2019-10-18 13:35:32.518  INFO 10428 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2019-10-18 13:35:32.519  INFO 10428 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/user/.m2/repository/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2019-10-18 13:35:32.606  INFO 10428 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2019-10-18 13:35:32.606  INFO 10428 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2019-10-18 13:35:32.880  WARN 10428 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2019-10-18 13:35:32.880  INFO 10428 --- [           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.
2019-10-18 13:35:33.005  INFO 10428 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-10-18 13:35:34.458  INFO 10428 --- [           main] o.s.cloud.commons.util.InetUtils         : Cannot determine local hostname
2019-10-18 13:35:34.550  INFO 10428 --- [           main] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2019-10-18 13:35:34.568  INFO 10428 --- [           main] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2019-10-18 13:35:34.568  INFO 10428 --- [           main] com.netflix.discovery.DiscoveryClient    : Client configured to neither register nor query for data.
2019-10-18 13:35:34.573  INFO 10428 --- [           main] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1571416534572 with initial instances count: 0
2019-10-18 13:35:34.595  INFO 10428 --- [           main] c.n.eureka.DefaultEurekaServerContext    : Initializing ...
2019-10-18 13:35:34.596  WARN 10428 --- [           main] c.n.eureka.cluster.PeerEurekaNodes       : The replica size seems to be empty. Check the route 53 DNS Registry
2019-10-18 13:35:34.606  INFO 10428 --- [           main] c.n.e.registry.AbstractInstanceRegistry  : Finished initializing remote region registries. All known remote regions: []
2019-10-18 13:35:34.607  INFO 10428 --- [           main] c.n.eureka.DefaultEurekaServerContext    : Initialized
2019-10-18 13:35:34.615  INFO 10428 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2019-10-18 13:35:34.669  INFO 10428 --- [           main] o.s.c.n.e.s.EurekaServiceRegistry        : Registering application DISCOVERYSERVICE with eureka with status UP
2019-10-18 13:35:34.671  INFO 10428 --- [      Thread-10] o.s.c.n.e.server.EurekaServerBootstrap   : Setting the eureka configuration..
2019-10-18 13:35:34.673  INFO 10428 --- [      Thread-10] o.s.c.n.e.server.EurekaServerBootstrap   : Eureka data center value eureka.datacenter is not set, defaulting to default
2019-10-18 13:35:34.673  INFO 10428 --- [      Thread-10] o.s.c.n.e.server.EurekaServerBootstrap   : Eureka environment value eureka.environment is not set, defaulting to test
2019-10-18 13:35:34.680  INFO 10428 --- [      Thread-10] o.s.c.n.e.server.EurekaServerBootstrap   : isAws returned false
2019-10-18 13:35:34.681  INFO 10428 --- [      Thread-10] o.s.c.n.e.server.EurekaServerBootstrap   : Initialized server context
2019-10-18 13:35:34.681  INFO 10428 --- [      Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl    : Got 1 instances from neighboring DS node
2019-10-18 13:35:34.681  INFO 10428 --- [      Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl    : Renew threshold is: 1
2019-10-18 13:35:34.681  INFO 10428 --- [      Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl    : Changing status to UP
2019-10-18 13:35:34.689  INFO 10428 --- [      Thread-10] e.s.EurekaServerInitializerConfiguration : Started Eureka Server
2019-10-18 13:35:34.703  INFO 10428 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8010 (http) with context path ''
2019-10-18 13:35:34.704  INFO 10428 --- [           main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8010
2019-10-18 13:35:34.706  INFO 10428 --- [           main] .p.d.PhotoAppDiscoveryServiceApplication : Started PhotoAppDiscoveryServiceApplication in 7.989 seconds (JVM running for 8.689)
2019-10-18 13:35:36.892  INFO 10428 --- [on(1)-127.0.0.1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-10-18 13:35:36.892  INFO 10428 --- [on(1)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2019-10-18 13:35:36.903  INFO 10428 --- [on(1)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 11 ms

Мое приложение:

@SpringBootApplication
@EnableEurekaServer // "stands up a registry that other applications can talk to" https://spring.io/guides/gs/service-registration-and-discovery/
public class PhotoAppDiscoveryServiceApplication {


    public static void main(String[] args) {
        SpringApplication.run(PhotoAppDiscoveryServiceApplication.class, args);
    }

}

My application.properties:

server.port=8010
spring.application.name=discoveryservice
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
eureka.client.serviceUrl.defaultZone = http://localhost:8010/eureka

1 Ответ

0 голосов
/ 18 октября 2019

DefaultZone http://localhost:8010 не содержит панель мониторинга.

http://localhost:8010 содержит панель управления.

http://localhost:8010/eureka - это URL-адрес для обнаруженияСервисные реплики. В этом примере есть только один экземпляр Eureka, и это его адрес.

https://cloud.spring.io/spring-cloud-netflix/multi/multi__service_discovery_eureka_clients.html

...