Keycloak(Wildfly/Infinispan) in HA mode - issue in detecting other machines in the cluster

▼魔方 西西 提交于 2021-01-28 09:10:10

问题


As a result, when I put the machines under an ELB, the login doesn't work. I have tried TCP and UDP for IP casting. Tried using TCPPING instead of MPING (although not sure whether I used them correctly). Infinispan is being used for distributed caching. Here is the default configuration, followed by the changes I had made:

<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>

Changed to TCP, and in TCP stack, removed MPING to add 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>

How can I further debug the deployment?


回答1:


This is how I debugged it:

  • Make sure that jgroups-tcp and jgroups-tcp-fd is listening to public interface, and not private interface. These properties are in standalone/configurations/standalone-ha.xml.

  • While starting the the instances of your cluster via bin/standalone.sh | bin/standalone.bat make sure you pass -b <public interface IP> and not 0.0.0.0 (all interfaces). To find the public interface IP, run the following command:

    ifconfig eth0 | grep -i mask | awk '{print $2}'| cut -f2 -d:

  • When you start the first instance (should be the instance you passed in initial_hosts property; you can try telnet <IP> 7600 to test if your TCPPING is working or not. It should work for cluster discovery.



来源:https://stackoverflow.com/questions/62673917/keycloakwildfly-infinispan-in-ha-mode-issue-in-detecting-other-machines-in-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!