Имя или имя сервера не предоставлены или не известны для Eureka - PullRequest
0 голосов
/ 28 сентября 2019
  • У меня есть настройки ниже серверов.После книги весной облачный микро-сервер в действии.
    1. Сервер Zuul (порт 5555)
    2. Сервер Eureka (порт 8761)
    3. Сервер организации (порт 8081)
  • Сейчас,Я использую этот URL для получения информации с сервера лицензий.localhost: 5555 / api / organizationservice / v1 / organization / 35690f33-71b1-4996-83f8-93b8ca411848 /
  • Этот URL-адрес будет получать информацию с сервера организации через сервер zuul.
  • проблема в том, что вызов не удался и не получил никакой информации от сервера организации.

  • ОС: Macbook

  • Spring boot 2.1.4.RELEASE

  • Эврика

server.port=8761
eureka.server.wait-time-in-ms-when-sync-empty=5
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
  • Организация
server.port=8081
spring.application.name=organizationservice
spring.profiles.active=default
spring.cloud.config.enabled=true
eureka.instance.prefer-ip-address=true
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
spring.cloud.config.uri=http://localhost:8888
logging.level.com.chenlin=debug
  • Зуул
server.port=5555
spring.application.name=zuulservice
eureka.instance.prefer-ip-address=true
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
zuul.prefix=/api
zuul.routes.organizationservice.serviceId=organizationservice
zuul.routes.organizationservice.path=/organization/**
zuul.routes.licenseingservice.serviceId=licenseingservice
zuul.routes.licenseingservice.path=/licenseing/**
management.endpoints.web.exposure.include=routes
logging.level.com.chenlin=debug

журнал с сервера zuul.

com.netflix.zuul.exception.ZuulException: Forwarding error
    at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.handleException(RibbonRoutingFilter.java:198) ~[spring-cloud-netflix-zuul-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:173) ~[spring-cloud-netflix-zuul-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:119) ~[spring-cloud-netflix-zuul-2.1.3.RELEASE.jar:2.1.3.RELEASE]
...
Caused by: com.netflix.client.ClientException: null
    at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:118) ~[ribbon-loadbalancer-2.3.0.jar:2.3.0]
    at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:221) ~[spring-cloud-netflix-zuul-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:55) ~[spring-...
    at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:167) ~[spring-cloud-netflix-zuul-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    ... 64 common frames omitted
Caused by: java.lang.RuntimeException: java.net.UnknownHostException: fe80: nodename nor servname provided, or not known
    at rx.exceptions.Exceptions.propagate(Exceptions.java:57) ~[rxjava-1.3.8.jar:1.3.8]
    at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:463) ~[rxjava-1.3.8.jar:1.3.8]
    at rx.observables.BlockingObservable.single(BlockingObservable.java:340) ~[rxjava-1.3.8.jar:1.3.8]
    at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:112) ~[ribbon-loadbalancer-2.3.0.jar:2.3.0]
    ... 126 common frames omitted
Caused by: java.net.UnknownHostException: fe80: nodename nor servname provided, or not known
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_202]
    at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) ~[na:1.8.0_202]
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) ~[na:1.8.0_202]
    at java.net.InetAddress.getAllByName0(InetAddress.java:1277) ~[na:1.8.0_202]
    at java.net.InetAddress.getAllByName(InetAddress.java:1193) ~[na:1.8.0_202]
    at java.net.InetAddress.getAllByName(InetAddress.java:1127) ~[na:1.8.0_202]
    at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) ~[httpclient-4.5.8.jar:4.5.8]
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112) ~[httpclient-4.5.8.jar:4.5.8]

Использование ниже URL-адреса может определить, что служба организации успешно зарегистрировалась http://localhost:8761/eureka/apps/

{
    "applications": {
        "versions__delta": "1",
        "apps__hashcode": "UP_3_",
        },
            {
                "name": "ORGANIZATIONSERVICE",
                "instance": [
                    {
                        "instanceId": "ZDMdeMacBook-Pro.local:organizationservice:8081",
                        "hostName": "127.0.0.1",
                        "app": "ORGANIZATIONSERVICE",
                        "ipAddr": "127.0.0.1",
                        "status": "UP",
                        "overriddenStatus": "UNKNOWN",
                        "port": {
                            "$": 8081,
                            "@enabled": "true"
                        }
                    }
                ]
            }
        ]
    }
}
...