Hi Team,
I came across a strange behavior:
When I use the default cluster policy like:
```
{
"cluster-preferences":[
{
"minimize":"cores",
"precision":1},
{"maximize":"freedisk"}],
"triggers":{".auto_add_replicas":{
"name":".auto_add_replicas",
"event":"nodeLost",
"waitFor":120,
"actions":[
{
"name":"auto_add_replicas_plan",
"class":"solr.AutoAddReplicasPlanAction"},
{
"name":"execute_plan",
"class":"solr.ExecutePlanAction"}],
"enabled":true}},
"listeners":{".auto_add_replicas.system":{
"beforeAction":[],
"afterAction":[],
"trigger":".auto_add_replicas",
"stage":[
"STARTED",
"ABORTED",
"SUCCEEDED",
"FAILED",
"BEFORE_ACTION",
"AFTER_ACTION",
"IGNORED"],
"class":"org.apache.solr.cloud.autoscaling.SystemLogListener"}},
"properties":{}}
```
I can run a utilize node to move replica to new nodes, but there is a
problem:
Before run the command, the replica placement like:
[image: 屏幕快照 2019-11-01 17.23.19.png]
After run utilize node command, sometimes the replica belongs to one shard
placed to a same node, which is not I want.
[image: 屏幕快照 2019-11-01 17.22.24.png]
Then I set the cluster policy with the command:
```
curl http://localhost:8983/solr/admin/autoscaling -H
'Content-type:application/json' -d '{
"set-cluster-policy" : [{
"replica" : "1",
"shard" : "#EACH",
"node" : "#ANY",
}]
}'
curl http://localhost:8983/solr/admin/autoscaling -H
'Content-type:application/json' -d '{
"set-trigger": {
"name" : "node_added_trigger",
"event" : "nodeAdded",
"waitFor" : "5s",
"preferredOperation": "ADDREPLICA",
"enabled" : true,
"actions" : [
{
"name" : "compute_plan",
"class": "solr.ComputePlanAction"
},
{
"name" : "execute_plan",
"class": "solr.ExecutePlanAction"
}
]
}
}'
···
Then I send the utilize node command to move replica to new nodes, I found
the command doesn't work.
The replica placement like:
[image: 屏幕快照 2019-11-01 17.23.19.png]
It doesn't move any replica.
The autoscaling.json likes:
```
{
"cluster-preferences":[
{
"minimize":"cores",
"precision":1},
{"maximize":"freedisk"}],
"cluster-policy":[{
"replica":"1",
"shard":"#EACH",
"node":"#ANY"}],
"triggers":{
".auto_add_replicas":{
"name":".auto_add_replicas",
"event":"nodeLost",
"waitFor":120,
"actions":[
{
"name":"auto_add_replicas_plan",
"class":"solr.AutoAddReplicasPlanAction"},
{
"name":"execute_plan",
"class":"solr.ExecutePlanAction"}],
"enabled":true},
"node_added_trigger":{
"preferredOperation":"ADDREPLICA",
"event":"nodeAdded",
"waitFor":5,
"actions":[
{
"name":"compute_plan",
"class":"solr.ComputePlanAction"},
{
"name":"execute_plan",
"class":"solr.ExecutePlanAction"}],
"enabled":true}},
"listeners":{
".auto_add_replicas.system":{
"trigger":".auto_add_replicas",
"afterAction":[],
"stage":[
"STARTED",
"ABORTED",
"SUCCEEDED",
"FAILED",
"BEFORE_ACTION",
"AFTER_ACTION",
"IGNORED"],
"class":"org.apache.solr.cloud.autoscaling.SystemLogListener",
"beforeAction":[]},
"node_added_trigger.system":{
"beforeAction":[],
"afterAction":[],
"trigger":"node_added_trigger",
"stage":[
"STARTED",
"ABORTED",
"SUCCEEDED",
"FAILED",
"BEFORE_ACTION",
"AFTER_ACTION",
"IGNORED"],
"class":"org.apache.solr.cloud.autoscaling.SystemLogListener"}},
"properties":{}}
```
My solr version is 7.3. Do I use it in a wrong way?
--
Thanks & regards,
Yuan Zhao