zuul исключение при подключении приложений узла - PullRequest
0 голосов
/ 11 февраля 2019

Мое приложение узла зарегистрировано в eureka, но я получаю следующее исключение в шлюзе API.Я использую модуль узла eureka-js-client.

Причина: java.lang.RuntimeException: java.net.UnknownHostException: utility-api: повторите попытку

at rx.exceptions.Exceptions.propagate(Exceptions.java:58) ~[rxjava-1.1.10.jar!/:1.1.10]


at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:465) ~[rxjava-1.1.10.jar!/:1.1.10]


at rx.observables.BlockingObservable.single(BlockingObservable.java:342) ~[rxjava-1.1.10.jar!/:1.1.10]


at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:117) ~[ribbon-loadbalancer-2.2.2.jar!/:2.2.2]


... 156 common frames omitted

Причина: java.net.UnknownHostException: utility-api: Попробуйте еще раз

at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_111-internal]


at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[na:1.8.0_111-internal]


at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[na:1.8.0_111-internal]


at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[na:1.8.0_111-internal]


at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_111-internal]


at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_111-internal]


at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) ~[httpclient-4.5.3.jar!/:4.5.3]


at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112) ~[httpclient-4.5.3.jar!/:4.5.3]


at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359) ~[httpclient-4.5.3.jar!/:4.5.3]


at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) ~[httpclient-4.5.3.jar!/:4.5.3]


at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) ~[httpclient-4.5.3.jar!/:4.5.3]


at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) ~[httpclient-4.5.3.jar!/:4.5.3]


at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.3.jar!/:4.5.3]

Моя конфигурация клиента eureka

                    const client = new Eureka({
                    //  application instance information 
                    instance: {
                        id: 'utility-api',    
                        instanceId: 'utility-api',
                        app: 'utility-api',
                        hostName: 'utility-api',
                        ipAddr: ip.address(),
                        port: {
                            '$': 8080,
                            '@enabled': true
                        },
                        vipAddress: 'utility-api',
                        statusPageUrl: 'http://'+ip.address()+':8080/info',
                        healthCheckUrl: 'http://'+ip.address()+':8080/info',

                        dataCenterInfo: {
                            '@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo',
                            name: 'utility-api',

                        },

                    },
                    //eureka information
                    eureka: {
                        host: eurekaIp,
                        port: eurekaPort,
                        servicePath: '/eureka/apps',
                        // heartbeatInterval:1000,
                        // registerWithEureka:true
                    },
                });

Я использую Docker для развертывания и приложенияиспользует экспресс-сервер

...