我试图配置我的keycloak-18运行在helm-chart与外部mysql数据库-8版本。
这是我船舵图文件
值.yaml文件
image:
repository: quay.io/keycloak/keycloak
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "18.0.0"
args: ["start-dev"
,"--log-console-color=true"
,"--db=mysql"
,"--db-username=****"
,"--db-password=*****"
,"--db-url=jdbc:mysql://194.148.0.57/keycloakblockchain"
]
部署文件
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: {{ .Values.args }}
错误
2022-05-05 02:43:50,762 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: No suitable driver found for jdbc:mysql://194.148.0.57/keycloakblockchain
2022-05-05 02:43:38,765 WARN [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator] (JPA Startup Thread: keycloak-default) HHH000342: Could not obtain connection to query metadata: java.sql.SQLException: No suitable driver found for jdbc:mysql://194.148.0.57/keycloakblockchain
at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:191)
at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352)
at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:216)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:513)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:494)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)```
2条答案
按热度按时间qyswt5oh1#
尝试删除****jdbc:,并仅使用mysql:/
hsvhsicv2#
我也遇到了同样的问题。我花了一些时间才注意到我在构建生产映像时在
"KC_DB=mysql"
中有一个错字。如果您从此处使用停靠文件:https://www.keycloak.org/server/containers
那么您只需要将
KC_DB
环境变量更改为mysql。我的Docker文件:
我的docker-compose.yml(我曾经在本地测试):