Manage Cassandra Connections
Connect to Cassandra servers to perform individual and batched CQL (Cassandra Query Language) queries.
gateway83
Connect to Cassandra servers to perform individual and batched CQL (Cassandra Query Language) queries.
Access this task using: Tasks, Manage Data Sources, Manage Cassandra Connections. On the browser client, access using the Manage menu.
Cassandra Connection Properties
Setting | What you should know... |
---|---|
Connection Name | Name of the Cassandra connection. Must be unique. |
Contact Points | The addresses of the nodes to connect to within the Cassandra servers. Either IP addresses or DNS names are accepted. Separate entries with commas. Required. |
Port | The TCP port being listened to by the Cassandra servers. All nodes in the Cassandra servers use the same listen port (default 9042). Required. |
Keyspace | The default keyspace the Gateway connects to. If specified, the keyspace reference can be omitted in the Cassandra queries. |
Username/ Password | The log in credentials that are required only if the Cassandra server is configured to require authentication. You can only use passwords visible in the drop-down list or use Manage Stored Password to define one. |
Compression | By default, no compression is used. The LZ4 compression is available for querying the Cassandra servers. |
Use SSL | Select this setting to enable SSL communication with the Cassandra servers. The Cassandra server instance must be configured to support SSL if using this option. Client Certificate Authentication is not supported. |
Cipher Suites | If SSL is enabled, use this setting to view the default cipher suite or to select another suite to use. |
Additional Properties | Define additional properties only if you require specific settings. See "Additional Properties" in this topic for more information. |
Disable Cassandra Connection | Temporarily disables the connection between the Gateway and the Cassandra servers. |
Test Connection | Validates the settings as configured for the Cassandra connection. Testing is possible only when no context variables are used in the settings. |
Connection Caching
The connection manager caches connections that are used by the Perform Cassandra Query Assertion, improving response for subsequent requests. Editing an existing cached connection updates the cached version. Deleting a connection that is cached removes it from the cache. A timer task cleans the cache every 15 minutes.
Simply adding a new connection to the connection manager or testing it does not add it to the cache.
You can configure the cache with the following cluster properties, including disabling the cache altogether:
cassandra.maxConnectionCacheAge
cassandra.maxConnectionCacheIdleTime
cassandra.maxConnectionCacheSize
For more information, see Cassandra Cluster Properties.
You can see the cache status by configuring the log sink to log messages at the FINE level.
Additional Properties
Define these additional properties only if you need a specific setting. If not added, the default values shown are in effect. These defaults work well in most cases.
To alter the defaults for the additional properties, see "Cassandra Cluster Properties".
Property | Description |
---|---|
Connection Pooling Properties: Control the exact number of connections to keep. | |
hostDistance | Determines the distance to the specified Cassandra host. Valid values: IGNORED, LOCAL, REMOTE Default: LOCAL |
maxSimultaneousRequestsPerHostThreshold | The maximum number of simultaneous requests per host. The driver uses a single connection for each LOCAL or REMOTE host. Default: 8192 (hostDistance=LOCAL); 256 (hostDistance=REMOTE) |
Socket Properties: Configure low-level sockets connecting to the nodes. All of the options come from the Java SocketOptions class except for one, the connectTimeoutMillis property, which comes from Netty's ChannelConfig class. | |
connectTimeoutMillis | The connect timeout in milliseconds for the underlying Netty channel. Corresponds to: org.jboss.netty.channel.ChannelConfig "connectTimeoutMillis" |
keepAlive | Corresponds to: java.net.SocketOptions.SO_KEEPALIVE |
receiveBufferSize | A hint on the size of the buffer that is used to receive data. Corresponds to: java.net.SocketOptions.SO_RCVBUF |
reuseAddress | Whether to allow the same port to be bound to multiple times. Corresponds to: java.net.SocketOptions.SO_REUSEADDR |
sendBufferSize | A hint on the size of the buffer that is used to send data. Corresponds to: java.net.SocketOptions.SO_SNDBUF |
soLinger | When specified, disables the immediate return from a call to close() on a TCP socket. Corresponds to: java.net.SocketOptions.SO_LINGER |
tcpNoDelay | Disables Nagle's algorithm on the underlying socket. Corresponds to: java.net.SocketOptions.TCPNODELAY |
Query Option | |
readTimeoutMillis | The read timeout in milliseconds. Defines how long the driver waits for a given Cassandra node to answer a query. Default: 12000 |
Frequently Asked Questions
Question | Answer |
---|---|
Can I define a connection that is not yet valid? | Yes. Invalid or incomplete connections can be saved, provided that all the required settings have been entered. |
Why can't I enter the username's password here? | For security, all passwords are defined in the Gateway's secure password store and can only be selected here. For more information, see Manage Stored Passwords. |
What happens if I don't specify any additional properties? | In this case, all the defaults shown in "Additional Properties" are in effect. |