Activemq Artemis无法建立Netty连接

发布于 2025-01-20 09:46:32 字数 5404 浏览 1 评论 0原文

当ActiveMQ Artemis试图建立Netty连接时,我会失败。我显示以下日志。我检查了主机是否可以解析,并且是。我的主人是一个kubernetes豆荚,我正在运行一组4个豆荚

2022-04-11 09:46:30,441 INFO  [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
2022-04-11 09:46:30,485 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
2022-04-11 09:46:30,791 ERROR [org.apache.activemq.artemis.core.client] AMQ214016: Failed to create netty connection: java.net.UnknownHostException: eric-oss-jms-svc-amq-primary-1.eric-oss-jms-svc-amq-primary.liamtest.svc.cluster.local
        at java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:797) [java.base:]
        at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505) [java.base:]
        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364) [java.base:]
        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298) [java.base:]
        at java.base/java.net.InetAddress.getByName(InetAddress.java:1248) [java.base:]
        at io.netty.util.internal.SocketUtils$8.run(SocketUtils.java:156) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.internal.SocketUtils$8.run(SocketUtils.java:153) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at java.base/java.security.AccessController.doPrivileged(Native Method) [java.base:]
        at io.netty.util.internal.SocketUtils.addressByName(SocketUtils.java:153) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.DefaultNameResolver.doResolve(DefaultNameResolver.java:41) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.SimpleNameResolver.resolve(SimpleNameResolver.java:61) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.SimpleNameResolver.resolve(SimpleNameResolver.java:53) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.InetSocketAddressResolver.doResolve(InetSocketAddressResolver.java:55) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.InetSocketAddressResolver.doResolve(InetSocketAddressResolver.java:31) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.AbstractAddressResolver.resolve(AbstractAddressResolver.java:106) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap.doResolveAndConnect0(Bootstrap.java:206) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap.access$000(Bootstrap.java:46) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:180) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:166) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetSuccess(AbstractChannel.java:1008) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:516) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:429) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:486) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.20.0.jar:]

I get a failure when ActiveMQ Artemis attempts to make a Netty connection. I am showing the logs below. I have checked that the host is resolvable and it is. My host is a Kubernetes Pod, and I am running a stateful set of 4 pods

2022-04-11 09:46:30,441 INFO  [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
2022-04-11 09:46:30,485 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
2022-04-11 09:46:30,791 ERROR [org.apache.activemq.artemis.core.client] AMQ214016: Failed to create netty connection: java.net.UnknownHostException: eric-oss-jms-svc-amq-primary-1.eric-oss-jms-svc-amq-primary.liamtest.svc.cluster.local
        at java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:797) [java.base:]
        at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505) [java.base:]
        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364) [java.base:]
        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298) [java.base:]
        at java.base/java.net.InetAddress.getByName(InetAddress.java:1248) [java.base:]
        at io.netty.util.internal.SocketUtils$8.run(SocketUtils.java:156) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.internal.SocketUtils$8.run(SocketUtils.java:153) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at java.base/java.security.AccessController.doPrivileged(Native Method) [java.base:]
        at io.netty.util.internal.SocketUtils.addressByName(SocketUtils.java:153) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.DefaultNameResolver.doResolve(DefaultNameResolver.java:41) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.SimpleNameResolver.resolve(SimpleNameResolver.java:61) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.SimpleNameResolver.resolve(SimpleNameResolver.java:53) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.InetSocketAddressResolver.doResolve(InetSocketAddressResolver.java:55) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.InetSocketAddressResolver.doResolve(InetSocketAddressResolver.java:31) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.resolver.AbstractAddressResolver.resolve(AbstractAddressResolver.java:106) [netty-resolver-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap.doResolveAndConnect0(Bootstrap.java:206) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap.access$000(Bootstrap.java:46) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:180) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.bootstrap.Bootstrap$1.operationComplete(Bootstrap.java:166) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetSuccess(AbstractChannel.java:1008) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:516) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:429) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:486) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503) [netty-transport-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.72.Final.jar:4.1.72.Final]
        at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.20.0.jar:]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与风相奔跑 2025-01-27 09:46:32

java.net.unknownhostexception这里来自JVM本身:

java.base/java.net.InetAddress$CachedAddresses.get

Netty或ActiveMQ Artemis对此无能为力。根据 javadoc

投掷以表明无法确定主机的IP地址。

这个问题几乎可以肯定是环境的,尽管从技术上讲,这也可能是JVM中的错误。

The java.net.UnknownHostException here is coming from the JVM itself:

java.base/java.net.InetAddress$CachedAddresses.get

There's nothing that Netty or ActiveMQ Artemis can do about it. According to the JavaDoc, this exception is:

Thrown to indicate that the IP address of a host could not be determined.

This problem is almost certainly environmental, although technically speaking it might also be a bug in the JVM.

流年里的时光 2025-01-27 09:46:32

尝试使用cmd ping hostName ping主机ping
如果ping不起作用,请执行以下步骤

  1. 配置主机文件中存在的主机,该文件中存在的位置C:\ Windows \ system32 \ drivers \ etc etc

    例如 - 192.168.202.7 test.xyz.com

  2. 在服务器端也这样做。
  3. 重新启动服务器。
  4. 尝试再次使用服务器。

通过遵循上述步骤,此问题将得到解决。

Try to ping the host using cmd ping hostname
If the ping not working do the below steps

  1. Configure the host in the hosts file which is present at the location C:\Windows\System32\drivers\etc
    eg- 192.168.202.7 test.xyz.com
  2. Do the same on the server side as well.
  3. Restart the server.
  4. Try pinging the server again.

By following the above steps this issue will get resolved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文