Skip to content

Instantly share code, notes, and snippets.

@earzur
Created May 13, 2020 08:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save earzur/2296fdc4a23d92fa63f3624ac0bf8e5a to your computer and use it in GitHub Desktop.
Save earzur/2296fdc4a23d92fa63f3624ac0bf8e5a to your computer and use it in GitHub Desktop.
infinispan config for a keycloak service running in rancher
<subsystem xmlns="urn:jboss:domain:infinispan:9.0">
<cache-container name="keycloak">
<transport lock-timeout="60000"/>
<local-cache name="realms">
<object-memory size="10000"/>
</local-cache>
<local-cache name="users">
<object-memory size="10000"/>
</local-cache>
<local-cache name="authorization">
<object-memory size="10000"/>
</local-cache>
<local-cache name="keys">
<object-memory size="1000"/>
<expiration max-idle="3600000"/>
</local-cache>
<replicated-cache name="work"/>
<distributed-cache name="sessions" owners="${env.CACHE_OWNERS:3}"/>
<distributed-cache name="authenticationSessions" owners="${env.CACHE_OWNERS:3}"/>
<distributed-cache name="offlineSessions" owners="${env.CACHE_OWNERS:3}"/>
<distributed-cache name="clientSessions" owners="${env.CACHE_OWNERS:3}"/>
<distributed-cache name="offlineClientSessions" owners="${env.CACHE_OWNERS:3}"/>
<distributed-cache name="loginFailures" owners="${env.CACHE_OWNERS:3}"/>
<distributed-cache name="actionTokens" owners="${env.CACHE_OWNERS:3}">
<object-memory size="-1"/>
<expiration interval="300000" max-idle="-1"/>
</distributed-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"/>
<replicated-cache name="sso">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
</replicated-cache>
<distributed-cache name="dist">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store/>
</distributed-cache>
<distributed-cache name="routing"/>
</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" module="org.infinispan.hibernate-cache">
<transport lock-timeout="60000"/>
<local-cache name="local-query">
<object-memory size="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<invalidation-cache name="entity">
<transaction mode="NON_XA"/>
<object-memory size="10000"/>
<expiration max-idle="100000"/>
</invalidation-cache>
<replicated-cache name="timestamps"/>
</cache-container>
</subsystem>
<subsystem xmlns="urn:jboss:domain:io:3.0">
<subsystem xmlns="urn:jboss:domain:jgroups:7.0">
<channels default="ee">
<channel name="ee" stack="jdbc-ping" cluster="ejb"/>
</channels>
<stacks>
<stack name="jdbc-ping">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="org.jgroups.protocols.JDBC_PING">
<property name="connection_url">jdbc:mysql://${env.MYSQL_KEYCLOAK_SERVER:mysql}:${env.MYSQL_KEYCLOAK_PORT:3306}/${env.MYSQL_KEYCLOAK_DATABASE:key
cloak}?${env.MYSQL_KEYCLOAK_JDBC_PARAMS:useSSL=false}</property>
<property name="connection_driver">com.mysql.jdbc.Driver</property>
<property name="connection_username">${env.MYSQL_KEYCLOAK_USER:keycloak}</property>
<property name="connection_password">${env.MYSQL_KEYCLOAK_PASSWORD:keycloak}</property>
<property name="initialize_sql">CREATE TABLE IF NOT EXISTS JGROUPSPING (own_addr varchar(200) NOT NULL, cluster_name varchar(200) NOT NULL, updat
ed TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, ping_data varbinary(5000) DEFAULT NULL, PRIMARY KEY (own_addr, cluster_name)) ENGINE=InnoDB DEFAULT C
HARSET=utf8</property>
<property name="break_on_coord_rsp">true</property>
<property name="discovery_rsp_expiry_time">10000</property>
<property name="async_discovery">true</property>
<property name="remove_old_coords_on_view_change">true</property>
<property name="remove_all_data_on_view_change">true</property>
</protocol>
<protocol type="MERGE3"/>
<socket-protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
<protocol type="FD"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS">
<property name="max_join_attempts">${env.JGROUPS_MAX_JOIN_ATTEMPTS:0}</property>
</protocol>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
<stack name="tcp-gossip">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="org.jgroups.protocols.TCPGOSSIP">
<property name="initial_hosts">${env.JGROUPS_GOSSIP_INITIAL_HOSTS:jgroups-gossip[12001]}</property>
<property name="break_on_coord_rsp">true</property>
<property name="discovery_rsp_expiry_time">10000</property>
<property name="async_discovery">true</property>
</protocol>
<protocol type="MERGE3"/>
<socket-protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
<protocol type="FD"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS">
<property name="max_join_attempts">${env.JGROUPS_MAX_JOIN_ATTEMPTS:0}</property>
</protocol>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
</stacks>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment