Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed variable name confusion #22

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

alejandroalffer
Copy link

The generated JDBC string is not correct using the definition from https://www.keycloak.org/server/all-config#category-database.

To generate a correct connection URL we need the name of the database (Schema). However, the variable that specifies the database type is being used.

As a consequence, the same variable is used:

  • in build phase to specify the server (example: mysql01.test.local)
  • in cluster phase to specify the manufacturer (example, "mysql", "postgresql",...)

@alejandroalffer
Copy link
Author

Extended example in order to clarify the need of managing the port and IP of ispn-jdbc config

ENV KC_DB_URL_HOST=database_host
ENV KC_DB_URL=jdbc:database_vendor://database_host/database_name

# Default port for keycloak. Better choise for any load-balanced/clustered enviroment
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo:
choise -> choice
enviroment -> environment

@ivangfr
Copy link
Owner

ivangfr commented Jun 13, 2023

After building locally a new docker image for the version 21.1.1 (using the proposed changes), I was unable to run the cluster using MySQL. I didn't try other databases.

@alejandroalffer
Copy link
Author

alejandroalffer commented Jun 13, 2023

Hello!

Thanks for the feedback. I have actually tested the proposed changes in an AWS environment with an Application Load Balancer and in a local development environment using Nginx.

In both cases, using MySQL as database.

I think the misunderstanding comes from the fact that one of the KC_DB_URL_DATABASE environment variables was used by Keycloak for something different from what was indicated in the cache-ispn-jdbc-ping.xml file.

The confusion in:

In other words, bin/kc.sh show-config return this value for this environment variable:

        kc.db-url =  jdbc:mysql://db.my_host.com/my_KeycloakDb (KcEnvVarConfigSource)
        kc.db-url-host =  db.my_host.com (KcEnvVarConfigSource)

I beg you to try again.

Thank you!

@ivangfr
Copy link
Owner

ivangfr commented Jun 23, 2023

Hi @alejandroalffer

I have taken the time to review your proposal. However, it seems to deviate slightly from my initial vision for this project and the Docker image.

My aim was to keep things as simple as possible, without being tied to any specific technology. In other words, anyone with Docker installed should be able to run the Keycloak Clustered locally on their machine. I have provided a step-by-step guide in the README file to assist with this.

Furthermore, the Dockerfile is designed to be straightforward, and all the necessary Keycloak environment variables are set automatically during the execution of the docker run command.

Unfortunately, I cannot go ahead with this merge request because it would render the instructions in the README ineffective for individuals attempting to run the project locally.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants