Saturday, August 26, 2023

 

Azure managed instance for Apache Cassandra is an open-source NoSQL distributed database that is trusted by thousands of companies for scalability and high availability without compromising performance. Linear scalability and proven fault tolerance on commodity hardware or cloud infrastructure makes it the perfect platform for mission critical data.

One of the most common concerns with this resource is how to connect to it. Azure Managed Instance for Apache Cassandra does not create nodes with public IP addresses, so to connect to a newly created Cassandra cluster, one will need to create another resource inside the VNet. This could be an application, or a Virtual Machine with Apache’s open-source query tool CSQLSH installed.  The Azure Portal may also provide connection strings that have all the necessary credentials to connect with the instance using this tool.

CSQLSH is a command-line shell interface for interacting with Cassandra using CQL (Cassandra Query Language). It is shipped with every Cassandra package and can be found in the bin/ directory. It is implemented with the Python native protocol driver and connects to the single specified node.

The configuration options for this tool are in the ~/.cassandra/cqlsh/.csqlshrc file. All CQL commands executed are written to a history file. The three essential operations for connecting to the Cassandra cluster are the database server’s host name or IP address, the correct connection port, and the username and password if using the authentication.

This would look something like this:

export SSL_VERSION=TLSv1_2

export SSL_VALIDATE=false

host=(“<IP>”)

initial_admin_password=”Password provided when creating the cluster”

csqlsh $host 9042 -u cassandra -p $Initial_admin_password --ssl

 

The az cli command for this resource type allows us to manage the cluster and the datacenters for the instance and most commands start with the az managed-cassandra prefix but they do not help with data plane operations for which the best bet is the CSQLSH once the connectivity is established.

The management operations in Azure Managed Instance for Apache Cassandra include compaction, patching, and maintenance. Out of these the nodetool utility is frequently used for repairs. The nodetool repair is automatically run by the service called reaper. Nodetool repairs one or more tables and performing an anti-entropy node repair on a regular basis helps with the maintenance.

The azure cli command provides a way to invoke the nodetool with the invoke-command option for an instance.

 

No comments:

Post a Comment