### Start Elassandra Node Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/README.md After downloading and extracting Elassandra, and setting the CASSANDRA_HOME environment variable, start a node using the provided script. Ensure Java 8 is installed and JAVA_HOME is correctly set. ```bash bin/cassandra -e ``` -------------------------------- ### Start Elassandra with SysV Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/installation.md Start the Elassandra service using the older SysV init system. ```bash sudo service cassandra start ``` -------------------------------- ### Install Elassandra via Tarball Source: https://context7.com/strapdata/elassandra/llms.txt Download, extract, configure, and start Elassandra with Elasticsearch enabled. Verify node status and Elasticsearch API. ```bash # Download and extract wget https://github.com/strapdata/elassandra/releases/download/v6.8.4.16/elassandra-6.8.4.16.tar.gz tar -xzf elassandra-6.8.4.16.tar.gz cd elassandra-6.8.4.16 # Start with Elasticsearch enabled bin/cassandra -e # Verify Cassandra node status bin/nodetool status # Verify Elasticsearch HTTP API curl -X GET http://localhost:9200/ # Expected response: # { # "name" : "127.0.0.1", # "cluster_name" : "Test Cluster", # "version" : { "number" : "6.8.4.16", ... }, # "tagline" : "You Know, for Search" # } ``` -------------------------------- ### Start Elassandra with Systemd Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/installation.md Start the Elassandra service using Systemd, the standard init system for many Linux distributions. ```bash sudo systemctl start cassandra ``` -------------------------------- ### Start Elassandra Service with Systemd Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_rpm.md Use this command to start the Elassandra service if your system uses systemd for service management. ```bash sudo systemctl start cassandra ``` -------------------------------- ### Start Elassandra Service with SysV Init Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_rpm.md Use this command to start the Elassandra service if your system uses SysV init for service management. ```bash sudo service cassandra start ``` -------------------------------- ### Start and Scale Elassandra Cluster Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/quickstart.md Commands to start the Docker containers and scale the Elassandra cluster. Use `--scale node=0` to start with only the seed node, then scale up as needed. ```bash docker-compose --project-name test -f docker-compose.yml up -d --scale node=0 docker-compose --project-name test -f docker-compose.yml up -d --scale node=1 ``` -------------------------------- ### Install Elassandra via Helm Chart Source: https://context7.com/strapdata/elassandra/llms.txt Install Elassandra on Kubernetes using a Helm chart. Verifies pods and services after installation. ```bash helm repo add strapdata https://charts.strapdata.com helm install -n elassandra --set image.tag="6.8.4.16" strapdata/elassandra helm status elassandra # Verify pods and services kubectl get all -o wide -n elassandra # Expected: 3-node StatefulSet + cassandra and elasticsearch ClusterIP services ``` -------------------------------- ### Install APT Utilities Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_deb.md Installs necessary utilities for managing APT repositories and GPG keys, which are required before adding custom repositories. ```bash sudo apt-get install software-properties-common apt-transport-https gnupg2 ``` -------------------------------- ### Install Elassandra Dependencies Source: https://github.com/strapdata/elassandra/wiki/Setup-Elassandra-on-Debian Installs Python pip, build essentials, and libev for Elassandra. ```bash sudo apt-get install python-pip sudo apt-get install build-essential python-dev sudo apt-get install libev4 libev-dev ``` -------------------------------- ### Install Java 1.8 on Debian Jessie Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_deb.md Installs the Java Runtime Environment 1.8, required for Elassandra, on Debian Jessie from backports. Ensure you have `apt-transport-https` and other utilities installed. ```bash sudo apt-get install -t jessie-backports openjdk-8-jre-headless ``` -------------------------------- ### Install Curl Source: https://github.com/strapdata/elassandra/wiki/Setup-Elassandra-on-Debian Installs the curl utility, often needed for interacting with services. ```bash Apt-get install curl ``` -------------------------------- ### Install Elasticsearch plugin Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/integration.md Standard command for installing Elasticsearch plugins. Replace `` with the actual URL of the plugin. ```bash bin/plugin install ``` -------------------------------- ### Update APT and Install Elassandra Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_deb.md Updates the package list after adding the new repository and then installs the Elassandra package. This command ensures you get the latest version available from the added repository. ```bash sudo apt-get update && sudo apt-get install elassandra ``` -------------------------------- ### Start Elassandra Service Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_deb.md Starts the Elassandra service using either Systemd or SysV init scripts. Use the appropriate command based on your system's init system. ```bash sudo systemctl start cassandra ``` ```bash sudo service cassandra start ``` -------------------------------- ### Verify Java Installation Source: https://github.com/strapdata/elassandra/wiki/Setup-Elassandra-on-Debian Checks the installed Java version to confirm successful installation. ```bash java -version ``` -------------------------------- ### Run Elassandra Docker Instance Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/installation.md Start a single Elassandra server instance using Docker. The container is named 'node0' and uses a specific version tag. ```default docker run --name node0 -d strapdata/elassandra:6.8.4.16 ``` -------------------------------- ### Start Elassandra Server Instance Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/docker.md Launches a detached Elassandra Docker container named 'node0' using a specific version. ```bash docker run --name node0 -d strapdata/elassandra:6.8.4.16 ``` -------------------------------- ### Create Cassandra Table and Insert Data Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/mapping.md Sets up a Cassandra keyspace and table with a map column, then inserts initial data. This is a prerequisite for dynamic mapping examples. ```cql CREATE KEYSPACE IF NOT EXISTS twitter WITH replication={ 'class':'NetworkTopologyStrategy', 'DC1':'1' }; CREATE TABLE twitter.user ( name text, attrs map, PRIMARY KEY (name) ); INSERT INTO twitter.user (name,attrs) VALUES ('bob',{'email':'bob@gmail.com','firstname':'bob'}); ``` -------------------------------- ### Navigate to Elassandra Directory Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/installation.md Change the current directory to the extracted Elassandra installation folder. ```bash cd elassandra-6.8.4.16 ``` -------------------------------- ### Install Elassandra Package Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_rpm.md Use this command to install the Elassandra package after configuring the repository. This command assumes you are using a YUM-based package manager. ```bash sudo yum install elassandra ``` -------------------------------- ### Install Elassandra via Docker Source: https://context7.com/strapdata/elassandra/llms.txt Run a single Elassandra node using Docker. Verify status via nodetool, cqlsh, and Elasticsearch API. ```bash # Single node docker run --name node0 -d strapdata/elassandra:6.8.4.16 # Verify via nodetool, cqlsh and Elasticsearch docker exec -it node0 nodetool status docker exec -it node0 cqlsh docker exec -it node0 curl localhost:9200 ``` -------------------------------- ### Install Elassandra Helm Chart Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/helm.md Install the Elassandra chart on your Kubernetes cluster. Specify the namespace and the desired image tag for the Elassandra version. ```bash helm install -n elassandra --set image.tag="6.8.4.16" strapdata/elassandra ``` -------------------------------- ### Start Cassandra-only nodes in a new datacenter Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/integration.md Use this command to start Cassandra-only nodes in a new datacenter during the integration process. Ensure auto_bootstrap is set to false in cassandra.yaml before running. ```bash bin/cassandra ``` -------------------------------- ### Check Java Version Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/installation.md Verify the installed Java version on your system. Elassandra requires at least Java 8. ```bash $ java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) ``` -------------------------------- ### Setup Cassandra Keyspace, Table, and Data for Parent-Child Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/mapping.md This snippet demonstrates the CQL commands to create a keyspace, a table with parent-child relationship fields, and insert sample data. It's a prerequisite for setting up parent-child mapping in Elassandra. ```cql cqlsh <domain org.elasticsearch.index #domain is set to org.elasticsearch.index $>bean org.elasticsearch.index:name=sales_2017,scope=search,type=IndexShard #bean is set to org.elasticsearch.index:name=sales_2017,scope=search,type=IndexShard $>get * #mbean = org.elasticsearch.index:name=sales_2017,scope=search,type=IndexShard: QueryTotal = 21; FetchTotal = 0; ScrollTotal = 0; QueryTimeInMillis = 56038; QueryCurrent = 0; FetchTimeInMillis = 0; FetchCurrent = 0; ScrollTimeInMillis = 0; ScrollCurrent = 0; SuggestCount = 0; SuggestTimeInMillis = 0; SuggestCurrent = 0; $> ``` -------------------------------- ### Submit Spark job with Elassandra-Hadoop connector Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/integration.md Example command to submit a Spark job in client mode using the Elassandra-Hadoop connector. Replace placeholders with your specific paths and master URL. ```bash bin/spark-submit --driver-class-path /elasticsearch-spark_2.10-2.2.0.jar --master spark://:7077 --deploy-mode client ``` -------------------------------- ### Decode Index Metadata using Elassandra CLI Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/operations.md This example shows how to retrieve table extensions using cqlsh and then decode the index metadata from the Smile-encoded string using the elassandra-cli. ```bash $CASSANDRA_HOME/bin/cqlsh -e "select extensions from system_schema.tables where keyspace_name = 'test' and table_name = 'docs';" extensions ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {'elastic_admin/test': 0x3a290a05fa...986616c6961736573fafbfbfb} (1 rows) $CASSANDRA_HOME/bin/elassandra-cli decodeIndexMetadata -s "0x3a290a05fa...986616c6961736573fafbfbfb" Decoding : [0x3a290a05fa...986616c6961736573fafbfbfb] { "test" : { "version" : 1, "state" : "open", "settings" : { "index.creation_date" : "1569831034865", "index.provided_name" : "test", "index.uuid" : "4tne58smR7e5nwOrdD1VvA", "index.version.created" : "6020399" }, "mappings" : [ { "docs" : { "properties" : { "login" : { "type" : "keyword", "cql_collection" : "singleton" }, "uid" : { "type" : "integer", "cql_collection" : "singleton", "cql_partition_key" : true, "cql_primary_key_order" : 0 }, "username" : { "type" : "nested", "cql_collection" : "singleton", "cql_udt_name" : "user_type", "properties" : { "first" : { "type" : "keyword", "cql_collection" : "singleton" }, "last" : { "type" : "keyword", "cql_collection" : "singleton" } } } } } } ], "aliases" : { } } } ``` -------------------------------- ### List Kubernetes Resources in Elassandra Namespace Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/helm.md Display all Kubernetes resources within the 'elassandra' namespace after installation. This includes pods, services, and stateful sets, providing a comprehensive overview of the deployed components. ```bash kubectl get all -o wide -n elassandra ``` -------------------------------- ### Elassandra Build Unit Test Example Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/testing.md This test class demonstrates using both Elasticsearch API and CQL requests within an Elassandra build unit test. It sets up an index, inserts data, and performs queries. ```java public class BasicTests extends ESSingleNodeTestCase { @Test public void testTest() throws Exception { createIndex("cmdb"); ensureGreen("cmdb"); process(ConsistencyLevel.ONE,"CREATE TABLE cmdb.server ( name text, ip inet, netmask int, prod boolean, primary key (name))"); assertAcked(client().admin().indices().preparePutMapping("cmdb") .setType("server") .setSource("{ \"server\" : { \"discover\" : \".*\", \"properties\": { \"name\":{ \"type\":\"keyword\" }}}}) .get()); process(ConsistencyLevel.ONE,"insert into cmdb.server (name,ip,netmask,prod) VALUES ('localhost','127.0.0.1',8,true)"); process(ConsistencyLevel.ONE,"insert into cmdb.server (name,ip,netmask,prod) VALUES ('my-server','123.45.67.78',24,true)"); assertThat(client().prepareGet().setIndex("cmdb").setType("server").setId("my-server").get().isExists(), equalTo(true)); assertThat(client().prepareGet().setIndex("cmdb").setType("server").setId("localhost").get().isExists(), equalTo(true)); assertEquals(client().prepareIndex("cmdb", "server", "bigserver234") .setSource("{\"ip\": \"22.22.22.22\", \"netmask\":32, \"prod\" : true, \"description\": \"my big server\" }") .get().getResult(), DocWriteResponse.Result.CREATED); assertThat(client().prepareSearch().setIndices("cmdb").setTypes("server").setQuery(QueryBuilders.queryStringQuery("*:*")).get().getHits().getTotalHits(), equalTo(3L)); } } ``` -------------------------------- ### Run Specific Microbenchmark with Gradle Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/benchmarks/README.md Execute a specific benchmark class using Gradle by passing arguments to JMH. Ensure the argument is enclosed in single quotes and starts with a space. ```bash gradlew -p benchmarks run --args ' AllocationBenchmark' ``` -------------------------------- ### Recursive Join Query Example Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/enterprise.md Demonstrates a recursive join query to find books with specific criteria across multiple tables. Ensure the 'books', 'citations', and 'editions' indexes are properly configured. ```json GET /books/_search?pretty { "query":{ "join":{ "index":"citations", "query":{ "bool":{ "must": [ { "match":{ "words":"minds"}}, { "join":{ "index":"editions", "query":{ "term": { "available":"true" }} } } ] } } } } } ``` -------------------------------- ### Gradle Dependencies for Elassandra Unit Tests Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/enterprise.md Add these Gradle dependencies to your project for Elassandra Unit testing. This setup allows for authenticated Elasticsearch queries via CQL. ```default dependencies { test 'com.strapdata.elasticsearch.plugin:strapdata-plugin:${elassandra.version}' test 'com.strapdata.elasticsearch.plugin:strapdata-core:${elassandra.version}' } ``` -------------------------------- ### Configure Cassandra Schema with CQL Mapper Extensions Source: https://context7.com/strapdata/elassandra/llms.txt Use `cql_*` parameters in the Elasticsearch mapping to control Cassandra type mapping, including primary key and partition key configurations. This example demonstrates setting up a timeseries index with specific CQL properties. ```bash # Create an index with explicit CQL primary key and partition key configuration curl -XPUT -H 'Content-Type: application/json' "http://localhost:9200/test" -d '{ "mappings" : { "timeseries" : { "properties" : { "m" : { "type" : "keyword", "cql_partition_key" : true, "cql_primary_key_order" : 0, "cql_collection" : "singleton" }, "t" : { "type" : "date", "format" : "strict_date_optional_time||epoch_millis", "cql_primary_key_order" : 1, "cql_collection" : "singleton" }, "v" : { "type" : "double", "cql_collection" : "singleton" }, "meta" : { "type" : "nested", "cql_struct" : "map", "cql_static_column" : true, "cql_collection" : "singleton", "include_in_parent" : true, "index_static_document": true, "index_static_columns": true, "properties" : { "region" : { "type" : "keyword" } } } } } } }' # Insert timeseries rows via CQL bin/cqlsh -e " INSERT INTO test.timeseries (m, t, v) VALUES ('server1-cpu', '2016-04-10 13:30', 10); INSERT INTO test.timeseries (m, t, v) VALUES ('server1-cpu', '2016-04-10 13:31', 20); INSERT INTO test.timeseries (m, meta) VALUES ('server1-cpu', { 'region':'west' }); " # Search for wide rows where v=10 curl -XGET "http://localhost:9200/test/timeseries/_search?pretty=true&q=v:10&fields=m,t,v,meta.region,_source" ``` -------------------------------- ### Index Document with Nested Object and Verify Schema Source: https://context7.com/strapdata/elassandra/llms.txt This example demonstrates indexing a document with a nested object using `curl` and then verifying the document and the generated Cassandra User Defined Types (UDTs) and table schema using `cqlsh`. Nested objects are automatically mapped to frozen UDTs. ```bash # Index a document with a nested object curl -XPUT -H 'Content-Type: application/json' 'http://localhost:9200/twitter/tweet/1' -d '{ "user" : { "name" : { "first_name" : "Vincent", "last_name" : "Royer" }, "uid" : "12345" }, "message" : "This is a tweet!" }' # Verify the source document curl -XGET 'http://localhost:9200/twitter/tweet/1/_source' # {"message":"This is a tweet!","user":{"uid":["12345"],"name":[{"first_name":["Vincent"],"last_name":["Royer"]}]}} # View the generated CQL UDTs and table bin/cqlsh -e "DESCRIBE KEYSPACE twitter;" # CREATE TYPE twitter.tweet_user_name (last_name frozen>, first_name frozen>); # CREATE TYPE twitter.tweet_user (name frozen>>, uid frozen>); # CREATE TABLE twitter.tweet ("_id" text PRIMARY KEY, message list, user list>) ``` -------------------------------- ### Check Elassandra Enterprise Plugin Activation Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/enterprise.md Use this GET request to verify if the Elassandra Enterprise plugin is active on your nodes. The response will list installed plugins, including 'strapdata-plugin' if Enterprise is enabled. ```default GET _nodes/plugins?pretty ... "plugins" : [ { "name" : "org.apache.cassandra.service.ElassandraDaemon$ElassandraPlugin", "version" : "NA", "description" : "classpath plugin", "classname" : "org.apache.cassandra.service.ElassandraDaemon$ElassandraPlugin", "extended_plugins" : [ ], "has_native_controller" : false, "requires_keystore" : false }, { "name" : "strapdata-plugin", "version" : "6.2.3.13", "description" : "Strapdata Enterprise plugin version 6.2.3.13", "classname" : "com.strapdata.elasticsearch.plugin.EnterprisePlugin", "extended_plugins" : [ ], "has_native_controller" : false, "requires_keystore" : false } ], .... ``` -------------------------------- ### Elassandra Docker Compose Cluster with Kibana Source: https://context7.com/strapdata/elassandra/llms.txt Defines a Docker Compose setup for an Elassandra cluster with a seed node, additional nodes, and Kibana. Includes commands to start and check cluster status. ```yaml version: '2.4' services: seed_node: image: "docker.io/strapdata/elassandra:6.8.4.3" environment: - "JVM_OPTS=-Dcassandra.custom_query_handler_class=org.elassandra.index.ElasticQueryHandler" - "MAX_HEAP_SIZE=1200m" - "HEAP_NEWSIZE=300m" - "CASSANDRA_CGROUP_MEMORY_LIMIT=true" cap_add: - IPC_LOCK ulimits: memlock: -1 mem_limit: 2000m ports: - "9042:9042" - "9200:9200" node: image: "docker.io/strapdata/elassandra:6.8.4.3" environment: - "JVM_OPTS=-Dcassandra.custom_query_handler_class=org.elassandra.index.ElasticQueryHandler" - "MAX_HEAP_SIZE=1200m" - "HEAP_NEWSIZE=300m" - "CASSANDRA_SEEDS=seed_node" links: - seed_node cap_add: - IPC_LOCK ulimits: memlock: -1 mem_limit: 2000m kibana: image: docker.elastic.co/kibana/kibana-oss:6.8.4 environment: - "ELASTICSEARCH_URL=http://seed_node:9200" ports: - "5601:5601" mem_limit: 500m ``` ```bash # Start and scale up docker-compose --project-name test -f docker-compose.yml up -d --scale node=0 docker-compose --project-name test -f docker-compose.yml up -d --scale node=1 # Check cluster status docker exec -i test_seed_node_1 nodetool status ``` -------------------------------- ### Build Documentation Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/CONTRIBUTING.md Command to build the Elassandra documentation using Sphinx. Ensure you are in the correct directory. ```bash make html ``` -------------------------------- ### Build Elassandra v5.x Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/CONTRIBUTING.md Command to build Elassandra version 5.x from sources. ```bash gradle clean assemble -Dbuild.snapshot=false ``` -------------------------------- ### Configure Elassandra YUM Repository Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/adhoc_rpm.md Create this file in /etc/yum.repos.d/ to add the Elassandra repository. Ensure you have the correct distribution-specific directory if not using Red Hat. ```default [strapdata] name=Strapdata baseurl=https://nexus.repo.strapdata.com/repository/rpm-releases/ enabled=1 gpgcheck=0 priority=1 [strapdata-snapshots] name=Strapdata Snapshots baseurl=https://nexus.repo.strapdata.com/repository/rpm-snapshots/ enabled=1 gpgcheck=0 priority=1 ``` -------------------------------- ### Get Elasticsearch Cluster State Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/quickstart.md Retrieve the current state of the Elasticsearch cluster. This is useful for monitoring and debugging. ```default curl "http://localhost:9200/_cluster/state?pretty" { "cluster_name" : "Test Cluster", "compressed_size_in_bytes" : 579, "version" : 8, "state_uuid" : "mrE5raXOQO2SVA8AROJqwQ", "master_node" : "25457162-c5ef-44fa-a46b-a96434aae319", "blocks" : { }, "nodes" : { "25457162-c5ef-44fa-a46b-a96434aae319" : { "name" : "172.17.0.2", "status" : "ALIVE", "ephemeral_id" : "25457162-c5ef-44fa-a46b-a96434aae319", "transport_address" : "172.17.0.2:9300", "attributes" : { "rack" : "r1", "dc" : "DC1" } } }, "metadata" : { "version" : 1, "cluster_uuid" : "25457162-c5ef-44fa-a46b-a96434aae319", "templates" : { }, "indices" : { "test" : { "state" : "open", "settings" : { "index" : { "creation_date" : "1553512833429", "number_of_shards" : "1", "number_of_replicas" : "0", "uuid" : "BOolxI89SqmrcbK7KM4sIA", "version" : { "created" : "6020399" }, "provided_name" : "test" } }, "mappings" : { "docs" : { "properties" : { "uid" : { "cql_partition_key" : true, "cql_primary_key_order" : 0, "type" : "integer", "cql_collection" : "singleton" }, "login" : { "type" : "keyword", "cql_collection" : "singleton" }, "username" : { "cql_udt_name" : "user_type", "type" : "nested", "properties" : { "last" : { "type" : "keyword", "cql_collection" : "singleton" }, "first" : { "type" : "keyword", "cql_collection" : "singleton" } }, "cql_collection" : "singleton" } } } }, "aliases" : [ ], "primary_terms" : { "0" : 0 }, "in_sync_allocations" : { "0" : [ ] } } }, "index-graveyard" : { "tombstones" : [ ] } }, "routing_table" : { "indices" : { "test" : { "shards" : { "0" : [ { "state" : "STARTED", "primary" : true, "node" : "25457162-c5ef-44fa-a46b-a96434aae319", "relocating_node" : null, "shard" : 0, "index" : "test", "token_ranges" : [ "(-9223372036854775808,9223372036854775807]" ], "allocation_id" : { "id" : "dummy_alloc_id" } } ] } } } }, "routing_nodes" : { "unassigned" : [ ], "nodes" : { "25457162-c5ef-44fa-a46b-a96434aae319" : [ { "state" : "STARTED", "primary" : true, "node" : "25457162-c5ef-44fa-a46b-a96434aae319", "relocating_node" : null, "shard" : 0, "index" : "test", "token_ranges" : [ "(-9223372036854775808,9223372036854775807]" ], "allocation_id" : { "id" : "dummy_alloc_id" } } ] } }, "snapshots" : { "snapshots" : [ ] }, "restore" : { "snapshots" : [ ] }, "snapshot_deletions" : { "snapshot_deletions" : [ ] } } ``` -------------------------------- ### Build Elassandra v6.2.x Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/CONTRIBUTING.md Command to build Elassandra version 6.2.x from sources, setting specific JAVA_HOME and CASSANDRA_JAVA_HOME. ```bash export JAVA_HOME=/path/to/jdk-10 export CASSANDRA_JAVA_HOME=/path/to/jdk-8 ./gradlew clean assemble -Dbuild.snapshot=false ``` -------------------------------- ### java.text.StringCharacterIterator Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/java.text.txt A text iterator that iterates over a String. It provides methods to get the current character, index, and set the text. ```APIDOC ## Class: java.text.StringCharacterIterator ### Description Provides an iterator for traversing characters within a String, allowing access to the current character and index. ### Constructors - `StringCharacterIterator(String text)`: Constructs an iterator for the specified string. - `StringCharacterIterator(String text, int pos)`: Constructs an iterator for the specified string with the initial position set. - `StringCharacterIterator(String text, int start, int end, int pos)`: Constructs an iterator for the specified string with start, end, and initial position set. ### Methods - `void setText(String text)`: Sets the text for this iterator. ``` -------------------------------- ### java.text.ParsePosition Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/java.text.txt Represents a position in a string for parsing. It includes methods to get and set the current index and the error index. ```APIDOC ## Class: java.text.ParsePosition ### Description Provides a way to track the current position during parsing and report any errors encountered. ### Methods - `int getErrorIndex()`: Returns the index at which the error occurred. - `int getIndex()`: Returns the current index in the text. - `void setErrorIndex(int errorIndex)`: Sets the index at which an error occurred. - `void setIndex(int index)`: Sets the current index in the text. ``` -------------------------------- ### Fetch Cassandra Submodule Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/CONTRIBUTING.md If you forgot --recurse-submodules during cloning, use these commands to fetch the Cassandra submodule and checkout the strapdata branch. ```bash git submodule update --init git checkout cassandra-3.x-strapdata ``` -------------------------------- ### Query CQL Audit Events Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/enterprise.md Example of querying audit events stored in the 'elastic_audit.events' Cassandra table using cqlsh. ```sql cassandra@cqlsh> select * from elastic_audit.events ; node | event | action | indices | level | login | role | source | status ----------+--------------------------------------+-------------------------------+-------------+------------+--------+--------------+----------+-------- 10.0.0.4 | cf74fed0-b5a2-11e7-9508-157b11ac2561 | cluster:monitor/main | null | PRIVILEGE | kibana | roles/kibana | 10.0.1.5 | 200 10.0.0.4 | d2026070-b5a2-11e7-9508-157b11ac2561 | cluster:monitor/state | null | PRIVILEGE | kibana | roles/kibana | 10.0.1.5 | 200 10.0.0.4 | da709470-b5a2-11e7-9508-157b11ac2561 | indices:data/read/search | ['sales_*'] | PERMISSION | sales | roles/sales | 10.0.1.5 | 200 10.0.0.4 | d8025390-b5a2-11e7-9508-157b11ac2561 | cluster:monitor/health | ['.kibana'] | PRIVILEGE | kibana | roles/kibana | 10.0.1.5 | 200 10.0.0.4 | cf9de390-b5a2-11e7-9508-157b11ac2561 | cluster:monitor/nodes/info | null | PRIVILEGE | kibana | roles/kibana | 10.0.1.5 | 200 ``` -------------------------------- ### Set CQL Consistency Level Source: https://context7.com/strapdata/elassandra/llms.txt Configure the CQL consistency level using `wait_for_active_shards`. For example, 'quorum' maps to 'LOCAL_QUORUM'. ```bash # Set CQL consistency level via wait_for_active_shards (quorum = LOCAL_QUORUM) curl -XPUT -H 'Content-Type: application/json' "http://localhost:9200/twitter/tweet/1?wait_for_active_shards=quorum" \ -d '{"user":"alice","message":"hello"}' ``` -------------------------------- ### Check Elasticsearch API Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/installation.md Verify that the Elasticsearch API is accessible and returning expected information by sending a GET request to the root endpoint. ```bash curl -X GET http://localhost:9200/ ``` -------------------------------- ### Add Elassandra Helm Repository Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/helm.md Add the Strapdata Helm repository to your local Helm configuration. This command is necessary before you can install any charts from this repository. ```bash helm repo add strapdata https://charts.strapdata.com ``` -------------------------------- ### Enable JMXMP in jvm.options Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/operations.md To enable JMXMP support, add the -Dcassandra.jmxmp system property to the jvm.options file. ```bash -Dcassandra.jmxmp ``` -------------------------------- ### GET Document by ID Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/operations.md Retrieve a specific document from an index using its ID. Useful for verifying data existence or fetching individual records. ```bash curl -XGET 'http://localhost:9200/twitter/user/kimchy?pretty=true' ``` ```bash curl -XGET 'http://localhost:9200/twitter/tweet/1?pretty=true' ``` ```bash curl -XGET 'http://localhost:9200/twitter/tweet/2?pretty=true' ``` -------------------------------- ### Bulk Indexing Benchmark Invocation Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/client/benchmark/README.md Run a bulk indexing benchmark. Ensure benchmark data is downloaded and placed in the correct directory. Parameters include client type, benchmark type, host, data file, index name, type name, document count, and bulk size. ```bash wget http://benchmarks.elasticsearch.org.s3.amazonaws.com/corpora/geonames/documents-2.json.bz2 bzip2 -d documents-2.json.bz2 mv documents-2.json client/benchmark/build gradlew -p client/benchmark run --args ' rest bulk localhost build/documents-2.json geonames type 8647880 5000' ``` -------------------------------- ### ClassNotFoundException Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/java.lang.txt A class is found, but it is not possible to load it as a class. For example, if the file defining the class is missing or if the file defining the class is not a valid class file. ```APIDOC ## ClassNotFoundException ### Description A class is found, but it is not possible to load it as a class. For example, if the file defining the class is missing or if the file defining the class is not a valid class file. ### Constructors - `()` - `(String)` ``` -------------------------------- ### Run Benchmark with Gradle Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/client/benchmark/README.md Execute the benchmark using Gradle. All parameters for JMH are passed within single quotes as command-line arguments. ```bash ./gradlew -p client/benchmark run --args ' params go here' ``` -------------------------------- ### Get Elasticsearch Index Information Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/quickstart.md Display information about Elasticsearch indices, including health status, name, and size. The '-v' flag provides verbose output. ```default curl "http://localhost:9200/_cat/indices?v" health status index uuid pri rep docs.count docs.deleted store.size pri.store.size green open test BOolxI89SqmrcbK7KM4sIA 1 0 4 0 4.1kb 4.1kb ``` -------------------------------- ### Create Cassandra Schema and Data Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/quickstart.md Use cqlsh to create a keyspace, user-defined type, table, and insert sample data. This sets up the data structure in Cassandra before indexing. ```shell docker exec -i test_seed_node_1 cqlsh <, login text, PRIMARY KEY (uid)); INSERT INTO test.docs (uid, username, login) VALUES (1, {first:'vince',last:'royer'}, 'vroyer'); INSERT INTO test.docs (uid, username, login) VALUES (2, {first:'barthelemy',last:'delemotte'}, 'barth'); EOF ``` -------------------------------- ### Build Elassandra v6.8.x Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/CONTRIBUTING.md Command to build Elassandra version 6.8.x from sources, setting multiple JAVA_HOME variables. ```bash export JAVA8_HOME=/path/to/jdk-8 export JAVA9_HOME=/path/to/jdk-9 export JAVA12_HOME=/path/to/jdk-12 export JAVA_HOME=/path/to/jdk-12 export CASSANDRA_JAVA_HOME=/path/to/jdk-8 ./gradlew clean assemble -Dbuild.snapshot=false ``` -------------------------------- ### Configure Keyspace Replication for Index Source: https://context7.com/strapdata/elassandra/llms.txt Specify the keyspace and replication strategy for an index. ```bash # Configure keyspace replication for the index curl -XPUT -H 'Content-Type: application/json' "http://localhost:9200/my_index" -d '{ "settings": { "keyspace": "my_keyspace", "replication": "DC1:1,DC2:2" } }' ``` -------------------------------- ### Check Elassandra Node Status Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/README.md After starting an Elassandra node, use the nodetool status command to verify that the node is running and has joined the cluster. This is a standard Cassandra utility. ```bash bin/nodetool status ``` -------------------------------- ### Run All Core Elassandra Unit Tests Source: https://github.com/strapdata/elassandra/blob/v6.8.4-strapdata/docs/elassandra/source/testing.md Command to execute all core unit tests for the Elassandra server module. ```bash $gradle server:test ```