我正在运行 https://github.com/real-logic/aeron 中的 BasicPublisher/BasicSubscriber 对将它们绑定(bind)到相同的多播组+端口。当它们在同一主机上运行时,它们会连接,但当它们在单独的主机(相同交换机+子网+vlan)上运行时,发布者报告“报价失败,因为发布者未连接到订阅者”。以下是我的配置:
AERON 配对:
java -Daeron.sample.channel="aeron:udp?endpoint=225.10.9.7:4050" \
-Daeron.sample.embeddedMediaDriver=true \
-cp ./aeron-all/build/libs/aeron-all-1.29.1-SNAPSHOT.jar \
io.aeron.samples.BasicPublisher
java -Daeron.sample.channel="aeron:udp?endpoint=225.10.9.7:4050" \
-Daeron.sample.embeddedMediaDriver=true \
-cp ./aeron-all/build/libs/aeron-all-1.29.1-SNAPSHOT.jar \
io.aeron.samples.BasicSubscriber
我在绑定(bind)到同一组+端口的相同主机上运行了 iperf udp 对,我认为这证明了交换机没有阻止多播流量。我希望我只是错误地使用了 Aeron;或者也许还有其他一些我可以检查的网络问题?
IPERF 对:
iperf -c 225.10.9.7 -p 4050 -u -T 32 -t 300 -I 1 -b 1G
[ 3] 46.0-47.0 sec 128 MBytes 1.07 Gbits/sec
…
iperf -s -u -B 225.10.9.7 -p 4050 -I 1 -b 1G
[ 3] 45.0-46.0 sec 128 MBytes 1.07 Gbits/sec 0.001 ms 35/91304 (0.038%)
…
Java:java-1.8.0-openjdk.x86_64
操作系统:Centos7 3.10.0-514.26.2.el7.x86_64
最佳答案
使用多播端点时,还需要在远程时为某些操作系统提供接口(interface)。该接口(interface)可以有一个掩码,以简化子网上所有计算机的配置。例如:
aeron:udp?endpoint=224.0.1.1:40456|interface=192.168.1.4
aeron:udp?endpoint=224.0.1.1:40456|interface=192.168.1.0/24
https://github.com/real-logic/aeron/wiki/Channel-Configuration
关于java - Aeron 基本 pub/sub 对在同一主机上连接,跨主机失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63116623/