Skip to content

Some tests with an external CLI that allows to inspect opensearch metadata

License

Notifications You must be signed in to change notification settings

phvalguima/opensearch-metadata-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenSearch Metadata CLI

Manage the node's metadata using CLI commands.

WARNING: BEWARE tinkering with opensearch metadata may cause irreversible data loss!

Building

./gradlew clean build

If needed, clean the previous cached dependencies:

./gradlew clean build --refresh-dependencies

Executing

The first step is to make sure you have access to the jar files from opensearch.

First, power down the opensearch service running in your machine. One example of potential command:

sudo java \
  -Dopensearch.path.home="$OPENSEARCH_HOME" \
  -Dopensearch.path.conf="$OPENSEARCH_PATH_CONF" \
  -cp "$OPENSEARCH_PATH_CONF"/lib/*:app/build/libs/app.jar \
    org.opensearch.cli.main.Node list-metadata

OBS.: sudo may be needed as the folders will not be accessible to your current user.

Debugging Example

Let's assume opensearch snap is installed. To debug it, run:

sudo java \
    -agentlib:jdwp=transport=dt_socket,server=y,suspend=y \
    -Dopensearch.path.home="/var/snap/opensearch/current/usr/share/opensearch" \
    -Dopensearch.path.conf="/var/snap/opensearch/current/etc/opensearch" \
    -Dopensearch.path.data="/var/snap/opensearch/common/var/lib/opensearch" \
    -cp /snap/opensearch/current/usr/share/opensearch/lib/*:app/build/libs/app.jar \
    org.opensearch.cli.main.Node list-metadata

Then, connect to the debug server with JDB.

About

Some tests with an external CLI that allows to inspect opensearch metadata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages