Repository navigation
Replies: 15 comments 23 replies
|
I have been deploying Keycloak in bare deployments in customer environments, so no being able to use Kubernetes features and commonly used jdbc_ping for setting up the infinispan cache. Having documentation about how to properly setup jdbc_ping inside Keycloaks project documentation would be very much appreciated. Currently it is often very hairy to set this 10BC8 up correctly and debugging it not easy. Even better would be to have the db ready for this out-of-the box and also show in the UI if Keycloak is running in clustered mode. Thanks! |
|
It is possible to reuse the existing JDBC datasource provided by quarkus in infinispan instead of using a dedicated connection: <JDBC_PING stack.combine="REPLACE" stack.position="MPING"
datasource_jndi_name="jdbc/datasource"
initialize_sql="CREATE TABLE IF NOT EXISTS JGROUPSPING (own_addr varchar(200) NOT NULL,cluster_name varchar(200) NOT NULL,updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP,ping_data BYTEA,constraint PK_JGROUPSPING PRIMARY KEY (own_addr, cluster_name))"
insert_single_sql="INSERT INTO JGROUPSPING (own_addr, cluster_name, ping_data) values (?, ?, ?)"
delete_single_sql="DELETE FROM JGROUPSPING WHERE own_addr=? AND cluster_name=?"
select_all_pingdata_sql="SELECT ping_data FROM JGROUPSPING WHERE cluster_name=?" /> |
|
Hello I set up multiple environments and always used the JDBC_PING mechanism. I have to admit I could not understand why this mechanism is not part of the documentation, so definitely I support adding it on the official documentation. |
|
A few years ago, we used JDBC_PING for the mentioned reasons. At that time, it worked so-so. The biggest problem was that for some reason old entries were not removed correctly. Over time this led to large startup times as each joining node tried to connect the list of nodes in the DB unsuccessfully. However, it could be we did something wrong or the problem is fixed in the meantime. We switched to DNS_PING since we run in Kubernetes and didn't have any problems with that ever since. |
|
Therefore I'm writing Let's use Note btw that a JGroups stack (5.x) can have multiple discovery protocols, e.g. |
|
Even with the occasional zombie entries as mentioned by @sschu above, we've been using |
|
JDBC_PING makes a lot of sense to me for two reasons:
|
|
JDBC_PING or JDBC_PING2 sound great. I'd just add:
|
|
@pauliuspetk : if you refer to an existing datasource, then - yes - that can be injected into JDBC_PING{2}, either via JNDI or |
|
Hi @thomasdarimont : since 5.3.7 (https://issues.redhat.com/browse/JGRP-2795). If you need this to be available in a different version, it should be pretty painless to backport... |
|
Documentation: http://www.jgroups.org/manual5/index.html#JDBC_PING2 |
|
@thomasdarimont 5.3.7 is backwards-compatible to 5.3.6, so it should be simple to manually replace the JGroups JAR for testing this feature. |
|
I am fine if JDBC_PING is the default in the future but I would not like to remove support for different mechanisms. We have been running with DNS_PING for the last four years without any problem. It works really well in Kubernetes. For us, there is really no reason to change given our experiences so far. We have seen strange issues in Azure SQL (e.g. worker pool exhaustion causing selected queries to fail) so I would rather keep a JGroups discovery mechanism that was 100% reliable for us so far. |
|
@thomasdarimont No, JGroups config files don't support inheritance |
|
Keylcoak 26.1 is using the cache-stack Thank you for the collaboration! I'm now archiving this issue. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Current status of this discussion
We're trying to understand if JDBC_PING would be a solution, and what people struggle with in this are of Keycloak's configuration. Please provide your feedback below in the comments. We'll then update the the summary below.
Problem description
The current cache configuration describes multiple JGroups discovery and transport configurations. While for example the Keycloak Operator hides that configuration complexity from users by configuring a reliable setup, there are regularly questions on how to configure discovery in other setups.
The additional transport stacks for ec2, google and azure require additional libraries that aren't shipped with Keycloak. Users will need to install these in the providers folder to make use of them.
Solution idea
Common for all setups is that Keycloak stores its data in the database. So JDBC_PING seems to be a common denominator for all environments.
Current gaps
The current Keycloak documentation doesn't describe JDBC ping at all, and the necessary tables are missing in Keycloak's database schema.
The current configuration doesn't re-use Keycloak's database settings to set up JDBC ping, but requires a separate configuration. Editing Keycloak's Infinispan XML shouldn't be required for such a setup.
Some configurations used by the community:
Problems reported by users using JDBC Ping:
Additional difficulties to users are to bind JGroups to the correct host address, and setting the external address for a node:
Related work:
All reactions