2015-09-17 101 views
0

我们计划从Jboss 5迁移到Wildfly 8.2。在数据库方面,我们有MariaDB的三节点集群海豚湾10从JBoss AS 5迁移到Wildfly 8的集群数据源

在JBoss 5,我们曾在ds.xml文件以下设置:

... 
<connection-url>jdbc:mysql:loadbalance://ip-node1,ip-node2,ip-node3/DBname</connection-url> 
... 

一切都在JBoss 5行之有效但在Wildfly 8.2上我无法实现。从管理控制台中,我可以毫无问题地添加非群集数据源,并且它可以工作。 实例网址:jdbc:mysql://ip-node1/DBname

但是当我尝试为上面添加群集URL,我得到以下错误:

Unexpected HTTP response: 500 

Request 
{ 
    "address" => [ 
     ("subsystem" => "datasources"), 
     ("xa-data-source" => "dsName") 
    ], 
    "operation" => "test-connection-in-pool" 
} 

Response 

Internal Server Error 
{ 
    "outcome" => "failed", 
    "failure-description" => "JBAS010440: failed to invoke operation: JBAS010447: Connection is not valid", 
    "rolled-back" => true 
} 

我怎么能连接Wildfly到群集的数据源?我知道可以插入像HAProxy这样的外部负载均衡器,但我宁愿保持架构尽可能简单。

+0

[JBoss Windup迁移工具](https://github.com/windup/windup/wiki)可能有助于JBoss升级。 –

回答

0

您必须提及中的standalone.xml文件中的数据源,如下所示。

<datasource jndi-name="java:/jdbc/DB1" pool-name="PostgresDS" enabled="true" use-java-context="true"> 
         <connection-url>jdbc:postgresql://localhost:5432/DB1</connection-url> 
         <driver>postgres</driver> 
         <security> 
          <user-name>DB1</user-name> 
          <password>DB1</password> 
         </security> 
        </datasource> 
        <datasource jndi-name="java:/jdbc/DB2" pool-name="PostgresDS1" enabled="true" use-java-context="true"> 
         <connection-url>jdbc:postgresql://localhost:5432/DB2</connection-url> 
         <driver>postgres</driver> 
         <security> 
          <user-name>DB2</user-name> 
          <password>DB2</password> 
         </security> 
        </datasource> 
+0

我已经尝试直接在standalone.xml或管理界面中定义数据源。如果我使用非集群数据源,这两个工作。但是,当我使用集群数据源时,没有任何工作正如我的初始示例中那样。 –

相关问题