Index.auto_expand_replicas

What does this option do? The only documented values are "false" or "0-
all". It looks like latter creates one replica per node, which is
quite useful, but will replicas be dropped if nodes are removed? Can I
set a max number of replicas, e.g. "0-10"?

Yes, it will create a replica per node, and replicas will be dropped if nodes are removed. You can set it to "0-10" as well.

On Monday, March 5, 2012 at 8:36 PM, Eric Jain wrote:

What does this option do? The only documented values are "false" or "0-
all". It looks like latter creates one replica per node, which is
quite useful, but will replicas be dropped if nodes are removed? Can I
set a max number of replicas, e.g. "0-10"?

On Mar 5, 12:32 pm, Shay Banon kim...@gmail.com wrote:

Yes, it will create a replica per node, and replicas will be dropped if nodes are removed. You can set it to "0-10" as well.

Thanks; just tested this, really useful.

Is this only available in the update settings API as of 0.19.2? I tried
adding this to the elasticsearch.json configuration file:

"index":{
"number_of_shards": 2,
"number_of_replicas": 0,
"auto_expand_replicas": "0-all",
...

But the expanding/contracting feature doesn't take affect until I call the
update settings API. Is that the expected behavior?

Thanks,
Josh

On Monday, March 5, 2012 6:43:18 PM UTC-8, Eric Jain wrote:

On Mar 5, 12:32 pm, Shay Banon kim...@gmail.com wrote:

Yes, it will create a replica per node, and replicas will be dropped if
nodes are removed. You can set it to "0-10" as well.

Thanks; just tested this, really useful.

It should take affect without calling update settings. Whats your full test
case? i.e, how many nodes you start, and what happens when you create the
index?

On Sat, Apr 7, 2012 at 1:12 AM, jholtzman jmholtzman@gmail.com wrote:

Is this only available in the update settings API as of 0.19.2? I tried
adding this to the elasticsearch.json configuration file:

"index":{
"number_of_shards": 2,
"number_of_replicas": 0,
"auto_expand_replicas": "0-all",
...

But the expanding/contracting feature doesn't take affect until I call the
update settings API. Is that the expected behavior?

Thanks,
Josh

On Monday, March 5, 2012 6:43:18 PM UTC-8, Eric Jain wrote:

On Mar 5, 12:32 pm, Shay Banon kim...@gmail.com wrote:

Yes, it will create a replica per node, and replicas will be dropped if
nodes are removed. You can set it to "0-10" as well.

Thanks; just tested this, really useful.

I've tried configuring this in elasticsearch.json on all 3 nodes of a
cluster, both with "index.auto_expand_replicas" defined in the root of the
file and with "auto_expand_replicas" nested in the "index" section. Newly
created indexes still do not contain the "auto_expand_replicas" setting
until I make a call to the update API.

$ curl -XPUT http://localhost:9200/test
{"ok":true,"acknowledged":true}

$ curl -XGET http://localhost:9200/test/_settings?pretty=true
{
"test" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "0",
"index.version.created" : "190299"
}
}
}

I can stop and start nodes in the cluster, but the number_of_replicas value
remains fixed at zero for all running nodes. Once I update the settings
via the API, though, stopping and starting nodes causes the number of
replicas to change, and the settings API shows the configuration as
expected:

$ curl -XGET http://localhost:9200/test/_settings?pretty=true
{
"test" : {
"settings" : {
...
"index.auto_expand_replicas" : "0-all"
}
}
}

Thanks,
Josh

On Sunday, April 8, 2012 11:20:10 AM UTC-7, kimchy wrote:

It should take affect without calling update settings. Whats your full
test case? i.e, how many nodes you start, and what happens when you create
the index?

On Sat, Apr 7, 2012 at 1:12 AM, jholtzman jmholtzman@gmail.com wrote:

Is this only available in the update settings API as of 0.19.2? I tried
adding this to the elasticsearch.json configuration file:

"index":{
"number_of_shards": 2,
"number_of_replicas": 0,
"auto_expand_replicas": "0-all",
...

But the expanding/contracting feature doesn't take affect until I call
the update settings API. Is that the expected behavior?

Thanks,
Josh

On Monday, March 5, 2012 6:43:18 PM UTC-8, Eric Jain wrote:

On Mar 5, 12:32 pm, Shay Banon kim...@gmail.com wrote:

Yes, it will create a replica per node, and replicas will be dropped
if nodes are removed. You can set it to "0-10" as well.

Thanks; just tested this, really useful.

Yea, its a bug when setting it in the configuration file, you can set it in
the settings of the index when you create it. Opened an issue:
Setting index.auto_expand_replicas in the elasticsearch config file does not apply · Issue #1852 · elastic/elasticsearch · GitHub (or create an
index template with a template of *, with the mentioned setting).

