Apache Tomcat/7.0.54 CentOS release 6.7 AWS RDS Aurora 5.6.10a Using RDS in a failover configuration, AWS directs requests to the write instance with a cluster CNAME e.g. dbname-cluster.cluster-id.us-west-2.rds.amazonaws.com, and the read-only instance to it's canonical name e.g. dbname-us-west-2c.id.us-west-2.rds.amazonaws.com. Connections are established to the IP address of the writer. After a failover the original writer and reader instances change roles, but the application continues to send traffic to the original writer, which now has become read-only. This results in errors and requires Tomcat to be restarted.
A confirmed fix is to disable DNS cache by setting networkaddress.cache.ttl=0 in $JAVA_HOME/jre/lib/security/java.security. A downside is the loss of DNS cache for other network calls from the application. I'm looking for a method to periodically test the state of the database, and if determined to be read-only, create new connections. By that time, failover will have completed and new requests to the CNAME will then result to the writer instance. I've read some on jdbcInterceptors and connection state, but nothing strikes me as a method to test the database is read-only then take action. I'd like help if you know of connection settings I can try, or feedback if disabling DNS cache seems a reasonable solution. Cheers David -- Web: http://www.developerprogram.com 2300 Greenhill Drive, Suite 400 Round Rock, Texas, 78664 *"Developer and Partner Programs Done Right"* NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. Nothing contained in this message or in any attachment shall constitute a contract or electronic signature under the Electronic Signatures in Global and National Commerce Act, any version of the Uniform Electronic Transactions Act or any other statute governing electronic transactions. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org