在tomcat生成端口(动态端口)之前在端口0上发现注册服务

时间:2019-11-16 10:40:14

标签: java spring-boot netflix-eureka spring-cloud-config service-discovery

我有一个使用两个伪客户端接口的服务,并且此问题仅在没有伪客户端的服务中发生。

问题:Eureka Discovery正在使用tomcat生成动态端口(server:port:$ {PORT:0})之前使用端口'0'初始化服务。

日志:

c.netflix.config.ChainedDynamicProperty  : Flipping property: localhost.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
c.n.u.concurrent.ShutdownEnabledTimer    : Shutdown hook installed for: NFLoadBalancer-PingTimer-localhost
c.netflix.loadbalancer.BaseLoadBalancer  : Client: localhost instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=localhost,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
c.n.l.DynamicServerListLoadBalancer      : Using serverListUpdater PollingServerListUpdater
o.s.b.d.a.OptionalLiveReloadServer       : Unable to start LiveReload server
o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
com.netflix.discovery.DiscoveryClient    : Disable delta property : false
com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
com.netflix.discovery.DiscoveryClient    : Application is null : false
com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
com.netflix.discovery.DiscoveryClient    : Application version is -1: true
com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
arterDeprecationWarningAutoConfiguration : spring-cloud-starter-eureka is deprecated as of Spring Cloud Netflix 1.4.0, please migrate to spring-cloud-starter-netflix-eureka
com.netflix.discovery.DiscoveryClient    : The response status is 200
com.netflix.discovery.DiscoveryClient    : Starting heartbeat executor: renew interval is: 30
c.n.discovery.InstanceInfoReplicator     : InstanceInfoReplicator onDemand update allowed rate per min is 4
com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1573897107382 with initial instances count: 1
c.n.l.DynamicServerListLoadBalancer      : DynamicServerListLoadBalancer for client localhost initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=localhost,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList@6af5c9c3
o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
o.s.j.e.a.AnnotationMBeanExporter        : Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure
o.s.j.e.a.AnnotationMBeanExporter        : Bean with name 'environmentManager' has been autodetected for JMX exposure
o.s.j.e.a.AnnotationMBeanExporter        : Bean with name 'refreshScope' has been autodetected for JMX exposure
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]
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]
o.s.j.e.a.AnnotationMBeanExporter        : Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=c1e7f7ed,type=ConfigurationPropertiesRebinder]
o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
.d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: isLiveUsingGET_1
.d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: isLiveUsingGET_2
o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 64289 (http) with context path ''
.s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 64289
o.s.c.n.e.s.EurekaServiceRegistry        : Registering application test-service with eureka with status UP
com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1573897108841, current=UP, previous=STARTING]
com.api.webservice.Application           : Started Application in 97.354 seconds (JVM running for 98.565)
com.netflix.discovery.DiscoveryClient    : DiscoveryClient_TEST-SERVICE/test-service:1065450833: registering service...
com.netflix.discovery.DiscoveryClient    : DiscoveryClient_TEST-SERVICE/test-service:1065450833 - registration status: 204

服务启动后的网址:

http://addres.testing.com:0/actuator/info

下面也包含Yaml文件配置:

management:
  security:
    enabled: false

eureka:
  instance:
    instance-id: ${spring.application.name}:${random.int}

  client:
    serviceUrl:
      defaultZone: ${EUREKA_URI:http://localhost:8761/eureka}

ribbon:
  eureka:
    enabled: true
  ConnectTimeout: 10000
  ReadTimeout: 60000

server:  
  port: ${PORT:0}

此问题是间歇性地

请帮忙。

0 个答案:

没有答案