HA模式下的Keycloak(Wildfly/Infinispan)-在检测群集中的其他计算机时出现问题 [英] Keycloak(Wildfly/Infinispan) in HA mode - issue in detecting other machines in the cluster

查看:93
本文介绍了HA模式下的Keycloak(Wildfly/Infinispan)-在检测群集中的其他计算机时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

结果,当我将计算机放在ELB下时,登录不起作用. 我已经尝试使用TCP和UDP进行IP转换.尝试使用TCPPING代替MPING(尽管不确定我是否正确使用了它们). Infinispan用于分布式缓存. 这是默认配置,然后是我所做的更改:

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>

更改为TCP,并在TCP堆栈中,删除了MPING以添加TCPPING:

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>

如何进一步调试部署?

推荐答案

这是我对其进行调试的方式:

This is how I debugged it:

  • 确保jgroups-tcpjgroups-tcp-fd正在侦听公共接口,而不是私有接口.这些属性在standalone/configurations/standalone-ha.xml中.

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

在通过bin/standalone.sh | bin/standalone.bat启动集群实例时,请确保您传递-b <public interface IP>而不是0.0.0.0(所有接口).要查找公共接口IP,请运行以下命令:

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:

启动第一个实例时(应该是您在initial_hosts属性中传递的实例;您可以尝试telnet <IP> 7600来测试TCPPING是否正常工作.它应该可以用于群集发现. >

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.

这篇关于HA模式下的Keycloak(Wildfly/Infinispan)-在检测群集中的其他计算机时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