On Mon, Apr 9, 2012 at 8:33 PM, Josh Holtzman jmholtzman@gmail.com wrote:

I've tried configuring this in elasticsearch.json on all 3 nodes of a
cluster, both with "index.auto_expand_replicas" defined in the root of the
file and with "auto_expand_replicas" nested in the "index" section. Newly
created indexes still do not contain the "auto_expand_replicas" setting
until I make a call to the update API.

$ curl -XPUT http://localhost:9200/test
{"ok":true,"acknowledged":true}

$ curl -XGET http://localhost:9200/test/_settings?pretty=true
{
"test" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "0",
"index.version.created" : "190299"
}
}
}

I can stop and start nodes in the cluster, but the number_of_replicas
value remains fixed at zero for all running nodes. Once I update the
settings via the API, though, stopping and starting nodes causes the number
of replicas to change, and the settings API shows the configuration as
expected:

$ curl -XGET http://localhost:9200/test/_settings?pretty=true
{
"test" : {
"settings" : {
...
"index.auto_expand_replicas" : "0-all"
}
}
}

Thanks,
Josh

On Sunday, April 8, 2012 11:20:10 AM UTC-7, kimchy wrote:

It should take affect without calling update settings. Whats your full
test case? i.e, how many nodes you start, and what happens when you create
the index?

On Sat, Apr 7, 2012 at 1:12 AM, jholtzman jmholtzman@gmail.com wrote:

Is this only available in the update settings API as of 0.19.2? I tried
adding this to the elasticsearch.json configuration file:

"index":{
"number_of_shards": 2,
"number_of_replicas": 0,
"auto_expand_replicas": "0-all",
...

But the expanding/contracting feature doesn't take affect until I call
the update settings API. Is that the expected behavior?

Thanks,
Josh

On Monday, March 5, 2012 6:43:18 PM UTC-8, Eric Jain wrote:

On Mar 5, 12:32 pm, Shay Banon kim...@gmail.com wrote:

Yes, it will create a replica per node, and replicas will be dropped
if nodes are removed. You can set it to "0-10" as well.

Thanks; just tested this, really useful.

Thanks for confirming and filing the issue, Shay.

Josh

On Wednesday, April 11, 2012 4:27:06 AM UTC-7, kimchy wrote:

Yea, its a bug when setting it in the configuration file, you can set it
in the settings of the index when you create it. Opened an issue:
Setting index.auto_expand_replicas in the elasticsearch config file does not apply · Issue #1852 · elastic/elasticsearch · GitHub (or create an
index template with a template of *, with the mentioned setting).

On Mon, Apr 9, 2012 at 8:33 PM, Josh Holtzman jmholtzman@gmail.comwrote:

I've tried configuring this in elasticsearch.json on all 3 nodes of a
cluster, both with "index.auto_expand_replicas" defined in the root of the
file and with "auto_expand_replicas" nested in the "index" section. Newly
created indexes still do not contain the "auto_expand_replicas" setting
until I make a call to the update API.

$ curl -XPUT http://localhost:9200/test
{"ok":true,"acknowledged":true}

$ curl -XGET http://localhost:9200/test/_settings?pretty=true
{
"test" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "0",
"index.version.created" : "190299"
}
}
}

I can stop and start nodes in the cluster, but the number_of_replicas
value remains fixed at zero for all running nodes. Once I update the
settings via the API, though, stopping and starting nodes causes the number
of replicas to change, and the settings API shows the configuration as
expected:

$ curl -XGET http://localhost:9200/test/_settings?pretty=true
{
"test" : {
"settings" : {
...
"index.auto_expand_replicas" : "0-all"
}
}
}

Thanks,
Josh

On Sunday, April 8, 2012 11:20:10 AM UTC-7, kimchy wrote:

It should take affect without calling update settings. Whats your full
test case? i.e, how many nodes you start, and what happens when you create
the index?

On Sat, Apr 7, 2012 at 1:12 AM, jholtzman jmholtzman@gmail.com wrote:

Is this only available in the update settings API as of 0.19.2? I
tried adding this to the elasticsearch.json configuration file:

"index":{
"number_of_shards": 2,
"number_of_replicas": 0,
"auto_expand_replicas": "0-all",
...

But the expanding/contracting feature doesn't take affect until I call
the update settings API. Is that the expected behavior?

Thanks,
Josh

On Monday, March 5, 2012 6:43:18 PM UTC-8, Eric Jain wrote:

On Mar 5, 12:32 pm, Shay Banon kim...@gmail.com wrote:

Yes, it will create a replica per node, and replicas will be dropped
if nodes are removed. You can set it to "0-10" as well.

Thanks; just tested this, really useful.