curl -X PUT -d "{\"persistent\": {\"cluster.routing.allocation.enable\": \"none\"}}" http://localhost:9200/_cluster/settings
I shutdown one of my nodes for service. Now that it is back up, the PRIMARY shards remained unassigned. The data is still on the drive. What is the command to tell ES that, "yes, you got a whole shard, please use it"?
I tried a /_cluster/reroute command on a single shard of an unimportant index. "allow_primary": false reports an error. And "allow_primary": true erases everything on that shard.
[2016-01-23 19:08:18,962][INFO ][cluster.routing.allocation.decider] [primary] updating [cluster.routing.allocation.enable] from [NONE] to [ALL]
[2016-01-23 19:08:18,970][INFO ][indices.store ] [primary] Failed to open / find files while reading metadata snapshot
[2016-01-23 19:08:18,971][INFO ][indices.store ] [primary] Failed to open / find files while reading metadata snapshot
[2016-01-23 19:08:18,973][INFO ][indices.store ] [primary] Failed to open / find files while reading metadata snapshot
[2016-01-23 19:08:18,973][INFO ][indices.store ] [primary] Failed to open / find files while reading metadata snapshot
[2016-01-23 19:08:18,974][INFO ][indices.store ] [primary] Failed to open / find files while reading metadata snapshot
In summary, before version 2.0, you can not change the path.data or you will loose data. It appears the older versions of ES were striping data over the paths, so changing the number confused it. Lucky that the data was simply considered unusable, and not removed from the drive: Reverting the path.data let the shards recover.
For the recorde - adding paths to the list shouldn't cause data to go away. Something else is going on here. Also, I know in the past that people recommended (including me :)) to delete the translog on recovery problem but this is only when you run into translog corruption on old ES version, where we didn't shut down correctly and corruption was expected. These days are long gone and newer version will refuse to open a primary if the translog is missing.
I presume there is no way to dig deeper now and the data is long gone. If not please ping me and we can research.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.