On 3/23/2015 9:27 AM, Shai Erera wrote: > 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.
I'd call that a bug. > 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>* Did you try out a URL like that to see whether it also results in the misnamed core, or if it behaves correctly as the reference guide indicates? If the URL behaves correctly, I'd be curious what Solr logs for the URL request and the SolrJ request. Thanks, Shawn