gpt4 book ai didi

Vert.x Infinispan 获取 "failed sending discovery request to/228.6.7.8:46655"

转载 作者:行者123 更新时间:2023-12-05 05:57:14 28 4
gpt4 key购买 nike

我在 MacOS 11.3 上运行 Julien Ponge 的书“Vert.x In Action”中的第 3 章 Infinispan 示例。 https://github.com/jponge/vertx-in-action/tree/master/chapter3

public class FirstInstance {
private static final Logger logger = LoggerFactory.getLogger(FirstInstance.class);

public static void main(String[] args) {
Vertx.clusteredVertx(new VertxOptions(), ar -> {
if (ar.succeeded()) {
logger.info("First instance has been started");
Vertx vertx = ar.result();
vertx.deployVerticle("chapter3.HeatSensor", new DeploymentOptions().setInstances(4));
vertx.deployVerticle("chapter3.HttpServer");
} else {
logger.error("Could not start", ar.cause());
}
});
}
}

下载示例代码后,在我做的chapter3文件夹中

./gradlew run -PmainClass=chapter3.cluster.FirstInstance -Pjvmargs="-Djava.net.preferIPv4Stack=true"

这导致

failed sending discovery request to /228.6.7.8:46655

这适用于 Windows。我想知道 MacOS 多播是否存在问题?我尝试按照以下步骤启用多播,但仍然遇到相同的错误:https://blogs.agilefaqs.com/2009/11/08/enabling-multicast-on-your-macos-unix/

完整输出:

News-MacBook-Pro:chapter3f newuser$ ./gradlew run -PmainClass=chapter3.cluster.FirstInstance

