簡體   English   中英

Quarkus 升級 vertx dns 解析器忽略 kubernetes dns

[英]Quarkus upgrade vertx dns resolver ignoring kubernetes dns

我已經將quarkus的版本升級到2.8.0.CR1

我的 quarkus 應用程序混合使用了 camel、mutiny、resteasy、mongo、pubsub,而且似乎已經在所有應用程序上都被復制了。

與此同時,似乎對 vertx 進行了升級,引入了替代 dns 解析器。

然而問題是,當我現在嘗試通過我的 kubernetes 集群部署我的應用程序時,我遇到了 dns 解析問題。

如果我嘗試按原樣啟動它,則在嘗試連接到我的 spring-cloud-config 服務器(在初始化時)時會出現此故障。 該域無法解析,因為它使用了谷歌公共 dns。

May 06, 2022 7:42:53 AM io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider
WARN: Default DNS servers: [/8.8.8.8:53, /8.8.4.4:53] (Google Public DNS as a fallback)
May 06, 2022 7:42:55 AM io.quarkus.runtime.ApplicationLifecycleManager run
ERROR: Failed to start application (with profile cloud)
java.net.UnknownHostException: Failed to resolve 'config-server.servers.svc.cluster.local'. Exceeded max queries per resolve 4 
    at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1047)
    at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:1000)
    at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:418)
    at io.netty.resolver.dns.DnsResolveContext.onResponse(DnsResolveContext.java:629)
    at io.netty.resolver.dns.DnsResolveContext.access$400(DnsResolveContext.java:66)
    at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:462)
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
    at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
    at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605)
    at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104)
    at io.netty.resolver.dns.DnsQueryContext.trySuccess(DnsQueryContext.java:216)
    at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:208)
    at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:1314)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:97)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:833)

如果我設置-Dvertx.disableDnsResolver=true但是它似乎甚至沒有連接到我的服務器(服務器端沒有收到請求,也沒有讀取配置)


2022-05-06 06:54:24,160 DEBUG [io.net.uti.ResourceLeakDetector] (main) -Dio.netty.leakDetection.level: simple
2022-05-06 06:54:24,161 DEBUG [io.net.uti.ResourceLeakDetector] (main) -Dio.netty.leakDetection.targetRecords: 4
2022-05-06 06:54:24,172 DEBUG [io.net.cha.MultithreadEventLoopGroup] (main) -Dio.netty.eventLoopThreads: 2
2022-05-06 06:54:24,181 DEBUG [io.net.uti.int.InternalThreadLocalMap] (main) -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
2022-05-06 06:54:24,181 DEBUG [io.net.uti.int.InternalThreadLocalMap] (main) -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
2022-05-06 06:54:24,184 DEBUG [io.net.cha.nio.NioEventLoop] (main) -Dio.netty.noKeySetOptimization: false
2022-05-06 06:54:24,184 DEBUG [io.net.cha.nio.NioEventLoop] (main) -Dio.netty.selectorAutoRebuildThreshold: 512
2022-05-06 06:54:24,188 DEBUG [io.net.uti.int.PlatformDependent] (main) org.jctools-core.MpscChunkedArrayQueue: available
2022-05-06 06:54:24,478 DEBUG [io.qua.spr.clo.con.cli.run.VertxSpringCloudConfigGateway] (main) Attempting to read configuration from 'http://config-server.servers.svc.cluster.local:8888/my-camel-service/cloud'.
2022-05-06 06:54:24,560 DEBUG [io.net.uti.NetUtil] (main) -Djava.net.preferIPv4Stack: false
2022-05-06 06:54:24,560 DEBUG [io.net.uti.NetUtil] (main) -Djava.net.preferIPv6Addresses: false
2022-05-06 06:54:24,561 DEBUG [io.net.uti.NetUtilInitializations] (main) Loopback interface: lo (lo, 127.0.0.1)
2022-05-06 06:54:24,562 DEBUG [io.net.uti.NetUtil] (main) /proc/sys/net/core/somaxconn: 1024
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.numHeapArenas: 2
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.numDirectArenas: 2
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.pageSize: 8192
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.maxOrder: 3
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.chunkSize: 65536
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.smallCacheSize: 256
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.normalCacheSize: 64
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.maxCachedBufferCapacity: 32768
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.cacheTrimInterval: 8192
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.cacheTrimIntervalMillis: 0
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.useCacheForAllThreads: true
2022-05-06 06:54:24,779 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-1) -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
2022-05-06 06:54:24,859 DEBUG [io.net.buf.ByteBufUtil] (vert.x-eventloop-thread-1) -Dio.netty.allocator.type: pooled
2022-05-06 06:54:24,859 DEBUG [io.net.buf.ByteBufUtil] (vert.x-eventloop-thread-1) -Dio.netty.threadLocalDirectBufferSize: 0
2022-05-06 06:54:24,859 DEBUG [io.net.buf.ByteBufUtil] (vert.x-eventloop-thread-1) -Dio.netty.maxThreadLocalCharBufferSize: 16384
2022-05-06 06:54:25,056 DEBUG [io.net.buf.AbstractByteBuf] (vert.x-eventloop-thread-1) -Dio.netty.buffer.checkAccessible: true
2022-05-06 06:54:25,056 DEBUG [io.net.buf.AbstractByteBuf] (vert.x-eventloop-thread-1) -Dio.netty.buffer.checkBounds: true
2022-05-06 06:54:25,056 DEBUG [io.net.uti.ResourceLeakDetectorFactory] (vert.x-eventloop-thread-1) Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@7e719269
2022-05-06 06:54:25,180 DEBUG [io.net.uti.Recycler] (vert.x-eventloop-thread-1) -Dio.netty.recycler.maxCapacityPerThread: 4096
2022-05-06 06:54:25,181 DEBUG [io.net.uti.Recycler] (vert.x-eventloop-thread-1) -Dio.netty.recycler.ratio: 8
2022-05-06 06:54:25,181 DEBUG [io.net.uti.Recycler] (vert.x-eventloop-thread-1) -Dio.netty.recycler.chunkSize: 32
2022-05-06 06:54:25,181 DEBUG [io.net.uti.Recycler] (vert.x-eventloop-thread-1) -Dio.netty.recycler.blocking: false
2022-05-06 06:54:26,563 DEBUG [io.net.buf.PoolThreadCache] (vert.x-eventloop-thread-1) Freed 2 thread-local buffer(s) from thread: vert.x-eventloop-thread-1

如果我使用以前版本的 quarkus 啟動應用程序,我會得到:



2022-05-06 07:21:16,937 DEBUG [io.net.uti.int.PlatformDependent] (main) org.jctools-core.MpscChunkedArrayQueue: available
2022-05-06 07:21:16,953 DEBUG [io.net.res.dns.DefaultDnsServerAddressStreamProvider] (main) Default DNS servers: [/10.24.0.10:53] (sun.net.dns.ResolverConfiguration)
2022-05-06 07:21:16,956 DEBUG [io.net.uti.NetUtil] (main) -Djava.net.preferIPv4Stack: false
2022-05-06 07:21:16,956 DEBUG [io.net.uti.NetUtil] (main) -Djava.net.preferIPv6Addresses: false
2022-05-06 07:21:16,957 DEBUG [io.net.uti.NetUtilInitializations] (main) Loopback interface: lo (lo, 127.0.0.1)
2022-05-06 07:21:16,957 DEBUG [io.net.uti.NetUtil] (main) /proc/sys/net/core/somaxconn: 1024
2022-05-06 07:21:17,248 DEBUG [io.qua.spr.clo.con.cli.run.VertxSpringCloudConfigGateway] (main) Attempting to read configuration from 'http://config-server.servers.svc.cluster.local:8888/my-camel-gateway/cloud'.
2022-05-06 07:21:17,541 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-0) -Dio.netty.allocator.numHeapArenas: 2
2022-05-06 07:21:17,541 DEBUG [io.net.buf.PooledByteBufAllocator] (vert.x-eventloop-thread-0) -Dio.netty.allocator.numDirectArenas: 2

有沒有辦法讓它正確使用我的本地 dns 配置?

我設置quarkus.naming.enableJndi=true並且沒有使用-Dvertx.disableDnsResolver並且我的應用程序再次開始使用預期的 dns

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM