Download Solr configuration from HDP Search ZooKeeper

The solr-download-metadata.sh script downloads metadata from HDP Search ZooKeeper. You can then copy this information into a CDP cluster and use it as input for the to CDP Private Cloud Base upgrade process.

  • Copy the migration script to any of the nodes in the cluster where HDP Search is deployed.
  • The migration script uses jq for JSON file processing, this tool has to be installed.

    For example, yum install jq

  1. Set the JAVA_HOME environment variable to the JDK location. For example:
    export JAVA_HOME=/usr/jdk64/jdk1.8.0_112
  2. Add java to PATH. For example:
     export PATH=$PATH:$JAVA_HOME/bin
  3. On a host running Solr server, set the SOLR_ZK_ENSEMBLE environment variable:
    export SOLR_ZK_ENSEMBLE=[***HOSTNAME***]:2181/solr

    Replace [***HOSTNAME***] with a value that is valid in your environment.

  4. On a host running Solr server, set the SOLR_ADMIN_URI environment variable:
    export SOLR_ADMIN_URI=[***HOSTNAME***]:8983/solr

    Replace [***HOSTNAME***] with an actual value that is valid in your environment. Make sure that you include the protocol (HTTP or HTTPS) and do not include a trailing slash (/).

    For example:
    export SOLR_ADMIN_URI=htp://example.com:8983/solr
  5. On a secure cluster you may need to set additional zkcli flags, for instance:
    export ZKCLI_JVM_FLAGS="-Djava.security.auth.login.config=[***/PATH/TO/JAAS.CONF***]"

    Replace [***/PATH/TO/JAAS.CONF***] with path to a valid jaas.conf file.

  6. If you have enabled Kerberos, run the kinit command with the Solr service superuser. For example:
    kinit solr@[***EXAMPLE.COM***]
    Replace [***EXAMPLE.COM***] with your Kerberos realm name.
  7. Download the current (HDP Search 2 or 3) Solr configuration from ZooKeeper:
    • solr-download-metadata.sh [***DIRECTORY***]

      Replace [***DIRECTORY***] with the path to the directory where you want to download the Solr configuration.

    • If you have enabled Kerberos and configured ZooKeeper Access Control Lists (ACLs), specify your JAAS configuration file by adding the --jaas parameter to the command.

      solr-download-metadata.sh --jaas [***/PATH/TO/JAAS.CONF***] [***DIRECTORY***]

      Replace [***/PATH/TO/JAAS.CONF***] with the path to a valid jaas.conf file.

      Replace [***DIRECTORY***] with the path to the directory where you want to download the Solr configuration.

    In case of a successful run, the last line printed out by the script is:

    Successfully downloaded SOLR metadata from Zookeeper
  8. Copy the migrated data to $HOME/cr7-solr-migration in the interim Solr instance.
  9. Initialize a directory for the migrated configuration as a copy of the current configuration:
    cp -r $HOME/cr7-solr-migration $HOME/cr7-migrated-solr-config