Can "action.write_consistency" be updated dynamically on a running node?


(Ankush Jhalani) #1

I tried to update it dynamically but can't.
curl -XPUT 'http://localhost:9201/_cluster/nodes/_local?pretty' -d '
{ "settings.action.write_consistency" : "all" } '

{
"error" : "IndexMissingException[[_cluster] missing]",
"status" : 404
}

Is my syntax incorrect or is this setting not allowed to be set
dynamically?? This will be useful for a planned maintenance where you know
that number of nodes is going to be below quorum.

--
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.


(Luca Cavanna) #2

You can specify the write_consistency in each of your write request (e.g.
index api) using the "consistency" parameter.

You can also override the default value (quorum) for it but that is not a
dynamic settings. You would need to add the "action.write_consistency"
setting to your configuration on each node and restart.

By the way even if it was a dynamic settings, you should have used the cluster
update settings apihttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-update-settings.html,
thus a PUT to localhost:9200/_cluster/settings.

On Tuesday, October 29, 2013 10:45:38 PM UTC+1, Ankush Jhalani wrote:

I tried to update it dynamically but can't.
curl -XPUT 'http://localhost:9201/_cluster/nodes/_local?pretty' -d '
{ "settings.action.write_consistency" : "all" } '

{
"error" : "IndexMissingException[[_cluster] missing]",
"status" : 404
}

Is my syntax incorrect or is this setting not allowed to be set
dynamically?? This will be useful for a planned maintenance where you know
that number of nodes is going to be below quorum.

--
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.


(Ankush Jhalani) #3

Thanks for clarifying

Having to always pass the write_consistency for every index/delete request
sounds like overkill. I think there is valid use-case for supporting this
setting dynamically to handle situations when some machines are knowingly
down for whatever reasons and we want to temporarily switch from quorum to
one.

Regarding the URL, I thought this was a node level setting so didn't expect
the URL to be cluster settings update(even though it's a moot point since
it's not a dynamic setting.)

On Tuesday, October 29, 2013 5:45:38 PM UTC-4, Ankush Jhalani wrote:

I tried to update it dynamically but can't.
curl -XPUT 'http://localhost:9201/_cluster/nodes/_local?pretty' -d '
{ "settings.action.write_consistency" : "all" } '

{
"error" : "IndexMissingException[[_cluster] missing]",
"status" : 404
}

Is my syntax incorrect or is this setting not allowed to be set
dynamically?? This will be useful for a planned maintenance where you know
that number of nodes is going to be below quorum.

--
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.


(Jörg Prante) #4

You do not need to change the default "quorum" value to "one" for write
consistency, unless you want to disable it completely. "quorum" takes the
current number of active shards into consideration, also in situations
where you stop nodes temporarily.

Jörg

--
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.


(Ankush Jhalani) #5

In a 4 node environment with shard having 3 replica, bringing down 2 nodes
blocks index/delete operations. Thus I don't understand how quorum is
taking active shards here into consideration (I am assuming active shards
mean which are currently running, which would be 2 in this scenario).

On Tuesday, October 29, 2013 5:45:38 PM UTC-4, Ankush Jhalani wrote:

I tried to update it dynamically but can't.
curl -XPUT 'http://localhost:9201/_cluster/nodes/_local?pretty' -d '
{ "settings.action.write_consistency" : "all" } '

{
"error" : "IndexMissingException[[_cluster] missing]",
"status" : 404
}

Is my syntax incorrect or is this setting not allowed to be set
dynamically?? This will be useful for a planned maintenance where you know
that number of nodes is going to be below quorum.

--
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.


(Jörg Prante) #6

If you run 2 nodes with replica level 3 for a long time, you can decrease
replica level to 1. After re-adding nodes, you can increase replica level
again.

Jörg

--
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.


(Ankush Jhalani) #7

Agreed, and that's what we did but this is not ideal. When the node comes
back online all indices need to be re-synced completely. For big indices it
can take a lot time.

On Tuesday, October 29, 2013 5:45:38 PM UTC-4, Ankush Jhalani wrote:

I tried to update it dynamically but can't.
curl -XPUT 'http://localhost:9201/_cluster/nodes/_local?pretty' -d '
{ "settings.action.write_consistency" : "all" } '

{
"error" : "IndexMissingException[[_cluster] missing]",
"status" : 404
}

Is my syntax incorrect or is this setting not allowed to be set
dynamically?? This will be useful for a planned maintenance where you know
that number of nodes is going to be below quorum.

--
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.


(system) #8