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

How Can I Delete the Index Data That Has Been Imported?

Procedure

  1. Check the ID of the task executed by an index.

    Search for log file logs/estool.log. The search content is index name + space + reindex taskID:.

    Example: cat estool.log | grep 'index1 reindex taskID:'

    The command output is index1 reindex taskID: R9QEdSqcQkSdkqGzinrvAA:68993, where R9QEdSqcQkSdkqGzinrvAA:68993 indicates the task ID.

    If an index has multiple types, each type has a task ID.

  2. Cancel the index recreation task.

    curl -XPOST --negotiate -k -u : curl -XPOST --negotiate -k -u : 'https://ip:port/_tasks/taskID/_cancel?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

  3. Delete the imported indexes from the new cluster.

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