A utility for Fixing ElasticSearch deployments with massively UNASSIGNED shards
Go to file
starkandwayne-bot cee1ac48cf Updating CODE_OF_CONDUCT.md 2019-01-15 15:28:30 -05:00
Godeps Updated for go1.7 2016-11-10 13:02:08 -05:00
ci Updated concourse template 2017-07-12 10:57:41 -04:00
vendor/github.com/voxelbrain/goptions Updated for go1.7 2016-11-10 13:02:08 -05:00
.gitignore Updated gitignore for pipeline 2016-02-18 11:35:58 -05:00
CODE_OF_CONDUCT.md Updating CODE_OF_CONDUCT.md 2019-01-15 15:28:30 -05:00
LICENSE Initial commit 2016-02-16 13:54:43 -05:00
README.md Fixed esuf to make it actually work against bosh lite testing.. probably isn't totally stable yet though 2016-02-17 17:29:48 -05:00
build.sh Added ci pipeline 2016-02-18 11:19:47 -05:00
main.go Support elasticsearch 5 2017-06-02 15:00:24 -04:00

README.md

Summary

esuf is a utility for fixing ElasticSearch clusters with lots of UNASSIGNED shards. Its purpose is to offer a single command to run, which will examine ElasticSearch, and do its best to return it to a green state.

It iterates over all indices, finding any UNASSIGNED shards, and assigns them to an appropriate data node, based on the assignments of other shards in the index. It will not assign a shard to a data node that already has a shard. It will not assign replica shards until the corresponding primary shard is online.

NOTE: This takes a heavy-handed approach to bringing things online. If a primary shard is stuck in an UNASSGINED state, esuf will pass the allow_primary: true data to ElasticSearch, telling it to bring the primary online, even if it does not have the data for it. This may result in data loss to that shard of the index, but will get the cluster into a working state again.

Installation

go get github.com/starkandwayne/esuf

Usage

For discovering what's wrong with ElasticSearch:

./esuf -H http://ip.of.elasticsearch.box:9200/

For fixing ElasticSearch:

./esuf -H http://ip.of.elasticsearch.box:9200/ --fix