我正在尝试运行以下vertx教程,但坚持这个例外。
http://www.sczyh30.com/vertx-blueprint-microservice/index.html
我试图只运行单一服务或整个项目异常即将发生。
我缺少任何码头设置?
ov 03, 2016 10:35:55 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
cache-infrastructure_1 | INFO: Succeeded in deploying verticle
inventory-microservice_1 | java.net.UnknownHostException: failed to resolve 'inventory-microservice'. Exceeded max queries per resolve 3
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolverContext.finishResolve(DnsNameResolverContext.java:476)
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolverContext.tryToFinishResolve(DnsNameResolverContext.java:398)
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolverContext$3.operationComplete(DnsNameResolverContext.java:193)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:488)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:102)
inventory-microservice_1 | at io.netty.resolver.dns.DnsQueryContext.setSuccess(DnsQueryContext.java:195)
inventory-microservice_1 | at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:178)
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:694)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
inventory-microservice_1 | at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
inventory-microservice_1 | at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
inventory-microservice_1 | at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
inventory-microservice_1 | at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:93)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:610)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:551)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:465)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:437)
inventory-microservice_1 | at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
inventory-microservice_1 | at java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:4)
经过大量调试后我终于发现最近版本的vertx解决了主机问题。因此,通过此选项,我们可以禁用默认情况下为ON的disableDnsResolver。它对我来说很好用
CMD ["java -Dvertx.disableDnsResolver=true -jar account-microservice-fat.jar -cluster -conf docker.json"]
如果尝试运行以上示例,则需要在everymicroservice的DockerFile中添加-Dvertx.disableDnsResolver = true