Help Center/ MapReduce Service/ Component Operation Guide (LTS) (Ankara Region)/ Using Elasticsearch/ Common Issues About Elasticsearch/ Common Problems About the Reindex Tool/ What Can I Do If Indexes of the Source Cluster Fail to Automatically Create Indexes in the Target Cluster?
Updated on 2024-11-29 GMT+08:00

What Can I Do If Indexes of the Source Cluster Fail to Automatically Create Indexes in the Target Cluster?

Procedure

  1. Set copySettingAndMapping in the espara.properties configuration file to false.
  2. Query the logs/estool.log file and locate the error cause. Generally, the mapping of the early version is incompatible with that of the later version. You need to manually create a correct index mapping in the target cluster.

    For example, the _routing parameter of the early version requires the path parameter, while the path parameter needs to be deleted in later versions. The commands related to index mapping are as follows:

    1. Viewing an index mapping

      curl -XGET --negotiate -k -u : 'https://ip:port/index_name/_mapping/?pretty'

      • ip: service IP address of the EsNode or EsClient instance
      • port: port number corresponding to the service IP address of an instance
      • index_name: index table name
    2. Creating an index mapping
      curl -XPUT --negotiate -k -u : 'https://ip:port/index_name/_mapping/type_name' -H 'Content-Type: application/json' -d'
      {
      "properties": {
      "filed_name": {
      "type": "text"
      }
      }
      }

    For details about the commands, visit https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-put-mapping.html.

  3. After the index is created, use tools to migrate data of the index.