BPC OpenSearch Tool
Das Kommandozeilentool BPC OpenSearch Tool ermöglicht die Auflistung, Löschung sowie den Export und Import von OpenSearch-Indizes.
Die ausführbare Datei bpc-opensearch-tool.jar kann über die Downloadseite bezogen werden.
Funktionsumfang
Mit dem Tool lassen sich Aufgaben durchführen, die über direkte HTTP-Aufrufe (z. B. mittels CURL) nur mit erhöhtem Aufwand und potenziell fehleranfällig umsetzbar sind.
Der Schwerpunkt liegt dabei auf:
-
dem Export von Indizes
-
dem Import von Indizes
-
der korrekten Behandlung von Index- und Aliasnamen während dieser Prozesse
Benutzung
Das Tool unterstützt derzeit folgende vier Kommandos:
-
Indizes auflisten (
LIST) -
Index löschen (
DELETE) -
Index exportieren (
EXPORT) -
Index importieren (
IMPORT)
Außerdem kann mit java -jar bpc-opensearch-tool.jar --help die Hilfe aufgerufen werden.
Usage: bpc-opensearch-tool.jar [-hkV] [-f=<zipFile>] [-i=<indexName>]
[-p=<password>] [-u=<user>] [-U=<url>] <command>
Provides some tools to work with OpenSearch indices in the BPC way.
<command> The command to execute.
Valid values: LIST, DELETE, EXPORT, IMPORT
-f, --file=<zipFile> The name of the file to import (e.g required for
the IMPORT command).
-h, --help Show this help message and exit.
-i, --index=<indexName> The name of the index (e.g. required for the DELETE
AND EXPORT commands).
-k, --insecure Allow insecure connections to OpenSearch. Defaults
to 'false'.
-p, --password=<password> Password of the OpenSearch user.
-u, --user=<user> Name of the OpenSearch user.
-U, --url=<url> The URL to connect OpenSearch (e.g. https:
//localhost:9200).
-V, --version Print version information and exit.
Indizes auflisten (LIST)
Das Kommando LIST erzeugt eine tabellarische Liste aller Indizes.
java -jar bpc-opensearch-tool.jar \
--url https://localhost:9200 --user=admin --password=admin --insecure \
LIST
Index löschen (DELETE)
Das Kommando DELETE löscht einen Index.
java -jar bpc-opensearch-tool.jar \
--url https://localhost:9200 --user=admin --password=admin --insecure \
DELETE --index=ein-index
Index exportieren (EXPORT)
Das Kommando EXPORT kann für den Export eines Index als Zip-Archiv verwendet werden.
Darin enthalten sind die Settings, Mappings und Daten des Index.
Geben Sie nach Möglichkeit immer den Alias des Index an.
Dieser wird dann auch als Name für das Zip-Archiv verwendet.
java -jar bpc-opensearch-tool.jar \
--url https://localhost:9200 --user=admin --password=admin --insecure \
EXPORT --index=ein-index
Index importieren (IMPORT)
Mit dem Kommando IMPORT wird der Index aus einem Zip-Archiv-Export wieder erstellt.
Dabei wird der Name des Zip-Archivs als Alias für den Index verwendet (ohne die Dateiendung).
java -jar bpc-opensearch-tool.jar \
--url https://localhost:9200 --user=admin --password=admin --insecure \
IMPORT --file=ein-index.zip