Search Shell is a database management tool provided by Lindorm. You can install Search Shell on your local machine or Elastic Compute Service (ECS) instance, and then use Search Shell to connect to your Lindorm instance. This topic describes how to connect to a Lindorm instance using Search Shell installed on an ECS instance.
Prerequisites
Java Development Kit (JDK) is installed. We recommend that you install JDK 1.8 or later.
The IP address of the client is added to the Lindorm whitelist.
Usage notes
Single-node Lindorm instances cannot be connected using Search Shell. If you have a single-node Lindorm instance, use SQL to connect to and use LindormSearch.
Procedure
You must use the credential of a non-root user of the ECS instance on which you want to install Search Shell to perform the following operations.
Install Search Shell. If Search Shell is installed, skip to the next step.
Log on to the ECS instance and run the following command to download the package of Search Shell:
wget https://hbaseuepublic.oss-cn-beijing.aliyuncs.com/lindorm-search-cli.tar.gzRun the following command to extract the files of Search Shell:
tar -xzvf lindorm-search-cli.tar.gz
Open the
bin/search.in.shfile and set the value of theZK_HOSTparameter to the LindormSearch endpoint for Solr displayed in the Solr Compatibility Address section. For more information about how to obtain the endpoint, see View endpoints.ZK_HOST="host:port" // Set host:port to the LindormSearch endpoint for Solr.
Sample commands
You can run the following command to navigate to the lindorm-search-cli/bin directory:
cd lindorm-search-cli/binYou can run the following command to view the commands that are supported by Search Shell:
./search-cli Example.
You can run the following command to create a collection:
./search-cli create_collection -c testIndex -n _indexer_default -shards 2NotetestIndexis the name of the index,_indexer_defaultspecifies the default configuration set, and2is the number of shards.You can run the following command to view information about collections:
./search-cli list_collectionsYou can run the following command to download the configuration set:
./search-cli zk downconfig -d . -n _indexer_defaultNote_indexer_defaultspecifies the default configuration set provided by Search Shell. After you run the preceding command, a subfolder namedconfis automatically created in thebindirectory. This subfolder stores configuration files in the_indexer_defaultconfiguration set.You can run the following command to upload a configuration set:
./search-cli zk upconfig -d conf -n myConfNoteYou can change the name of the configuration set to the name of your custom configuration set such as
myConf.You can run the following command to view information about the configuration set:
./search-cli zk ls /configsCreate an index table based on a custom configuration set.
./search-cli create_collection -c myIndex -n myConf -shards 2