Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create fix ilm api #90

Open
TomonoriSoejima opened this issue Dec 16, 2022 · 0 comments
Open

How to create fix ilm api #90

TomonoriSoejima opened this issue Dec 16, 2022 · 0 comments

Comments

@TomonoriSoejima
Copy link
Owner

In case you run into elastic/elasticsearch#49413, you can manually fix it like this.

POST _ilm/move/my-index-000001
{
  "current_step": { 
    "phase": "hot",
    "action": "rollover",
    "name": "ERROR"
  },
  "next_step": { 
    "phase": "hot",
    "action": "rollover",
    "name": "set-indexing-complete"
  }
}

The problem is what if there are a ton of affected indices?
This script will generate the above for all indices.
make sure to adjust the path to commercial/ilm_explain_only_errors.json as this is the source file we are gathering index names from.

for index in $(cat commercial/ilm_explain_only_errors.json | jq -r  '.indices | to_entries[] | select((.value.step == "ERROR") and (.value.step_info.reason | contains("no rollover info found"))) | .key'  | sort); do

    printf 'POST _ilm/move/%s
{
  "current_step": { 
    "phase": "hot",
    "action": "rollover",
    "name": "ERROR"
  },
  "next_step": { 
    "phase": "hot",
    "action": "rollover",
    "name": "set-indexing-complete"
  }
}\n\n' "$index" 

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant