Search Shell is a command-line database management tool for Lindorm. Install it on your local machine or an Elastic Compute Service (ECS) instance to connect to LindormSearch and manage collections, indexes, and configuration sets from the command line.
Search Shell cannot connect to single-node Lindorm instances. If your instance is single-node, use SQL to connect to and use LindormSearch instead.
Prerequisites
Before you begin, ensure that you have:
Java Development Kit (JDK) 1.8 or later. To verify your version, run:
java -versionThe IP address of your client added to the Lindorm whitelist
Install and configure Search Shell
Use a non-root user credential on the ECS instance when performing these steps.
Log on to the ECS instance and download the Search Shell package:
wget https://hbaseuepublic.oss-cn-beijing.aliyuncs.com/lindorm-search-cli.tar.gzExtract the package:
tar -xzvf lindorm-search-cli.tar.gzOpen
bin/search.in.shand setZK_HOSTto the LindormSearch endpoint for Solr. Find the endpoint in the Solr Compatibility Address section of the Lindorm console. For more information, see View endpoints.ZK_HOST="host:port"
Run commands
All Search Shell commands run from the lindorm-search-cli/bin directory. Navigate to it first:
cd lindorm-search-cli/binTo list all available commands, run:
./search-cliManage collections
Create a collection
./search-cli create_collection -c <collection-name> -n <configset-name> -shards <shard-count>| Parameter | Required | Description | Example |
|---|---|---|---|
-c | Yes | Name of the collection to create | testIndex |
-n | Yes | Name of the configuration set to use | _indexer_default |
-shards | Yes | Number of shards to split the collection into | 2 |
Example: Create a collection named testIndex using the default configuration set with 2 shards:
./search-cli create_collection -c testIndex -n _indexer_default -shards 2List collections
./search-cli list_collectionsManage configuration sets
Search Shell supports the following ZooKeeper (zk) subcommands for configuration set management:
./search-cli zk downconfig -d <local-dir> -n <configset-name>
./search-cli zk upconfig -d <local-dir> -n <configset-name>
./search-cli zk ls <zk-path>Download a configuration set
Download a configuration set from ZooKeeper to a local directory:
./search-cli zk downconfig -d . -n _indexer_defaultThis downloads the default configuration set _indexer_default into a conf subfolder in the current directory. Use the files in conf as a starting point for custom configuration sets.
Upload a configuration set
After modifying your configuration files, upload them back to ZooKeeper:
./search-cli zk upconfig -d conf -n myConfReplace myConf with the name for your custom configuration set.
List configuration sets
./search-cli zk ls /configsCreate an index with a custom configuration set
After uploading a custom configuration set, create a collection that uses it:
./search-cli create_collection -c myIndex -n myConf -shards 2