The performance team at Elastic Path has recently gone through Oracle RAC validation with Elastic Path 6.1.1 and made it out the other side unscathed. And the best part, is that there are no code changes required on EP out-of-the-box to fully support Oracle RAC with Fast-Connection-Failover (FCF).
The benefits of Oracle RAC (Real Application Clusters, or Oracle database clustering in simple terms) are three-fold: performance, scalability, and reliability. Which one matters the most to you depends on your needs, but usually having the assurance of database failover is the most valuable, with scalability and performance coming a close second.
In our testing, we used WebLogic 10.0.1 and Oracle 11g (Release 1) on physical machines using Intel Xeon quad-core 2.5Ghz CPUs and 8GBs RAM. The OS was 64-bit RedHat EL 5. In-house, we are typically able to push a single Oracle node to capacity with 3 EP storefront nodes. For our validation testing, with a four storefront configuration, we were utilizing roughly 50-60% capacity on a two node RAC configuration. The following is a rough guide for setting up RAC for EP.
RAC Configuration w/ EP
Deployment and configuration of Oracle Clusterware and Oracle 11g was fairly straight-forward and required no special configuration with Elastic Path, other than the standard RAC connection config outlined below. Oracle's online documentation for the Clusterware set up is excellent and very detailed when you need to drill down.
Once the Clusterware and database are up and running, and your data has been populated, there are many different ways to set up RAC with WebLogic. See the WebLogic documentation for details. WebLogic recommends the use of multi data sources to connect to the RAC nodes. This method supports failover and load-balancing at the application level which is more effective as WebLogic's health monitors can be used and failover is done more quickly than Connect-Time failover or allowing the cluster-ware to handle this. It is recommended to set up a data source for each RAC node. Below is a configuration example for the data source XML; it is based on a two node setup (a data source for each node) and the DS pool.
| WebLogic Data Source Example XML |
|---|
| <jdbc-data-source> <name>jdbcPool</name> <jdbc-driver-params> <url>jdbc:oracle:thin:@lcqsol24:1521:snrac1</url> <driver-name>oracle.jdbc.OracleDriver</driver-name> <properties> <property> <name>user</name> <value>wlsqa</value> </property> </properties> <password-encrypted>{3DES}aP/xScCS8uI=</password-encrypted> </jdbc-driver-params> <jdbc-connection-pool-params> <test-connections-on-reserve>true</test-connections-on-reserve> <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name> </jdbc-connection-pool-params> <jdbc-data-source-params> <jndi-name>jdbcDataSource</jndi-name> </jdbc-data-source-params> </jdbc-data-source> <jdbc-data-source>
<name>jdbcPool2</name> <jdbc-driver-params> <url>jdbc:oracle:thin:@lcqsol25:1521:SNRAC2</url> <driver-name>oracle.jdbc.OracleDriver</driver-name> <properties> <property> <name>user</name> <value>wlsqa</value> </property> </properties> <password-encrypted>{3DES}aP/xScCS8uI=</password-encrypted> </jdbc-driver-params> <jdbc-connection-pool-params> <test-connections-on-reserve>true</test-connections-on-reserve> <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name> </jdbc-connection-pool-params> <jdbc-data-source-params> <jndi-name>jdbcDataSource2</jndi-name> <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol> </jdbc-data-source-params> </jdbc-data-source> <jdbc-data-source>
<name>jdbcNonXAMultiPool</name> <jdbc-data-source-params> <jndi-name>jdbcDataSource</jndi-name> <algorithm-type>Failover</algorithm-type> <data-source-list>jdbcPool,jdbcPool2</data-source-list> <failover-request-if-busy>true</failover-request-if-busy> </jdbc-data-source-params> </jdbc-data-source> |
Fast-Connection-Failover
WebLogic also supports Fast-Connection-Failover (FCF). This mechanism provides a means to receive event notification from the Oracle RAC nodes such as notification and cleanup of invalid connections, load balancing events, and node failures. In order to enable FCF, you must tweak the Oracle JDBC driver and add a couple additional properties to the data source connection such that it knows how to receive the ONS (Oracle Notification System) messages.
To enable FCF on a data source:
- In the WebLogic console, under the data source:
- In Driver Class Name, set the driver class to oracle.jdbc.pool.OracleDataSource.
- In Properties, set the ONS configuration string to subscribe to RAC's ONS messages, for example: ONSConfiguration=nodes=hostname1:port1,hostname2:port2
- Finally, make sure that ONS is properly configured on the RAC nodes and you have no blocking firewalls on those ports on either the RAC nodes or the application server nodes.