You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><spanclass="options-description-extended">May be an ISO 8601 duration value, an integer number of seconds, or an integer followed by one of [ms, h, m, s, d].</span></p>
<p><spanclass="options-description-extended">If false, endpoints are opened after bootstrap completes, ensuring the server is ready to handle requests.</span></p>
<p>Server initialization, such as database migrations, may take a significant amount of time to complete.
198
+
By default, Keycloak opens its HTTP(S) and Management endpoints while initialization is still in progress in the background.
199
+
This allows the startup and liveness probes to report UP early, preventing orchestrators like Kubernetes from killing the container during a long-running migration, while the readiness probe reports DOWN until initialization completes.</p>
200
+
</div>
201
+
<divclass="paragraph">
202
+
<p>If you run Keycloak behind a proxy or load balancer, configure an HTTP health check with the path <code>/health/ready</code> to ensure traffic is routed only to instances that have completed initialization.</p>
203
+
</div>
204
+
<divclass="paragraph">
205
+
<p>If an HTTP health check is not possible, or you prefer the server to accept connections only after initialization completes, start Keycloak with the following option:</p>
<h2id="_database_connection_and_login_timeout"><aclass="anchor" href="#_database_connection_and_login_timeout"></a>Database connection and login timeout</h2>
560
560
<divclass="sectionbody">
561
561
<divclass="paragraph">
562
562
<p>When Keycloak connects to the database, network problems can occur, especially during failovers or switchovers.
563
-
To improve resilience and ensure faster recovery, Keycloak automatically sets a default connection timeout of 10 seconds for selected database vendors when using the standard JDBC driver.</p>
564
-
</div>
565
-
<divclass="paragraph">
566
-
<p>The following table lists the affected vendors, the JDBC driver property used, and the default value applied by Keycloak:</p>
<p>Keycloak applies these defaults automatically, but only when all of the following conditions are met:</p>
618
-
</div>
619
-
<divclass="ulist">
620
-
<ul>
621
-
<li>
622
-
<p>The database vendor is configured via <code>--db</code>.</p>
623
-
</li>
624
-
<li>
625
-
<p>Keycloak is using the standard JDBC driver for that vendor.</p>
626
-
</li>
627
-
<li>
628
-
<p>The timeout property has not already been set explicitly by the user in <code>db-url</code> or <code>db-url-properties</code>.</p>
629
-
</li>
630
-
</ul>
631
-
</div>
632
-
<divclass="sect2">
633
-
<h3id="_overriding_the_default_connection_timeout"><aclass="anchor" href="#_overriding_the_default_connection_timeout"></a>Overriding the default connection timeout</h3>
634
-
<divclass="paragraph">
635
-
<p>To use a different connection timeout, set the relevant JDBC driver property explicitly via <code>db-url</code> or <code>db-url-properties</code>.</p>
636
-
</div>
637
-
<divclass="paragraph">
638
-
<p>For MySQL:</p>
639
-
</div>
640
-
<divclass="listingblock">
641
-
<divclass="content">
642
-
<preclass="highlight"><codeclass="language-bash" data-lang="bash">bin/kc.[sh|bat] start --db mysql --db-url-properties='?connectTimeout=30000'</code></pre>
<p>When using <code>db-url-properties</code>, prepend the correct delimiter for your vendor’s JDBC URL format:</p>
678
-
</div>
679
-
<divclass="ulist">
680
-
<ul>
681
-
<li>
682
-
<p>PostgreSQL, MySQL, and MariaDB: use <code>?</code> as the first property delimiter, or <code>&</code> for subsequent properties.</p>
683
-
</li>
684
-
<li>
685
-
<p>Microsoft SQL Server: use <code>;</code> as the property delimiter.</p>
686
-
</li>
687
-
</ul>
688
-
</div>
689
-
</td>
690
-
</tr>
691
-
</table>
563
+
To improve failover behavior and startup resilience during network issues, Keycloak sets a default connection timeout of 10s for all supported database vendors when using the standard JDBC driver.</p>
<p><spanclass="options-description">Sets the JDBC driver connection timeout and login timeout.</span></p>
1226
+
</div>
1227
+
<divclass="openblock options-extended">
1228
+
<divclass="content">
1229
+
<divclass="paragraph">
1230
+
<p><spanclass="options-description-extended">May be an ISO 8601 duration value, an integer number of seconds, or an integer followed by one of [ms, h, m, s, d].</span></p>
0 commit comments