Hi I have a Solr cluster started (all programmatically) with one Solr node, one collection and one shard. I set the replicationFactor to 1. The name of the result core was set to mycollection_shard1_replica1.
I then start a second Solr node and issue an ADDREPLICA command as described in the reference guide, using following code: final CollectionAdminRequest.AddReplica addReplicaRequest = new CollectionAdminRequest.AddReplica(); addReplicaRequest.setCollectionName("mycollection"); addReplicaRequest.setShardName("shard1"); final CollectionAdminResponse response = addReplicaRequest.process(solrClient); The replica is added under a core named "mycollection" and not e.g. mycollection_shard1_replica2. If I start the two nodes before I create the collection, and set replicationFactor=2, the cores are named mycollection_shard1_replica1 and *_replica2. Is there a way to auto-name replicas using such sequential ID? Or should I count the number of replicas the shard already has and implement this sequencing myself? I tried that, using this code: final ClusterState clusterState = solrClient.getZkStateReader().getClusterState(); int numReplicas = clusterState.getSlice("mycollection", "shard1").getReplicas().size(); final String coreName = "mycollection_shard1_replica" + (numReplicas + 1); final Properties props = new Properties(); props.setProperty("name", coreName); addReplicaRequest.setProperties(props); But that didn't help. The replica was created under core name "mycollection" and inside core.properties, the 'name' property was set to "mycollection". Is that the correct programmatic way to set the properties as described in the reference guide, i.e. pass property.name=value, which then references the core.properties properties? When I set the instanceDir though, like that: addReplicaRequest.setInstanceDir(coreName); The replica was created under the expected core directory (mycollection_shard1_replica2), however core.properties 'name' was still set to 'mycollection'. BTW, the example in the reference guide shows that issuing the request: http://localhost:8983/solr/admin/collections?action=ADDREPLICA&collection=test2&shard=shard2&node=192.167.1.2:8983_solr Results in <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">3764</int> </lst> <lst name="success"> <lst> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">3450</int> </lst> * <str name="core">test2_shard2_replica4</str>* </lst> </response> This example got me to think that replicas are auto-named, because nothing in the request sets the instanceDir, core name etc. to test2_shard2_replica4. Shai