> Task :run
DEBUG [main] LoggerFactory - Using io.vertx.core.logging.SLF4JLogDelegateFactory
WARN [vert.x-worker-thread-0] InfinispanClusterManager - Cannot find Infinispan config 'infinispan.xml', using default
WARN [vert.x-worker-thread-0] CONFIG - ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
INFO [vert.x-worker-thread-0] CONTAINER - ISPN000128: Infinispan version: Infinispan 'Corona Extra' 11.0.5.Final
INFO [vert.x-worker-thread-0] CLUSTER - ISPN000078: Starting JGroups channel ISPN with stack jgroups
ERROR [jgroups-6,News-MacBook-Pro-2273] MPING - News-MacBook-Pro-2273: failed sending discovery request to /228.6.7.8:46655
java.io.IOException: Can't assign requested address
at java.base/java.net.PlainDatagramSocketImpl.send(Native Method)
at java.base/java.net.DatagramSocket.send(DatagramSocket.java:695)
at org.jgroups.protocols.MPING.sendMcastDiscoveryRequest(MPING.java:286)
at org.jgroups.protocols.PING.sendDiscoveryRequest(PING.java:63)
at org.jgroups.protocols.PING.findMembers(PING.java:31)
at org.jgroups.protocols.Discovery.invokeFindMembers(Discovery.java:217)
at org.jgroups.protocols.Discovery.lambda$findMembers$0(Discovery.java:228)
at org.jgroups.protocols.Discovery$$Lambda$380.000000009D98CA20.run(Unknown Source)
at org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:831)
ERROR [jgroups-6,News-MacBook-Pro-2273] MPING - News-MacBook-Pro-2273: failed sending discovery request to /228.6.7.8:46655
java.io.IOException: Can't assign requested address
at java.base/java.net.PlainDatagramSocketImpl.send(Native Method)
at java.base/java.net.DatagramSocket.send(DatagramSocket.java:695)
at org.jgroups.protocols.MPING.sendMcastDiscoveryRequest(MPING.java:286)
at org.jgroups.protocols.PING.sendDiscoveryRequest(PING.java:63)
at org.jgroups.protocols.PING.findMembers(PING.java:31)
at org.jgroups.protocols.Discovery.invokeFindMembers(Discovery.java:217)
at org.jgroups.protocols.Discovery.lambda$findMembers$0(Discovery.java:228)
at org.jgroups.protocols.Discovery$$Lambda$380.000000009D98CA20.run(Unknown Source)
at org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:831)
ERROR [jgroups-6,News-MacBook-Pro-2273] MPING - News-MacBook-Pro-2273: failed sending discovery request to /228.6.7.8:46655
java.io.IOException: Can't assign requested address
at java.base/java.net.DatagramSocket.send(DatagramSocket.java:695)
at org.jgroups.protocols.MPING.sendMcastDiscoveryRequest(MPING.java:286)
at org.jgroups.protocols.PING.sendDiscoveryRequest(PING.java:63)
at org.jgroups.protocols.PING.findMembers(PING.java:31)
at org.jgroups.protocols.Discovery.invokeFindMembers(Discovery.java:217)
at org.jgroups.protocols.Discovery.lambda$findMembers$0(Discovery.java:228)
at org.jgroups.protocols.Discovery$$Lambda$380.000000009D98CA20.run(Unknown Source)
at org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:831)
INFO [vert.x-worker-thread-0] GMS - News-MacBook-Pro-2273: no members discovered after 2003 ms: creating cluster as coordinator
INFO [vert.x-worker-thread-0] CLUSTER - ISPN000094: Received new cluster view for channel ISPN: [News-MacBook-Pro-2273|0] (1) [News-MacBook-Pro-2273]
INFO [vert.x-worker-thread-0] CLUSTER - ISPN000079: Channel ISPN local address is News-MacBook-Pro-2273, physical addresses are [192.168.0.101:7800]
INFO [vert.x-eventloop-thread-0] FirstInstance - First instance has been starte
INFO [vert.x-eventloop-thread-5] threads - JBoss Threads version 2.3.3.Final
ERROR [jgroups-5,News-MacBook-Pro-2273] MPING - News-MacBook-Pro-2273: failed sending discovery request to /228.6.7.8:46655
java.io.IOException: Can't assign requested address
at java.base/java.net.DatagramSocket.send(DatagramSocket.java:695)
at org.jgroups.protocols.MPING.sendMcastDiscoveryRequest(MPING.java:286)
at org.jgroups.protocols.PING.sendDiscoveryRequest(PING.java:63)
at org.jgroups.protocols.PING.findMembers(PING.java:31)
at org.jgroups.protocols.Discovery.invokeFindMembers(Discovery.java:217)
at org.jgroups.protocols.Discovery.findMembers(Discovery.java:244)
at org.jgroups.protocols.Discovery.down(Discovery.java:387)
at org.jgroups.protocols.MERGE3$InfoSender.run(MERGE3.java:412)
at org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:328)
at org.jgroups.util.TimeScheduler3$RecurringTask.run(TimeScheduler3.java:362)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:831)
ERROR [jgroups-6,News-MacBook-Pro-2273] MPING - News-MacBook-Pro-2273: failed sending discovery request to /228.6.7.8:46655
java.io.IOException: Can't assign requested address
at java.base/java.net.DatagramSocket.send(DatagramSocket.java:695)
at org.jgroups.protocols.MPING.sendMcastDiscoveryRequest(MPING.java:286)
at org.jgroups.protocols.PING.sendDiscoveryRequest(PING.java:63)
at org.jgroups.protocols.PING.findMembers(PING.java:31)
at org.jgroups.protocols.Discovery.invokeFindMembers(Discovery.java:217)
at org.jgroups.protocols.Discovery.findMembers(Discovery.java:244)
at org.jgroups.protocols.Discovery.down(Discovery.java:387)
at org.jgroups.protocols.MERGE3$InfoSender.run(MERGE3.java:412)
at org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:328)
at org.jgroups.util.TimeScheduler3$RecurringTask.run(TimeScheduler3.java:362)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:831)

最佳答案

@tsegismont 提供了有效的答案。 https://gist.github.com/rafaeltuelho/208568668e4205bd9b93

为 224.0.0.1-231.255.255.254 添加多播路由:

sudo route add -net 224.0.0.0/5 127.0.0.1

为 232.0.0.1-239.255.255.254 添加多播路由

sudo route add -net 232.0.0.0/5 192.168.1.3

所以对于 230.0.0.0,我绑定(bind)到 192.168.1.3

关于Vert.x Infinispan 获取 "failed sending discovery request to/228.6.7.8:46655",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68874473/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com