Explicitly allocating shards to nodes

I am running ES 0.20.4. I want to physically tell the shards which node to
allocate to.

Set the following in elasticsearch.yml:
cluster.routing.allocation.disable_new_allocation: true
cluster.routing.allocation.disable_allocation: true

I create an index. The shards+replicas are not allocated. In *
reference/api/admin-cluster-reroute.html* the following statement:

“The cluster can be set to disable allocations, which means that only the
explicitly allocations will be performed. Obviously, only once all commands
has been applied, the cluster will aim to be re-balance its state.”

Makes me think that the if I change “c.r.a.disable_allocation: false”
through “transient” in the following command:

curl -XPUT localhost:9200/_cluster/settings -d
'{"transient":{"cluster.routing.allocation.disable_allocation":false}}'

that it should allow me to then allocate the shards with the command below:

curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands":[{"allocate": {"index":"x30","shard":0,"node":"node1" }}]
}'

but instead I receive the following error:

{"error":"RemoteTransportException[[node2][inet[/172.16.195.220:9300]][cluster/reroute]];
nested: ElasticSearchIllegalArgumentException[[allocate] trying to allocate
a primary shard [x30][0]], which is disabled]; ","status":400}

What am I doing wrong?

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

Hi,

The allow_primary needs to be set to true, it defaults to false:
http://www.elasticsearch.org/guide/reference/api/admin-cluster-reroute/

On 3 April 2013 00:47, Garth ghershfield.bah@gmail.com wrote:

I am running ES 0.20.4. I want to physically tell the shards which node to
allocate to.

Set the following in elasticsearch.yml:
cluster.routing.allocation.disable_new_allocation: true
cluster.routing.allocation.disable_allocation: true


I create an index. The shards+replicas are not allocated. In *
reference/api/admin-cluster-reroute.html* the following statement:


“The cluster can be set to disable allocations, which means that only the
explicitly allocations will be performed. Obviously, only once all commands
has been applied, the cluster will aim to be re-balance its state.”****

Makes me think that the if I change “c.r.a.disable_allocation: false”
through “transient” in the following command:****

curl -XPUT localhost:9200/_cluster/settings -d
'{"transient":{"cluster.routing.allocation.disable_allocation":false}}'


that it should allow me to then allocate the shards with the command below:


curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands":[{"allocate": {"index":"x30","shard":0,"node":"node1" }}]
}'


but instead I receive the following error:


{"error":"RemoteTransportException[[node2][inet[/172.16.195.220:9300]][cluster/reroute]];
nested: ElasticSearchIllegalArgumentException[[allocate] trying to allocate
a primary shard [x30][0]], which is disabled]; ","status":400}


What am I doing wrong?




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

--
Met vriendelijke groet,

Martijn van Groningen

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

Set the following in elasticsearch.yml on all nodes:
cluster.routing.allocation.disable_new_allocation: true
cluster.routing.allocation.disable_allocation: true
cluster.routing.allocation.allow_primary: true

Restarted them and fired off:
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands":[{"allocate": {"index":"x30","shard":0,"node":"node1"}}]
}'

Get the same error:
{"error":"RemoteTransportException[[node3][inet[/172.16.195.222:9300]][cluster/reroute]];
nested: ElasticSearchIllegalArgumentException[[allocate] trying to allocate
a primary shard [x30][0]], which is disabled]; ","status":400}

On Wednesday, April 3, 2013 5:48:29 AM UTC-4, Martijn v Groningen wrote:

Hi,

The allow_primary needs to be set to true, it defaults to false:
http://www.elasticsearch.org/guide/reference/api/admin-cluster-reroute/

On 3 April 2013 00:47, Garth <ghershf...@gmail.com <javascript:>> wrote:

I am running ES 0.20.4. I want to physically tell the shards which node
to allocate to.

Set the following in elasticsearch.yml:
cluster.routing.allocation.disable_new_allocation: true
cluster.routing.allocation.disable_allocation: true


I create an index. The shards+replicas are not allocated. In *
reference/api/admin-cluster-reroute.html* the following statement:


“The cluster can be set to disable allocations, which means that only the
explicitly allocations will be performed. Obviously, only once all commands
has been applied, the cluster will aim to be re-balance its state.”****

Makes me think that the if I change “c.r.a.disable_allocation: false”
through “transient” in the following command:****

curl -XPUT localhost:9200/_cluster/settings -d
'{"transient":{"cluster.routing.allocation.disable_allocation":false}}'


that it should allow me to then allocate the shards with the command
below:


curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands":[{"allocate": {"index":"x30","shard":0,"node":"node1" }}]
}'


but instead I receive the following error:


{"error":"RemoteTransportException[[node2][inet[/172.16.195.220:9300]][cluster/reroute]];
nested: ElasticSearchIllegalArgumentException[[allocate] trying to allocate
a primary shard [x30][0]], which is disabled]; ","status":400}


What am I doing wrong?




--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
Met vriendelijke groet,

Martijn van Groningen

--
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 think you need to use it in the request it self like this:
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands":[{"allocate": {"index":"x30","shard":0,"node":"node1",
"allow_primary" : true}}]
}'

On 3 April 2013 16:00, Garth ghershfield.bah@gmail.com wrote:

Set the following in elasticsearch.yml on all nodes:
cluster.routing.allocation.**disable_new_allocation: true
cluster.routing.allocation.**disable_allocation: true
cluster.routing.allocation.allow_primary: true

Restarted them and fired off:
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands":[{"allocate": {"index":"x30","shard":0,"node":"node1"}}]
}'

Get the same error:
{"error":"RemoteTransportException[[node3][inet[/172.16.195.222:9300]][cluster/reroute]];
nested: ElasticSearchIllegalArgumentException[[allocate] trying to allocate
a primary shard [x30][0]], which is disabled]; ","status":400}

On Wednesday, April 3, 2013 5:48:29 AM UTC-4, Martijn v Groningen wrote:

Hi,

The allow_primary needs to be set to true, it defaults to false:
http://www.elasticsearch.org/guide/reference/api/admin-
cluster-reroute/http://www.elasticsearch.org/guide/reference/api/admin-cluster-reroute/

On 3 April 2013 00:47, Garth ghershf...@gmail.com wrote:

I am running ES 0.20.4. I want to physically tell the shards which node
to allocate to.

Set the following in elasticsearch.yml:
cluster.routing.allocation.**disable_new_allocation: true
cluster.routing.allocation.**disable_allocation: true


I create an index. The shards+replicas are not allocated. In *
reference/api/admin-cluster-reroute.html* the following statement:


“The cluster can be set to disable allocations, which means that only
the explicitly allocations will be performed. Obviously, only once all
commands has been applied, the cluster will aim to be re-balance its state.”


Makes me think that the if I change “c.r.a.disable_allocation: false”
through “transient” in the following command:****

curl -XPUT localhost:9200/cluster/**settings -d
'{"transient":{"cluster.**routing.allocation.disable
**
allocation":false}}'


that it should allow me to then allocate the shards with the command
below:


curl -XPOST 'localhost:9200/_cluster/**reroute' -d '{
"commands":[{"allocate": {"index":"x30","shard":0,"**node":"node1" }}]
}'


but instead I receive the following error:


{"error":"**RemoteTransportException[[**node2][inet[/172.16.195.220:9300]][cluster/reroute]];
nested: ElasticSearchIllegalArgumentEx
ception[[allocate] trying to
allocate a primary shard [x30][0]], which is disabled]; ","status":400}


What am I doing wrong?




--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
Met vriendelijke groet,

Martijn van Groningen

--
Met vriendelijke groet,

Martijn van Groningen

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