Last active
June 26, 2017 09:05
-
-
Save robertlyson/de4257f9eec49d2672960f2af51a27d9 to your computer and use it in GitHub Desktop.
Elasticsearch failed shard recovery - powershellscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on http://www.jillesvangurp.com/2015/02/18/elasticsearch-failed-shard-recovery/ | |
# Be carefull, you can lost your data during this process | |
$array = Get-ChildItem "ES_PATH\data\nodes\0" -recurse | Where-Object {$_.PSIsContainer -eq $true -and $_.Name -match "index"} | ForEach-Object -Process {$_.FullName} | |
foreach($element in $array) | |
{ | |
Write-Output $element | |
$command = [string]::Format("java -cp ES_PATH\lib\lucene-core-6.3.0.jar -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex {0} -exorcise",$element) | |
iex $command | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment