Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you have a mirrored SQL cluster but it has no VIP (virtual IP), and you want to connect a DualShield server to the SQL cluster for the purpose of failover redundancy. How can it be achieved?

Image RemovedImage Added

DualShield Authentication Server utilizes JDBC driver to connect to a SQL server. You can achieve it by adding both servers into the JDBC connection string.

Let us look at an example below that connects to one MySQL server. The original JDBC string found in the file named named server.xml:

Code Block
<Resource name="jdbc/DasDS" driverClassName="com.mysql.jdbc.Driver" maxIdle="2" password="changeit" url="jdbc:mysql://localhost:3306/dualshield?useUnicode=true&amp;characterEncoding=UTF-8" username="root" maxActive="1000" type="javax.sql.DataSource" validationQuery="Select 1" maxWait="5000">

To support a failover cluster, you need to change the JDBC string to:

Code Block
<Resource name="jdbc/DasDS" driverClassName="com.mysql.jdbc.Driver" maxIdle="2" password="changeit" url="jdbc:mysql://localhost,;failOverReadOnly=false&amp;characterEncoding=UTF-8" username="root" maxActive="1000" validationQuery="Select 1" maxWait="5000" type="javax.sql.DataSource">

As you can see, we appended the second SQL server after the original one "localhost" separated with comma. Don't forget to also set the failover property:


(its default value was true), otherwise you will get an error "connection is read-only. Queries leading to data modification are not allowed". MS SQL and ORACLE have the similar failover settings in their JDBC connection strings. In MS SQL, it is called "failoverPartner"