[keycloak-user] KeyCloak requires a restart when it loses SQL connection.

Thomas Darimont thomas.darimont at googlemail.com
Thu Dec 1 11:22:29 EST 2016


Hello,

the following jboss-cli script fragment works for me (for postgres):

echo SETUP: Configure Keycloak Datasource KeycloakDS
/subsystem=datasources/data-source=KeycloakDS/:remove
data-source add --jndi-name=java:jboss/datasources/KeycloakDS
--name=KeycloakDS --connection-url=${env.JDBC_URL}
--driver-name=${env.JDBC_DRIVERNAME:postgres}
--user-name=${env.JDBC_USER:keycloak}
--password=${env.JDBC_PASSWORD:keycloak}
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=min-pool-size,value=5)
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=max-pool-size,value=20)
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=background-validation,value=true)
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=check-valid-connection-sql,value="select
1")
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=background-validation-millis,value=120000)

Cheers,
Thomas

2016-12-01 16:19 GMT+01:00 Bill Burke <bburke at redhat.com>:

> This is a Wildfly/JBoss issue so check Wildfly/JBoss manual. There
> should be settings on datasource configuration to handle this scenario.
>
>
> On 12/1/16 9:01 AM, Ushanas Shastri wrote:
> > Hello,
> >
> > We have KeyCloak setup with SQL Server.
> >
> > Whenever we restart SQL Server service,  KeyCloak does not work anymore
> > until it is restarted too.  Is this expected behavior?
> >
> > Ideally,  KeyCloak should automatically connect once the server is up?
> >
> > Regards, Ushanas.
> > _______________________________________________
> > keycloak-user mailing list
> > keycloak-user at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-user
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list