Skip to content

OpenSeach FAQ

1 OpenSearch Index Deleted by Mistake

Problem: Due to limited disk space in some environments, indexes need to be deleted. It is easy to accidentally delete the largest index number, causing Guance kodo-x to report errors when writing to the index.

Solution:

Take wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging as an example:

  • Check whether the largest index is missing
GET /_alias/wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging

wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging-000157  -- false
wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging-000158  -- false
wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging-000159  -- false

.....

It is found that wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging-000159 is the largest index, and the next one should be wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging-000160.

  • Fix the write
PUT  wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging-000160
POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging-001778",
        "alias": "wksp_f8f7efcc6c4948ec96c751bbcfb7c8fc_logging",
        "is_write_index": true
      }
    }
  ]
}

Feedback

Is this page helpful?