将KeyCloak域模式连接到远程Mariadb

发布于 2025-02-07 16:42:25 字数 1409 浏览 2 评论 0 原文

我想使用MariadB作为外部DB将KeyCloak(V 15.0.2)部署在域模式下。 想象一下我的DB在10.0.0.1上。我还通过修改domain.xml中的“ keyCloakds”数据源和驱动程序来在10.0.0.1上部署主机。

我还想通过修改domain.xml和 host-slave.xml 作为提到的KeyCloak的文档( link )。 的domain.xml中的“ keycloakds”进行了以下更改

<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS"> 
    <connection-url>jdbc:mariadb://10.0.0.1:3306/keycloak</connection-url> 
    <driver>mariadb</driver> 
    <security>
        <user-name>myuser</user-name>
        <password>mypassword</password>
    </security>
</datasource>

我在3306上从10.0.0.2到10.0.0.1

。更改上述更改后,我想在10.0.0.2上部署从站,但请继续面对以下错误:

Caused by: java.sql.SQLNonTransientConnectionException: 
Socket fail to connect to host:address=(host=localhost)(port=3306)(type=primary). Connection refused: connect

另请注意,SceneIO通过在 sentalone-Ha.xml中进行相同的更改来适合独立HA模式。 /代码>。

我遵循此链接: 有人建议如何解决这个问题吗?

I wanted to deploy Keycloak (v 15.0.2) on the domain mode using MariaDB as an external DB.
Imagine my DB is on 10.0.0.1. I deploy my master on 10.0.0.1 as well by modifying the "KeycloakDS" datasource and the drivers in domain.xml.

I also wanted to deploy a slave on 10.0.0.2 by modifying the domain.xml and the host-slave.xml as the documentation of the Keycloak mentioned (link). I made the below changes on "KeycloakDS" in domain.xml:

<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS"> 
    <connection-url>jdbc:mariadb://10.0.0.1:3306/keycloak</connection-url> 
    <driver>mariadb</driver> 
    <security>
        <user-name>myuser</user-name>
        <password>mypassword</password>
    </security>
</datasource>

Note telnet on 3306 from 10.0.0.2 to 10.0.0.1 is Ok.

After the above changes, I wanted to deploy the slave on 10.0.0.2 but keep facing the error below:

Caused by: java.sql.SQLNonTransientConnectionException: 
Socket fail to connect to host:address=(host=localhost)(port=3306)(type=primary). Connection refused: connect

Also note that the sceneio works properly for the standalone-ha mode by making the same changes in standalone-ha.xml.

I followed this link: Installing and Configuring Keycloak - Domain Clustered Deployment
Does anyone have any suggestion that how can I solve this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

起风了 2025-02-14 16:42:25

更改数据源

尝试在&lt;子系统xmlns =“ urn:jboss:domain:dataSources:6.0”&gt;

。当我查看文件时,我发现该子系统的两次出现。

Try changing the datasource on both

<subsystem xmlns="urn:jboss:domain:datasources:6.0"> in /domain.xml file.

when I was reviewing the file i found there two occurrences of that subsystem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文