Creating Replicas

I had a failure of a couple nodes in my 3 node cluster. After recovering
only two replicas remained for my 12 shards.

I updated the replica count to 0 (which deleted these replicas), then
updated it to 1 again. The hope was that this would restore replicas for
all 12 shards.

So far, no new replicas have been created, I don't see anything in the log
files about performing replication or anything. Is my expectation that
increasing the replica count from 0 to 1 would create replias misguided?
How can I get more information about replication, to see if the process is
running?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Does anybody know if increasing the replica count of an index should start
creating replicas? If it should, does anybody know how to find out why this
does not work? The log file for the index
(/var/log/elasticsearch/index_name.log) is unhelpful.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yes. Is the cluster in red state?

On Mon, Apr 22, 2013 at 6:03 PM, Ben Timby btimby@gmail.com wrote:

Does anybody know if increasing the replica count of an index should start
creating replicas? If it should, does anybody know how to find out why this
does not work? The log file for the index
(/var/log/elasticsearch/index_name.log) is unhelpful.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Itamar, thank you for your reply!

On Mon, Apr 22, 2013 at 12:36 PM, Itamar Syn-Hershko itamar@code972.comwrote:

Yes. Is the cluster in red state?

Cluster state is yellow. All primary shards exist.

If I issue:

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.number_of_replicas": 0 }'

The state becomes green. If I then do:

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.number_of_replicas": 1 }'

The state goes back to yellow and besides the following log entry, nothing
else happens.

[2013-04-22 12:39:41,030][INFO ][cluster.metadata ] [Lexington,
Alexander] updating number_of_replicas to [1] for indices [documents]

I just upgraded to 0.20.6 (from 0.20.3) for all nodes and see the same
behavior. I would expect ES to get busy replicating after setting replica
count to 1.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Do you have any shard allocation rules in place? maybe that prevents the
replica from being assigned

On Mon, Apr 22, 2013 at 7:45 PM, Ben Timby btimby@gmail.com wrote:

Itamar, thank you for your reply!

On Mon, Apr 22, 2013 at 12:36 PM, Itamar Syn-Hershko itamar@code972.comwrote:

Yes. Is the cluster in red state?

Cluster state is yellow. All primary shards exist.

If I issue:

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.number_of_replicas": 0 }'

The state becomes green. If I then do:

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.number_of_replicas": 1 }'

The state goes back to yellow and besides the following log entry, nothing
else happens.

[2013-04-22 12:39:41,030][INFO ][cluster.metadata ] [Lexington,
Alexander] updating number_of_replicas to [1] for indices [documents]

I just upgraded to 0.20.6 (from 0.20.3) for all nodes and see the same
behavior. I would expect ES to get busy replicating after setting replica
count to 1.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Itamar,

On Mon, Apr 22, 2013 at 12:50 PM, Itamar Syn-Hershko itamar@code972.comwrote:

Do you have any shard allocation rules in place? maybe that prevents the
replica from being assigned

Indeed. The cluster was lopsided a while back and I set:

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.routing.allocation.total_shards_per_node": "4" }'

Which is enough for the primaries, but not the replicas, I had no clue this
applied to both shard types (but it makes sense that it does).

I set this to 8 and replicas started popping up. How can I remove this
setting altogether (go back to the default)?

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.routing.allocation.total_shards_per_node": "8" }'

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I recall the docs stating 0 would reset that
On Apr 22, 2013 8:09 PM, "Ben Timby" btimby@gmail.com wrote:

Itamar,

On Mon, Apr 22, 2013 at 12:50 PM, Itamar Syn-Hershko itamar@code972.comwrote:

Do you have any shard allocation rules in place? maybe that prevents the
replica from being assigned

Indeed. The cluster was lopsided a while back and I set:

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.routing.allocation.total_shards_per_node": "4" }'

Which is enough for the primaries, but not the replicas, I had no clue
this applied to both shard types (but it makes sense that it does).

I set this to 8 and replicas started popping up. How can I remove this
setting altogether (go back to the default)?

$ curl -XPUT http://localhost:9200/documents/_settings -d '{
"index.routing.allocation.total_shards_per_node": "8" }'

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Itamar,

Thank you for your help!

On Mon, Apr 22, 2013 at 1:22 PM, Itamar Syn-Hershko itamar@code972.comwrote:

I recall the docs stating 0 would reset that

I checked before asking. The docs just say "Defaults to unbounded".

http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/

I will try 0.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.