|
83 | 83 | <cache-container name="keycloak" statistics="true">
|
84 | 84 | {% if jdg_jgroups_relay %}
|
85 | 85 | <transport cluster="{{ jdg_jgroups_relay_site }}" stack="xsite" node-name="{{ inventory_hostname }}" machine="{{ inventory_hostname }}" site="{{ jdg_jgroups_relay_site }}"/>
|
86 |
| -{% else %} |
87 |
| - <transport cluster="datagrid" stack="datagrid" node-name="{{ inventory_hostname }}" machine="{{ inventory_hostname }}"/> |
88 |
| -{% endif %} |
| 86 | + <replicated-cache name="work"/> |
89 | 87 | {% for keycloak_cache in jdg_keycloak_cache.caches %}
|
90 |
| - <replicated-cache name="{{ keycloak_cache }}" mode="SYNC"> |
| 88 | + <distributed-cache name="{{ keycloak_cache }}" mode="SYNC" owners="2" xmlns:jdbc="urn:infinispan:config:store:jdbc:12.0"> |
| 89 | +{% if jdg_keycloak_persistence %} |
| 90 | + <persistence passivation="false"> |
| 91 | + <jdbc:string-keyed-jdbc-store fetch-state="false" shared="true" preload="false"> |
| 92 | + <jdbc:data-source jndi-url="jdbc/datasource"/> |
| 93 | + <jdbc:string-keyed-table drop-on-exit="false" create-on-start="true" prefix="DATAGRID"> |
| 94 | + <jdbc:id-column name="id" type="VARCHAR(255)"/> |
| 95 | + <jdbc:data-column name="datum" type="VARBINARY(4000)"/> |
| 96 | + <jdbc:timestamp-column name="version" type="BIGINT"/> |
| 97 | + <jdbc:segment-column name="S" type="INT"/> |
| 98 | + </jdbc:string-keyed-table> |
| 99 | + </jdbc:string-keyed-jdbc-store> |
| 100 | + </persistence> |
| 101 | +{% else %} |
91 | 102 | <transaction mode="NONE" locking="PESSIMISTIC"/>
|
92 | 103 | <locking acquire-timeout="0" />
|
| 104 | +{% endif %} |
93 | 105 | <backups>
|
94 | 106 | {% for site in jdg_jgroups_relay_sites %}
|
95 |
| - {% if site != jdg_jgroups_relay_site %}<backup site="{{ site }}" strategy="ASYNC"/>{% endif %} |
| 107 | +{% if site != jdg_jgroups_relay_site %} <backup site="{{ site }}" strategy="ASYNC"/> |
| 108 | +{% endif %} |
96 | 109 | {% endfor %}
|
97 | 110 | </backups>
|
98 |
| - </replicated-cache> |
| 111 | + </distributed-cache> |
| 112 | +{% endfor %} |
99 | 113 | <security>
|
100 | 114 | <authorization>
|
101 | 115 | <role name="{{ jdg_supervisor.name }}" permissions="READ WRITE EXEC CREATE"/>
|
102 | 116 | </authorization>
|
103 | 117 | </security>
|
| 118 | +{% else %} |
| 119 | + <transport cluster="datagrid" stack="datagrid" node-name="{{ inventory_hostname }}" machine="{{ inventory_hostname }}"/> |
| 120 | + <replicated-cache name="work"/> |
| 121 | +{% for keycloak_cache in jdg_keycloak_cache.caches %} |
| 122 | + <replicated-cache name="{{ keycloak_cache }}" mode="SYNC"> |
| 123 | + <transaction mode="NONE" locking="PESSIMISTIC"/> |
| 124 | + <locking acquire-timeout="0" /> |
| 125 | + </replicated-cache> |
104 | 126 | {% endfor %}
|
| 127 | + <security> |
| 128 | + <authorization> |
| 129 | + <role name="{{ jdg_supervisor.name }}" permissions="READ WRITE EXEC CREATE"/> |
| 130 | + </authorization> |
| 131 | + </security> |
| 132 | +{% endif %} |
105 | 133 | </cache-container>
|
106 | 134 | {% endif %}
|
107 | 135 | <server xmlns="urn:infinispan:server:12.1">
|
|
140 | 168 | </security-realm>
|
141 | 169 | </security-realms>
|
142 | 170 | </security>
|
143 |
| - |
| 171 | +{% if jdg_keycloak_persistence %} |
| 172 | + <data-sources> |
| 173 | + <data-source name="KeycloakDS" jndi-name="jdbc/datasource" statistics="true"> |
| 174 | + <connection-factory driver="{{ jdg_jgroups_jdbc.mariadb.driver_class }}" |
| 175 | + username="{{ jdg_jgroups_jdbc.mariadb.db_user }}" |
| 176 | + password="{{ jdg_jgroups_jdbc.mariadb.db_password }}" |
| 177 | + url="{{ jdg_jgroups_jdbc.mariadb.connection_url }}?useUnicode=true&characterEncoding=UTF-8" |
| 178 | + new-connection-sql="SELECT 1" transaction-isolation="READ_COMMITTED"> |
| 179 | + </connection-factory> |
| 180 | + <connection-pool initial-size="1" max-size="10" min-size="3" background-validation="1000" idle-removal="1" blocking-timeout="1000" leak-detection="10000"/> |
| 181 | + </data-source> |
| 182 | + </data-sources> |
| 183 | +{% endif %} |
144 | 184 | <endpoints socket-binding="default" security-realm="default">
|
145 | 185 | <hotrod-connector name="hotrod"/>
|
146 | 186 | <rest-connector name="rest">
|
|
0 commit comments