【发布时间】:2019-03-30 23:53:15
【问题描述】:
我正在我的计算机上运行多播测试,以检查它是否可以与在我的工作场所运行的其他节点交换数据包。我通过 vpn 连接到工作场所网络。在工作场所内测试运行良好,但在我使用 vpn 时却不行。谁能指出我遗漏了什么,是否需要在 VPN 上启用某些特定功能。这是下面的日志:
$ java -cp ./coherence-3.5.1.b461.jar -Djava.net.preferIPv4Stack=true
com.tangosol.net.MulticastTest -group=237.0.0.1:30012 -ttl 4
2018-10-26 04:05:54.303/0.318 Oracle Coherence 3.5.1/461 <Info>
(thread=main, member=n/a): Loaded operational configuration from
resource "jar:file:/coherence-3.5.1.b461.jar!/tangosol-coherence.xml"
2018-10-26 04:05:54.307/0.321 Oracle Coherence 3.5.1/461 <Info>
(thread=main, member=n/a): Loaded operational overrides from resource
"jar:file:/coherence-3.5.1.b461.jar!/tangosol-coherence-override-
dev.xml"
2018-10-26 04:05:54.307/0.321 Oracle Coherence 3.5.1/461 <D5>
(thread=main, member=n/a): Optional configuration override "/tangosol-
coherence-override.xml" is not specified
2018-10-26 04:05:54.309/0.324 Oracle Coherence 3.5.1/461 <D5>
(thread=main, member=n/a): Optional configuration override "/custom-
mbeans.xml" is not specified
Oracle Coherence Version 3.5.1/461
Grid Edition: Development mode
Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights
reserved.
Starting test on ip=C02NK9NJG3QC/10.30.61.25, group=/237.0.0.1:30012,
ttl=4
Configuring multicast socket...
2018-10-26 04:05:54.373/0.387 Oracle Coherence GE 3.5.1/461 <Error>
(thread=main, member=n/a): An exception occurred while executing the
MulticastTest:
2018-10-26 04:05:54.373/0.388 Oracle Coherence GE 3.5.1/461 <Error>
(thread=main, member=n/a): (Wrapped) java.net.SocketException: Can't
assign requested address (Error setting socket option)
at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
at com.tangosol.net.MulticastTest.initSocket(MulticastTest.java:323)
at com.tangosol.net.MulticastTest.run(MulticastTest.java:267)
at com.tangosol.net.MulticastTest.main(MulticastTest.java:126)
Caused by: java.net.SocketException: Can't assign requested address
(Error setting socket option)
at java.net.PlainDatagramSocketImpl.socketSetOption0(Native Method)
at java.net.PlainDatagramSocketImpl.socketSetOption
(PlainDatagramSocketImpl.java:74)
at java.net.AbstractPlainDatagramSocketImpl.setOption
(AbstractPlainDatagramSocketImpl.java:309)
at java.net.MulticastSocket.setInterface(MulticastSocket.java:471)
at com.tangosol.net.MulticastTest.initSocket(MulticastTest.java:315)
... 2 more
2018-10-26 04:05:54.373/0.388 Oracle Coherence GE 3.5.1/461 <Error>
(thread=main, member=n/a):
Exiting MulticastTest
【问题讨论】:
-
虽然这不是问题,但您似乎在不允许使用的保留范围 (
235.0.0.0-238.255.255.255) 中使用多播地址 (237.0.0.1)。您应该在组织本地范围 (239.0.0.0/8) 中使用多播组来处理此类事情。请参阅IPv4 Multicast Address Space Registry。此外,多播路由与单播路由有很大不同,如果您尝试从一个网络多播到另一个网络,则需要对其进行配置。
标签: java caching networking vpn oracle-coherence