Download the HBase Shell package

Download and decompress the HBase Shell package. Click HBase Shell to download the package.

tar -zxvf alisolr-7.3.8-bin.tar.gz

Configure HBase Shell

Modify the alisolr-7.3.8-bin/conf/solr.in.sh file. Remove the number sign (#) preceding SOLR_ZK_HOST and modify SOLR_ZK_HOST. In this example, use the following setting:

SOLR_ZK_HOST="ld-xxxx-proxy-zk.hbaseue.9b78df04-b.rds.aliyuncs.com:2181/solr"
You can view the preceding address on the details page of the Search instance. Click Database Connection to view the client address information, as shown in the following figure.Client AddressClient Address

Note: The value of the SOLR_ZK_HOST parameter in the preceding example is an internal network address. If you want to access the Search service over the Internet, click Enable Internet Access and set the SOLR_ZK_HOST parameter to a public IP address.

Use HBase Shell to access the Search service

Go to the alisolr-7.3.8-bin/bin directory and run the following command:

./solr
  • Create a collection
      ./solr create_collection -c testIndex -n _indexer_default -shards 2
    testIndex indicates the name of the index, _indexer_default indicates the default configuration set, and 2 indicates the number of shards.
  • View the collection
      ./solr list_collections
  • Download the configuration set
      ./solr zk downconfig -d . -n _indexer_default
    _indexer_default indicates the default configuration set that is provided by the Search service. After you run the preceding command, a sub-folder named conf is created in the current directory, which stores _indexer_default.
  • Upload the configuration set
      ./solr zk upconfig -d conf -n myConf
    You can modify the default configuration set _indexer_default and upload it as a custom configuration set, which is specified by myConf in the preceding command.
  • View the configuration set
      ./solr zk ls /configs
  • Create a collection based on the custom configuration set
      ./solr create_collection -c myIndex -n myConf -shards 2