Updated on 2024-11-29 GMT+08:00

Using the Solr Client

Scenario

This section guides users to use a Solr client in an O&M or service scenario.

Solr is incompatible with the client of V100R002C50 version. If you reinstall the cluster or the Solr service, download and install the client again, and then use the client.

Prerequisites

  • The client has been installed.

    For example, the installation directory is /opt/client.

  • Service component users have been created by the MRS cluster administrator. In security mode, machine-machine users need to download the keytab file. A human-machine user must change the password upon the first login. (Not involved in normal mode)

Procedure

  1. Log in to the node where the client is installed as the client installation user.
  2. Run the following command to go to the client installation directory:

    cd /opt/client

  3. Run the following command to configure environment variables:

    source bigdata_env

  4. Check whether multiple Solr services are installed.

    • If yes, when you use the client to connect to a specific Solr service, run a command to load environment variables of the service. For example, run the source Solr-1/component_env command to load Solr-1 service variables.
    • If no, skip this step.

  5. If the cluster is in security mode, run the following command to authenticate the user. In normal mode, user authentication is not required.

    kinit Component service user

  6. Run the Solr shell command.

    Example: solrctl --help