结果,当我将机器放在 ELB 下时,登录不起作用。 我已经尝试过TCP和UDP进行IP转换。尝试使用TCPPING而不是MPING(尽管不确定我是否正确使用了它们(。 Infinispan 被用于分布式缓存。 以下是默认配置,然后是我所做的更改:
<subsystem xmlns="urn:jboss:domain:jgroups:7.0">
<channels default="tcp">
<channel name="ee" stack="udp" cluster="ejb"/>
</channels>
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<socket-protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<socket-protocol type="MPING" socket-binding="jgroups-mping"/>
<protocol type="MERGE3"/>
<socket-protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
</stacks>
</subsystem>
更改为 TCP,并在 TCP 堆栈中删除了 MPING 以添加 TCPPING:
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="TCPPING">
<property name="initial_hosts"><IP of VM1>[7600],<IP of VM2>[7600]</property>
<property name="port_range">0</property>
</protocol>
如何进一步调试部署?
这是我调试它的方式:
-
确保
jgroups-tcp
和jgroups-tcp-fd
正在侦听公共接口,而不是专用接口。这些属性在standalone/configurations/standalone-ha.xml
中。 -
通过
bin/standalone.sh | bin/standalone.bat
启动集群实例时,请确保传递-b <public interface IP>
而不是0.0.0.0
(所有接口(。要查找公有接口 IP,请运行以下命令:ifconfig eth0 | grep -i mask | awk '{print $2}'| cut -f2 -d:
-
当您启动第一个实例(应该是您在
initial_hosts
属性中传递的实例(时;您可以尝试telnet <IP> 7600
来测试 TCPPING 是否正常工作。它应该适用于群集发现。