Apache Cassandra, a prominent NOSQL database, is supported by the DataStax driver stack. While DataStax provides a Java driver (among other language bindings), it is not a JDBC driver. QuerySurge (similar to other data tools) requires a JDBC driver to connect to Cassandra, and the need for a JDBC- compliant driver has been filled by an open source wrapper around the DataStax Java driver. The driver documentation is available on GitHub, as a "fat" wrapper with all dependencies included (see step 1 below). Note that the wrapper is released under the Apache 2.0 license. Setup details for using the Cassandra JDBC wrapper for the DataStax Java Driver with QuerySurge follow.
Setting up a QuerySurge Connection with the Cassandra JDBC DataStax Wrapper
A QuerySurge Connection to Cassandra is set up using the Connection Extensibility feature of the QuerySurge Connection Wizard. Following are the details you'll need to set up your QuerySurge Connection to Cassandra with the "fat" DataStax wrapper.
- Download the "fat" DataStax wapper. You can download the fat driver wrapper with all dependencies here (there may be multiple versions available for download; we've successfully connected to Cassandra with the final cassandra-jdbc-wrapper-3.1.0-SNAPSHOT.jar download).
- Deploy the Cassandra JDBC driver to your Agent(s). The procedure for deploying a new driver to a QuerySurge Agent is here (for Agents on Windows) and here (for Agents on Linux).
- Log into QuerySurge as a QuerySurge Admin user, and navigate to the Admin view. Steps for using the Connection Extensibility feature can be found here. To use the Connection Extensibility option in the Connection Wizard with the DataStax wrapper, you'll need the following information:
You'll need to provide the server and the port number. For the server, use either the fully qualified name of the server or the server IP address. Verify the port with a Cassandra admin or knowledgeable resource; port 9042 is the default Cassandra port. In addition, you should provide the keyspace that you want to connect to. Authentication credentials are typically needed as well. When you've entered your information, the Connection Wizard will look like:
Note: You may want or need a more elaborate JDBC URL; see the GitHub documentation for details.
- If you have a CQL Test Query, feel free to enter it in order to verify that your Connection parameters are correct. It should be a standard query that returns a small amount of information - one row is enough. You can use the Test Connection button if you've entered a Test Query:
Note: This driver deployment is dependent on open-source software that may or may not be maintained for future Apache Cassandra releases.
- Once you have the information entered and (optionally) verified, click the Save button to save the Connection. You're ready to use the Connection in a QueryPair.