Connecting to an Elassandra cluster

Menu

Instaclustr has retired support for Elassandra and now supports Elasticsearch.

Before connecting to the cluster, you need to take note of node addresses and various login credentials.

Node Addresses and Login Credentials

The Connection Info page contains list of Node addresses and login credentials for Cassandra, Elassandra REST API and Kibana.

  1. Click Connection Details from Manage Cluster menu to access the Connection Info page.
  2. On the Connection Info page, you can view Node Addresses under Cassandra Node Addresses section.
  3. Login credentials can be found under Default Credentials for Password Authentication section.
  4. Elassandra REST API credentials and certificates can be found under Elassandra section.
  5. Kibana credentials can be found under Kibana section.

Connecting to the cluster using cqlsh

To connect to the cluster using CQLSH, refer our Connecting to Clusters Using CQLSH support article. Connecting and running CQL commands work the same for Elassandra clusters.

Elassandra REST API

You can also communicate with the cluster through Elassandra REST API. The following examples show how to interact with REST API using curl command. Replace keywords in <> with the corresponding cluster configs (Refer Node Addresses and Login Credentialssection at the start of this article).

  1. To view state of the cluster:

    Output:

  2. To add Index:

    Result:

    The command creates a keyspace called “samples”. View the keyspace using cqlsh:

    Result:

  3. Add Mapping: This adds a table and creates the mapping from CQL Types to Elasticsearch types used in secondary index. It uses the Elasticsearch mapping API with some CQL additions.

    Result:

    Table “earthquakes” is created under keyspace “samples”. View table using cqlsh:

    Result:

  4. Indexing: Rows or documents can be indexed through CQL or via REST

    Result:

  5. Data or documents in a CSV file can be indexed using CQLSH from the command line:
  6. To retrieve a document:

    Result:

    This is equivalent to the following CQL command:

  7. Searching: Following are some examples of search commands using the REST API.Find rows with “Japan” in the title:

    Find rows with specific magnitude:

    Multi Word Query:

    Search for rows that has all the words being searched:

  8. Aggregation: Here is an aggregate query that groups and counts earthquake by magnitude.

    Result:

Site by Swell Design Group