首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vert.x Infinispan“向/228.6.7.8:46655发送发现请求失败”

Vert.x Infinispan“向/228.6.7.8:46655发送发现请求失败”
EN

Stack Overflow用户
提问于 2021-08-21 15:39:45
回答 1查看 149关注 0票数 2

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

代码语言:javascript
复制
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文件夹中这样做了

代码语言:javascript
复制
./gradlew run -PmainClass=chapter3.cluster.FirstInstance -Pjvmargs="-Djava.net.preferIPv4Stack=true"

这会导致

代码语言:javascript
复制
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/

完整输出:

代码语言:javascript
复制
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)
EN

回答 1

Stack Overflow用户

发布于 2021-08-28 09:39:05

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

添加224.0.0.1-231.255.255.254的组播路由:

代码语言:javascript
复制
sudo route add -net 224.0.0.0/5 127.0.0.1

为232.0.0.1-239.255.255.254添加组播路由

代码语言:javascript
复制
sudo route add -net 232.0.0.0/5 192.168.1.3

因此,对于230.0.0.0,我绑定到192.168.1.3

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68874473

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档