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 by using Search Shell that is installed on an ECS instance.
Prerequisites
Java Development Kit (JDK) is installed. We recommend that you install JDK 1.8 or later.
LindormSearch is activated for you Lindorm instance. For more information, see Activate LindormSearch.
The IP address of the client is added to the whitelist of the Lindorm instance. For more information, see Configure whitelists.
Usage notes
Single-node Lindorm instances cannot be connected by using Search Shell. You can use SQL statements to connect to and use LindormSearch in a single-node Lindorm instance. For more information, see Use a JDBC driver to connect to and send SQL requests to 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.gz
Run the following command to extract the files of Search Shell:
tar -xzvf lindorm-search-cli.tar.gz
Open the
bin/search.in.sh
file and set the value of theZK_HOST
parameter to the LindormSearch endpoint for Solr that is displayed in the Solr Compatibility Address section on the Lindorm console. 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 go to the lindorm-search-cli/bin
directory:
cd lindorm-search-cli/bin
You can run the following command to view the commands that are supported by Search Shell:
./search-cli
The following examples show how to use Search Shell:
You can run the following command to create a collection:
./search-cli create_collection -c testIndex -n _indexer_default -shards 2
NotetestIndex
is the name of the index,_indexer_default
specifies the default configuration set, and2
is the number of shards.You can run the following command to view information about collections:
./search-cli list_collections
You can run the following command to download the configuration set:
./search-cli zk downconfig -d . -n _indexer_default
Note_indexer_default
specifies the default configuration set that is provided by LindormSearch. After you run the preceding command, a folder namedconf
is created in thebin
directory. The folder is used to store configuration files in the_indexer_default
configuration set.You can run the following command to upload a configuration set:
./search-cli zk upconfig -d conf -n myConf
NoteYou can change the name of the original 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 /configs
You can run the following command to create a collection based on the custom configuration set:
./search-cli create_collection -c myIndex -n myConf -shards 2