埋め込みH2の代わりにカスタムmysqlデータベースを使用するKeycloakインスタンスを起動しようとしています。
Dockerを使用する予定なので、mysqlと通信するKeyclock dockerのネットワークを作成しました。
docker network create keycloak-network
その後、mysqlのdockerインスタンスが次のコマンドで起動されます。
Sudo docker run --name mysql-container -net keycloak-network -v/home/renju/opt/EXONERATE/DB/mysql-data-5-7:/ var/lib/mysql- e MYSQL_DATABASE = keycloak -e MYSQL_USER = ku -e MYSQL_PASSWORD = kupw -e MYSQL_ROOT_PASSWORD = myrootpw -d 3p:3306 mysql:5.7
Keycloakがデータベースkeycloakにユーザー名kおよびパスワードkupwでアクセスすることを期待しています。データベースとユーザーがmysqlで作成されていることを確認しました。
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| keycloak |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> select * from user where User='ku';
+------+------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
| Host | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin | authentication_string | password_expired | password_last_changed | password_lifetime | account_locked |
+------+------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
| % | ku | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | mysql_native_password | *26F9FD80FE9252482EECF5F36ED57EE8551BF34A | N | 2020-01-29 23:52:37 | NULL | N |
+------+------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
1 row in set (0.00 sec)
Mysqlが稼働している状態で、ユーザーkデータベースにアクセスするkeycloakを使用してmysqlに接続するためにkeycloak dockerを起動しました。
Sudo docker run --name keycloak --net keycloak-network -e DB_ADDR = mysql-container -e KEYCLOAK_USER = admin -e KEYCLOAK_PASSWORD = admin -e DB_VENDOR = MYSQL -e DB_DATABASE = keycloak -e DB_USER = k -e DB_PASSWORD = kupw -e JDBC_PARAMS = 'useSSL = false&allowPublicKeyRetrieval = true '-e Java_OPTS = "-Djboss.as.management.blocking.timeout = 1200" -p 8180:8180 jboss/keycloak -Djboss.http.port = 8180
ただし、次の例外を除いて、mysqlでスキーマを作成したり、テーブルにデータを挿入しようとしたりすると、このコマンドは失敗します。
23:59:52,439 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 71) MSC000001: Failed to start service jboss.deployment.unit."keycloak-server.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."keycloak-server.war".undertow-deployment: Java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication()
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.Java:81)
at Java.base/Java.util.concurrent.Executors$RunnableAdapter.call(Executors.Java:515)
at Java.base/Java.util.concurrent.FutureTask.run(FutureTask.Java:264)
at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.Java:35)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.Java:1982)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.Java:1486)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.Java:1377)
at Java.base/Java.lang.Thread.run(Thread.Java:834)
at [email protected]//org.jboss.threads.JBossThread.run(JBossThread.Java:485)
Caused by: Java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication()
at [email protected]//org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.Java:164)
at [email protected]//org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.Java:2784)
at [email protected]//org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.Java:364)
at [email protected]//org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.Java:277)
at [email protected]//org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.Java:89)
at [email protected]//org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.Java:119)
at [email protected]//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.Java:36)
at [email protected]//io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.Java:117)
at [email protected]//org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.Java:78)
at [email protected]//io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.Java:103)
at [email protected]//io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.Java:305)
at [email protected]//io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.Java:145)
at [email protected]//io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.Java:585)
at [email protected]//io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.Java:556)
at [email protected]//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.Java:42)
at [email protected]//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.Java:43)
at [email protected]//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.Java:105)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.Java:1504)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.Java:1504)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.Java:1504)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.Java:1504)
at [email protected]//io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.Java:598)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.Java:97)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.Java:78)
... 8 more
Caused by: Java.lang.RuntimeException: Failed to update database
at [email protected]//org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.Java:116)
at [email protected]//org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.Java:81)
at [email protected]//org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory$2.run(DefaultJpaConnectionProviderFactory.Java:336)
at [email protected]//org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.Java:227)
at [email protected]//org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.update(DefaultJpaConnectionProviderFactory.Java:329)
at [email protected]//org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.migration(DefaultJpaConnectionProviderFactory.Java:301)
at [email protected]//org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lambda$lazyInit$0(DefaultJpaConnectionProviderFactory.Java:182)
at [email protected]//org.keycloak.models.utils.KeycloakModelUtils.suspendJtaTransaction(KeycloakModelUtils.Java:682)
at [email protected]//org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.Java:133)
at [email protected]//org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.Java:81)
at [email protected]//org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.Java:59)
at [email protected]//org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.Java:205)
at [email protected]//org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.Java:51)
at [email protected]//org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.Java:33)
at [email protected]//org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.Java:205)
at [email protected]//org.keycloak.services.DefaultKeycloakSession.realmLocalStorage(DefaultKeycloakSession.Java:158)
at [email protected]//org.keycloak.models.cache.infinispan.RealmCacheSession.getRealmDelegate(RealmCacheSession.Java:148)
at [email protected]//org.keycloak.models.cache.infinispan.RealmCacheSession.getMigrationModel(RealmCacheSession.Java:141)
at [email protected]//org.keycloak.migration.MigrationModelManager.migrate(MigrationModelManager.Java:91)
at [email protected]//org.keycloak.services.resources.KeycloakApplication.migrateModel(KeycloakApplication.Java:272)
at [email protected]//org.keycloak.services.resources.KeycloakApplication.migrateAndBootstrap(KeycloakApplication.Java:213)
at [email protected]//org.keycloak.services.resources.KeycloakApplication$1.run(KeycloakApplication.Java:180)
at [email protected]//org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.Java:227)
at [email protected]//org.keycloak.services.resources.KeycloakApplication.startup(KeycloakApplication.Java:171)
at [email protected]//org.keycloak.services.resources.KeycloakApplication.init(KeycloakApplication.Java:162)
at [email protected]//org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.Java:143)
at Java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at Java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:62)
at Java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:45)
at Java.base/Java.lang.reflect.Constructor.newInstance(Constructor.Java:490)
at [email protected]//org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.Java:152)
... 31 more
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::[email protected]:
Reason: liquibase.exception.UnexpectedLiquibaseException: Java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_ROLLEDBACK
at org.liquibase//liquibase.changelog.ChangeSet.execute(ChangeSet.Java:607)
at org.liquibase//liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.Java:51)
at org.liquibase//liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.Java:79)
at org.liquibase//liquibase.Liquibase.update(Liquibase.Java:214)
at org.liquibase//liquibase.Liquibase.update(Liquibase.Java:192)
at org.liquibase//liquibase.Liquibase.update(Liquibase.Java:188)
at [email protected]//org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.updateChangeSet(LiquibaseJpaUpdaterProvider.Java:182)
at [email protected]//org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.Java:102)
... 61 more
Caused by: liquibase.exception.UnexpectedLiquibaseException: Java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_ROLLEDBACK
at org.liquibase//liquibase.database.jvm.JdbcConnection.getURL(JdbcConnection.Java:79)
at org.liquibase//liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.Java:66)
at org.liquibase//liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.Java:113)
at org.liquibase//liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.Java:1277)
at org.liquibase//liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.Java:1259)
at org.liquibase//liquibase.changelog.ChangeSet.execute(ChangeSet.Java:582)
... 68 more
Caused by: Java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_ROLLEDBACK
at [email protected]//org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.Java:271)
at [email protected]//org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransactionActive(WrappedConnection.Java:2001)
at [email protected]//org.jboss.jca.adapters.jdbc.WrappedConnection.checkStatus(WrappedConnection.Java:2016)
at [email protected]//org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransaction(WrappedConnection.Java:1990)
at [email protected]//org.jboss.jca.adapters.jdbc.WrappedConnection.getMetaData(WrappedConnection.Java:977)
at org.liquibase//liquibase.database.jvm.JdbcConnection.getURL(JdbcConnection.Java:77)
... 73 more
23:59:52,646 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): Java.lang.NullPointerException
at [email protected]//org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.Java:86)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.Java:999)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.Java:743)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.Java:467)
at [email protected]//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.Java:1413)
at [email protected]//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.Java:521)
at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.Java:472)
at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.Java:434)
at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.Java:435)
at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.Java:394)
at [email protected]//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.Java:374)
at Java.base/Java.lang.Thread.run(Thread.Java:834)
23:59:52,649 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler@757c56a0 for operation add-deployer-chains at address [] failed handling operation rollback -- Java.util.concurrent.RejectedExecutionException: Java.util.concurrent.RejectedExecutionException
at [email protected]//org.jboss.threads.RejectingExecutor.execute(RejectingExecutor.Java:37)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.Java:2026)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.execute(EnhancedQueueExecutor.Java:757)
at [email protected]//org.jboss.as.controller.notification.NotificationSupports$NonBlockingNotificationSupport.emit(NotificationSupports.Java:95)
at [email protected]//org.jboss.as.controller.OperationContextImpl.notifyModificationBegun(OperationContextImpl.Java:877)
at [email protected]//org.jboss.as.controller.OperationContextImpl.ensureWriteLockForRuntime(OperationContextImpl.Java:866)
at [email protected]//org.jboss.as.controller.OperationContextImpl.removeService(OperationContextImpl.Java:639)
at [email protected]//org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler$1.handleRollback(DeployerChainAddHandler.Java:135)
at [email protected]//org.jboss.as.controller.AbstractOperationContext$RollbackDelegatingResultHandler.handleResult(AbstractOperationContext.Java:1561)
at [email protected]//org.jboss.as.controller.AbstractOperationContext$Step.invokeResultHandler(AbstractOperationContext.Java:1533)
at [email protected]//org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.Java:1515)
at [email protected]//org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.Java:1472)
at [email protected]//org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.Java:1455)
at [email protected]//org.jboss.as.controller.AbstractOperationContext$Step.access$400(AbstractOperationContext.Java:1319)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.Java:876)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.Java:756)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.Java:467)
at [email protected]//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.Java:1413)
at [email protected]//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.Java:521)
at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.Java:472)
at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.Java:434)
at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.Java:435)
at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.Java:394)
at [email protected]//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.Java:374)
at Java.base/Java.lang.Thread.run(Thread.Java:834)
Suppressed: Java.util.concurrent.RejectedExecutionException: Executor is being shut down
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.Java:2028)
... 23 more
23:59:52,650 ERROR [org.jboss.as.controller.client] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler@757c56a0 for operation add-deployer-chains at address [] failed handling operation rollback -- Java.util.concurrent.RejectedExecutionException
しかし、keycloak database内でこのプロセスを実行した結果として作成されたテーブルを確認できました。
mysql>
mysql> use keycloak;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+------------------------------+
| Tables_in_keycloak |
+------------------------------+
| APPLICATION_DEFAULT_ROLES |
| APP_NODE_REGISTRATIONS |
| CLIENT |
| CLIENT_ATTRIBUTES |
| CLIENT_IDENTITY_PROV_MAPPING |
| CLIENT_SESSION |
| CLIENT_SESSION_NOTE |
| CLIENT_SESSION_ROLE |
| COMPOSITE_ROLE |
| CREDENTIAL |
| DATABASECHANGELOG |
| DATABASECHANGELOGLOCK |
| EVENT_ENTITY |
| FEDERATED_IDENTITY |
| FED_PROVIDERS |
| IDENTITY_PROVIDER |
| IDENTITY_PROVIDER_CONFIG |
| KEYCLOAK_ROLE |
| PROTOCOL_MAPPER |
| PROTOCOL_MAPPER_CONFIG |
| REALM |
| REALM_APPLICATION |
| REALM_ATTRIBUTE |
| REALM_DEFAULT_ROLES |
| REALM_ENABLED_EVENT_TYPES |
| REALM_EVENTS_LISTENERS |
| REALM_REQUIRED_CREDENTIAL |
| REALM_SMTP_CONFIG |
| REALM_SUPPORTED_LOCALES |
| REDIRECT_URIS |
| SCOPE_MAPPING |
| USERNAME_LOGIN_FAILURE |
| USER_ATTRIBUTE |
| USER_ENTITY |
| USER_FEDERATION_CONFIG |
| USER_FEDERATION_PROVIDER |
| USER_REQUIRED_ACTION |
| USER_ROLE_MAPPING |
| USER_SESSION |
| USER_SESSION_NOTE |
| WEB_ORIGINS |
+------------------------------+
41 rows in set (0.00 sec)
失敗の理由がわかりません。私はそれを私のubuntuマシンで使っています。
ここがこの質問を投稿するのに適切な場所かどうかはわかりません。これは、stackoverflowメンバーの要求に応じて行います。
https://github.com/keycloak/keycloak-containers/blob/master/docker-compose-examples/keycloak-mysql.yml によると、&connectTimeout=30000
からJDBC_PARAMS
環境変数。
朝のコーヒーがもっと必要かもしれませんが、MySQL kuユーザーには権限が付与されていないようです。そのため、アプリケーションも失敗します。