How to configure non-xa datasource failover in EAP 6?

Solution Unverified - Updated -

Issue

  • We need to set up datasource failover in EAP 6 so that when one database is unavailable it will automatically transfer load to an alternate database.
  • We are looking for a way to implement datasource failover at the datasource level.
  • How to perform a task like, If primary datasource is not responding (or shut down forcefully, due to high CPU, errors, etc.), it will automatically fail-over to secondary datasource?
  • Fail-over is not working on JBoss EAP 6 datasources. In standalone-*.xml file the datasource configuration looks as below:
   <datasource jndi-name="java:/sampleDS" pool-name="sampleDS" enabled="true" > 
       <connection-url>jdbc:postgresql:@host:port/postgres|jdbc:postgresql:@host:port/postgres</connection-url>
       <url-delimiter>|</url-delimiter>
       <driver>postgres</driver>
       <security>
          <user-name>sample</user-name>
          <password>sample</password>
       </security>
   </datasource>
  • How to configure HA Data Source in JBoss EAP 6 ? Does JBoss need a restart when a database instance goes down?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6
  • url-delimiter and url-selector-strategy-class-name as defined in
    • jboss-as-datasources_1_0.xsd
    • jboss-as-datasources_1_1.xsd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.