我已经在EC2上安装了MiniKube。微服务正在互相交谈。但是,当其中一个尝试致电外部服务说-Speech.googleapis.com时,我在Pod中遇到以下错误:
2019-06-04 06:59:46 [grpc-default-executor-0] [WARN ] [i.g.i.ManagedChannelImpl$NameResolverListenerImpl.onError 1323] : [Channel<1>: (speech.googleapis.com:443)] Failed to resolve name. status=Status{code=UNAVAILABLE, description=Unable to resolve host speech.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: speech.googleapis.com
at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:399)
at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:269)
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:225)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.UnknownHostException: speech.googleapis.com
at java.net.InetAddress.getAllByName0(InetAddress.java:1281)
at java.net.InetAddress.getAllByName(InetAddress.java:1193)
at java.net.InetAddress.getAllByName(InetAddress.java:1127)
at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:624)
at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:367)
... 5 more
}
Same在Google Kubernetes Engine上完美运行。