Skip to content

canonical/charmed-opensearch-snap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

141 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Charmed OpenSearch Snap

Build and Test Publish

This is the snap for OpenSearch, a community-driven, Apache 2.0-licensed open source search and analytics suite that makes it easy to ingest, search, visualize, and analyze data.

Installation:

Get it from the Snap Store

or:

sudo snap install charmed-opensearch --channel=2/edge
sudo snap connect charmed-opensearch:process-control

Environment configuration:

OpenSearch has a set of pre-requisites to function properly, they can be set as follows:

sudo sysctl -w vm.swappiness=0
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -w net.ipv4.tcp_retries2=5

Starting Charmed OpenSearch:

Creating certificates:

# create the certificates
sudo snap run charmed-opensearch.setup          \
    --node-name cm0                     \
    --node-roles cluster_manager,data   \
    --tls-priv-key-root-pass root1234   \
    --tls-priv-key-admin-pass admin1234 \
    --tls-priv-key-node-pass node1234   \
    --tls-init-setup yes    # this creates the root and admin certs as well.

Starting Charmed OpenSearch:

sudo snap start charmed-opensearch.daemon

Creating the Security Index:

sudo snap run charmed-opensearch.security-init --tls-priv-key-admin-pass=admin1234

Testing the Charmed OpenSearch setup:

You can either consume the REST API yourself or see if the below commands succeed, and you see that the tests "PASSED" successfully:

# Check if cluster is healthy (green):
sudo snap run charmed-opensearch.test-cluster-health-green
> ....
> PASSED


# Check if node is up:
sudo snap run charmed-opensearch.test-node-up
> ....
> PASSED


# Check if the security index is well initialised:
sudo snap run charmed-opensearch.test-security-index-created
> ....
> PASSED

or:

sudo cp /var/snap/charmed-opensearch/current/etc/opensearch/certificates/node-cm0.pem ./
curl --cacert node-cm0.pem -XGET https://admin:admin@localhost:9200/_cluster/health?pretty
> {
  "cluster_name": "opensearch-cluster",
  "status": "green",
  "timed_out": false,
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "discovered_master": true,
  "discovered_cluster_manager": true,
  "active_primary_shards": 2,
  "active_shards": 2,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 0,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 100
}

License

The Charmed Opensearch Snap is free software, distributed under the Apache Software License, version 2.0. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors