WildFly、JBoss 使用单播

问题描述 投票:0回答:1

我有 11.0 Wildfly。我找到了 JGroups TCP 套接字绑定配置:https://docs.redhat.com/en/documentation/red_hat_data_grid/7.2/html/administration_and_configuration_guide/configure_jgroups#binding_a_group_of_sockets_example 我做到了,但总是在日志中得到 [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ServerService Thread Pool -- 76) ISPN000088: 无法使用属性 {} 中提供的任何 JGroups 配置机制。使用默认的 JGroups 配置!

我确实尝试了文档中的所有步骤。我想使用单播而不是多播,因为我的节点位于不同的子网中(在我的情况下位于不同的防火墙中)。但我总是得到“使用默认 jgroups”并且在wireshark 中存在 UDP 流量。

<subsystem xmlns="urn:jboss:domain:infinispan:4.0">
            <cache-container name="keycloak" jndi-name="infinispan/Keycloak">
                <local-cache name="realms">
                    <eviction strategy="LRU" max-entries="10000"/>
                </local-cache>
                <local-cache name="users">
                    <eviction strategy="LRU" max-entries="10000"/>
                </local-cache>
                <local-cache name="sessions"/>
                <local-cache name="authenticationSessions"/>
                <local-cache name="offlineSessions"/>
                <local-cache name="clientSessions"/>
                <local-cache name="offlineClientSessions"/>
                <local-cache name="loginFailures"/>
                <local-cache name="authorization">
                    <eviction strategy="LRU" max-entries="10000"/>
                </local-cache>
                <local-cache name="actionTokens"/>
                <local-cache name="work"/>
                <local-cache name="keys">
                    <eviction strategy="LRU" max-entries="1000"/>
                    <expiration max-idle="3600000"/>
                </local-cache>
            </cache-container>
            <cache-container name="server" aliases="singleton cluster" default-cache="default" module="org.wildfly.clustering.server">
                <transport lock-timeout="60000"/>
                <replicated-cache name="default">
                    <transaction mode="BATCH"/>
                </replicated-cache>
            </cache-container>
            <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
                <transport lock-timeout="60000"/>
                <distributed-cache name="dist">
                    <locking isolation="REPEATABLE_READ"/>
                    <transaction mode="BATCH"/>
                    <file-store/>
                </distributed-cache>
            </cache-container>
            <cache-container name="ejb" aliases="sfsb" default-cache="dist" module="org.wildfly.clustering.ejb.infinispan">
                <transport lock-timeout="60000"/>
                <distributed-cache name="dist">
                    <locking isolation="REPEATABLE_READ"/>
                    <transaction mode="BATCH"/>
                    <file-store/>
                </distributed-cache>
            </cache-container>
            <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
                <transport lock-timeout="60000"/>
                <local-cache name="local-query">
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <invalidation-cache name="entity">
                    <transaction mode="NON_XA"/>
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </invalidation-cache>
                <replicated-cache name="timestamps" mode="ASYNC"/>
            </cache-container>
            <cache-container name="tapi-container" aliases="sfsb2" default-cache="tapi-cache" module="org.wildfly.clustering.ejb.infinispan" jndi-name="infinispan/tapi-container" statistics-enabled="true">
                <transport lock-timeout="60000"/>
                <replicated-cache name="tapi-cache" jndi-name="infinispan/tapi-container/tapi-cache" mode="ASYNC">
                    <locking isolation="READ_COMMITTED"/>
                    <transaction locking="OPTIMISTIC" mode="NONE"/>
                    <eviction strategy="NONE"/>
                </replicated-cache>
            </cache-container>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
        <subsystem xmlns="urn:jboss:domain:jca:5.0">
            <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
            <bean-validation enabled="true"/>
            <default-workmanager>
                <short-running-threads>
                    <core-threads count="50"/>
                    <queue-length count="50"/>
                    <max-threads count="50"/>
                    <keepalive-time time="10" unit="seconds"/>
                </short-running-threads>
                <long-running-threads>
                    <core-threads count="50"/>
                    <queue-length count="50"/>
                    <max-threads count="50"/>
                    <keepalive-time time="10" unit="seconds"/>
                </long-running-threads>
            </default-workmanager>
            <cached-connection-manager/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
        <subsystem xmlns="urn:jboss:domain:jgroups:5.0" default-stack="tcp">
        <channels default="ee">
            <channel name="ee" stack="tcp"/>
        </channels>
        <stacks>
            <stack name="tcp">
                <transport type="TCP" socket-binding="jgroups-tcp"/>
                <protocol type="TCPPING">
                    <property name="initial_hosts">192.168.4.22[7600],192.168.4.23[7600]</property>
                    <property name="num_initial_members">2</property>
                    <property name="port_range">0</property>
                    <property name="timeout">2000</property>
                </protocol>
                <protocol type="MERGE3"/>
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
                <protocol type="FD_ALL"/>
                <protocol type="VERIFY_SUSPECT"/>
                <protocol type="pbcast.NAKACK2">
                    <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3"/>
                <protocol type="pbcast.STABLE"/>
                <protocol type="pbcast.GMS"/>
                <protocol type="MFC"/>
                <protocol type="FRAG2"/>
            </stack>
        </stacks>
jboss wildfly infinispan jgroups wildfly-11
1个回答
0
投票

假设您实际上正在运行 Keycloak,请参阅本指南 - https://www.keycloak.org/server/caching - 您会发现为 Infinispan 切换 JGroups 堆栈是通过

--cache-stack=tcp
完成的。

© www.soinside.com 2019 - 2024. All rights reserved.