Reroute unassigned shards

How can I reroute all unassigned shards to single-node with ES version 5.6?

Read this and specifically the "Also be patient" part.

Elasticsearch will never assign a primary shard and its replica to the same node, so if you only have one node you will never be able to allocate any configured replica shards. Ways to remove the unassigned shard would be to add another node to the cluster or set the number of replicas to 0 for all indices.

If you have unassigned primary shards, have a look at this blog post.

Thank you. I really should be patient, sorry for this.

I have a couple of unassigned primary shards and want to allocate them to the single node. The blog post concerning unassigned primary shards doesn't match my allocation problem. When I'm using the explain API I recieve this:

|index|"sap-pi-alert-2017.10.15"|
|---|---|
|shard|0|
|primary|true|
|current_state|"unassigned"|
|unassigned_info||
|reason|"CLUSTER_RECOVERED"|
|at|"2018-02-26T10:36:08.476Z"|
|last_allocation_status|"no_valid_shard_copy"|
|can_allocate|"no_valid_shard_copy"|
|allocate_explanation|"cannot allocate because all found copies of the shard are either stale or corrupt"|
|node_allocation_decisions||
|0||
|node_id|"W_yIkoU1RRuG8XM3wyJ1wQ"|
|node_name|"ELASASP101"|
|transport_address|"<my_elasticsearch>"|
|node_decision|"no"|
|store||
|in_sync|true|
|allocation_id|"4zEE_6I5QPyvnvf4n76K_Q"|
|store_exception||
|type|"corrupt_index_exception"|
|reason|"Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path=\"D:\\elasticsearch\\nodes\\0\\indices\\gdk2e42DSZCJ_7oEwAuz5g\\0\\index\\segments_j\"))): 8 (needs to be between 4 and 6) (resource=preexisting_corruption)"|
|caused_by||
|type|"index_format_too_new_exception"|
|reason|"Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path=\"D:\\elasticsearch\\nodes\\0\\indices\\gdk2e42DSZCJ_7oEwAuz5g\\0\\index\\segments_j\"))): 8 (needs to be between 4 and 6)"|

I really don't know how to resolve that.

If they are corrupted you may not be able to restore them. This is one of the reason running a single node is not recommended. Do you have any backup you can restore from?

I worked with elastic stack on linux before. The current one is on windows and not configured by me. So there is only one node and it is pretty difficult for me to join another node to the cluster on the same machine. That's why there is a single node cluster.

I made a snapshot two weeks ago but what will happen to the newer data if I am going to restore the old snapshot? How can I merge them?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.