在整合spring-boot-admin启动客户端注册时报错 :
Error has been observed at the following site(s):
|_ checkpoint ? Request to GET health [DefaultWebClient]
java.net.UnknownHostException: failed to resolve 'DESKTOP-DHHU94O' after 2 queries
org.springframework.web.reactive.function.client.WebClientRequestException: failed to resolve 'DESKTOP-DHHU94O' after 2 queries ; nested exception is java.net.UnknownHostException: failed to resolve 'DESKTOP-DHHU94O' after 2 queries at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141) ~[spring-webflux-5.3.5.jar:5.3.5]Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):|_ checkpoint ? Request to GET health [DefaultWebClient]
Stack trace:at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141) ~[spring-webflux-5.3.5.jar:5.3.5]at reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:70) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.Mono.subscribe(Mono.java:4099) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onError(MonoFlatMapMany.java:204) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.whenError(FluxRetryWhen.java:224) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxRetryWhen$RetryWhenOtherSubscriber.onError(FluxRetryWhen.java:273) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:413) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:250) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.EmitterProcessor.drain(EmitterProcessor.java:491) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.EmitterProcessor.tryEmitNext(EmitterProcessor.java:299) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:97) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onError(FluxRetryWhen.java:189) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:189) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect$ClientTransportSubscriber.onError(HttpClientConnect.java:304) ~[reactor-netty-http-1.0.5.jar:1.0.5]at reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:189) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onError(DefaultPooledConnectionProvider.java:181) ~[reactor-netty-core-1.0.5.jar:1.0.5]at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.fail(AbstractPool.java:427) ~[reactor-netty-core-1.0.5.jar:1.0.5]at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.lambda$drainLoop$7(SimpleDequePool.java:382) ~[reactor-netty-core-1.0.5.jar:1.0.5]at reactor.core.publisher.FluxDoOnEach$DoOnEachSubscriber.onError(FluxDoOnEach.java:186) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:189) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnectionAllocator$PooledConnectionInitializer.onError(DefaultPooledConnectionProvider.java:563) ~[reactor-netty-core-1.0.5.jar:1.0.5]at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259) ~[reactor-core-3.4.4.jar:3.4.4]at reactor.netty.transport.TransportConnector$MonoChannelPromise.tryFailure(TransportConnector.java:464) ~[reactor-netty-core-1.0.5.jar:1.0.5]at reactor.netty.transport.TransportConnector.lambda$doResolveAndConnect$6(TransportConnector.java:271) ~[reactor-netty-core-1.0.5.jar:1.0.5]at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:109) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.InetSocketAddressResolver$1.operationComplete(InetSocketAddressResolver.java:62) ~[netty-resolver-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsNameResolver.tryFailure(DnsNameResolver.java:970) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsNameResolver.access$500(DnsNameResolver.java:90) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsNameResolver$5.operationComplete(DnsNameResolver.java:990) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1021) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:966) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:414) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsResolveContext.access$600(DnsResolveContext.java:63) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:463) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsQueryContext.tryFailure(DnsQueryContext.java:225) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.resolver.dns.DnsQueryContext$4.run(DnsQueryContext.java:177) ~[netty-resolver-dns-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:164) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[netty-transport-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.60.Final.jar:4.1.60.Final]at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_161]
Caused by: java.net.UnknownHostException: failed to resolve 'DESKTOP-DHHU94O' after 2 queries
但是在我另一台电脑上却没有该错误,经过排查发现是hosts中没有该ip映射的原因。
首先查看自己电脑的主机名称
cmd中执行hostname
打开hosts添加以下内容
OK