Chapter 29. Using Red Hat JBoss Data Grid with Microsoft Azure
JDBC_PING- Discovery protocol that utilizes a shared database.TCPGOSSIP- Discovery protocol that utilizes shared GossipRouter processes.
TCPPING may be used instead. An example configuration using TCPPING is found in Section 26.1.3, “Configure JGroups Socket Binding”.
29.1. The JDBC_PING JGroups Protocol Copy linkLink copied to clipboard!
JDBC_PING discovery protocol uses a shared database to store information about the nodes in the cluster. With Microsoft Azure this should be a SQL database, and once the database has been created the JDBC connection URL may be performing the following steps:
- Select the properties of the SQL Database to be used.
- Navigate to the Connection Propertiessection and click the Show database connection strings link
- Click JDBC Connection URL. This value will be used for the
connection_urlproperty when configuringJDBC_PING.
connection_url has been retrieved, the SQL Driver may be obtained from Microsoft JDBC Drivers for SQL Server. This driver will be used in the following steps.
The following parameters must be defined, and are used to connect to the SQL database:
connection_url- the JDBC Connection URL obtained in the above steps.connection_username- The database username, obtained from theconnection_url.connection_password- The database password, obtained from theconnection_url.connection_driver- The driver used to connect to the database. The application or server must include the JDBC driver JAR file on the classpath.
In Library Mode the JGroups xml file should be used to configure JDBC_PING; however, there is no JDBC_PING configuration included by default. It is recommended to use one of the preexisting files specified in Section 26.2.2, “Pre-Configured JGroups Files” and then adjust the configuration to include JDBC_PING. For instance, default-configs/default-jgroups-ec2.xml could be selected and the S3_PING protocol removed, and then the following block added in its place:
<JDBC_PING connection_url="${jboss.jgroups.jdbc_ping.connection_url:}"
connection_username="${jboss.jgroups.jdbc_ping.connection_username:}"
connection_password="${jboss.jgroups.jdbc_ping.connection_password:}"
connection_driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
/>
<JDBC_PING connection_url="${jboss.jgroups.jdbc_ping.connection_url:}"
connection_username="${jboss.jgroups.jdbc_ping.connection_username:}"
connection_password="${jboss.jgroups.jdbc_ping.connection_password:}"
connection_driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
/>
In Remote Client-Server Mode a stack may be defined for JDBC_PING in the jgroups subsystem of the server's configuration file. The following configuration snippet contains an example of this: