Optionally extend the jgroups stack.

This commit is contained in:
Andrea Dell'Amico 2022-12-31 15:47:56 +01:00
parent 4feb3224cd
commit 3e6e686294
Signed by untrusted user: adellam
GPG Key ID: 147ABE6CEB9E20FF
3 changed files with 35 additions and 4 deletions

View File

@ -85,7 +85,10 @@ keycloak_reverse_proxy_infinispan_attach_route: 'true'
keycloak_cluster: false
keycloak_cache_type: ispn
keycloak_cache_stack: tcp
keycloak_jgroups_cache_hostname: "{{ ansible_fqdn }}"
keycloak_cache_container_name: keycloak
keycloak_jgroups_multicast_port: '46655'
keycloak_jgroups_multicast_address: '228.6.7.8'
keycloak_jgroups_multicast_net: '224.0.0.1'
keycloak_jgroups_multicast_port: 46655
keycloak_jgroups_multicast_address: 228.6.7.8
keycloak_jgroups_bind_port: 55200
keycloak_jgroups_extended_stack: false
keycloak_jgroups_extended_stack_name: "extended-{{ keycloak_cache_stack }}"

View File

@ -21,8 +21,35 @@
xsi:schemaLocation="urn:infinispan:config:11.0 http://www.infinispan.org/schemas/infinispan-config-11.0.xsd"
xmlns="urn:infinispan:config:11.0">
{% if keycloak_jgroups_extended_stack %}
<!-- custom stack goes into the jgroups element -->
<jgroups>
<stack name="{{ keycloak_jgroups_extended_stack_name }}" extends="{{ keycloak_cache_stack }}">
<UDP bind_addr="${jgroups.bind.address,jgroups.udp.address:SITE_LOCAL}"
bind_port="{{ keycloak_jgroups_bind_port }}"
mcast_addr="{{ keycloak_jgroups_multicast_address }}"
mcast_port="{{ keycloak_jgroups_multicast_port }}"
tos="0"
ucast_send_buf_size="1m"
mcast_send_buf_size="1m"
ucast_recv_buf_size="20m"
mcast_recv_buf_size="25m"
ip_ttl="${jgroups.ip_ttl:2}"
thread_naming_pattern="pl"
enable_diagnostics="false"
bundler_type="transfer-queue"
max_bundle_size="8500"
thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
thread_pool.keep_alive_time="60000"
thread_dumps_threshold="${jgroups.thread_dumps_threshold:10000}" />
</stack>
</jgroups>
{% endif %}
<cache-container name="keycloak">
<transport cluster="{{ keycloak_cache_container_name }}" lock-timeout="60000"/>
<transport cluster="{{ keycloak_cache_container_name }}"{% if keycloak_jgroups_extended_stack %} stack="{{ keycloak_jgroups_extended_stack_name }}"{% endif %} node-name="{{ keycloak_jgroups_cache_hostname }}" lock-timeout="60000"/>
<local-cache name="realms">
<encoding>
<key media-type="application/x-java-object"/>

View File

@ -49,6 +49,7 @@ spi-avatar-storage-avatar-storage-file-avatar-folder={{ keycloak_external_avatar
spi-sticky-session-encoder-infinispan-should-attach-route={{ keycloak_reverse_proxy_infinispan_attach_route }}
cache={{ keycloak_cache_type }}
cache-stack={{ keycloak_cache_stack }}
cache-config-file={{ keycloak_conf_directory }}/cache-ispn.xml
{% endif %}
# Logging
log={{ keycloak_log_handlers }}