On 11/27/22 18:03, Aravind Reddy Jangam wrote:
I created collection using below command, core name on each server is different
like doc1_shard1_replica_n15 & doc1_shard2_replica_n4
Is it possible to rename core name, I would like to have same core on all
servers like doc1
./bin/solr create_collection -c doc1 -s 4 -rf 2 -force
1) In cloud mode, you really need to stop worrying about cores and only
consider collections. Let Solr handle the cores. It is probably
possible to rename them with some manual surgery on both the filesystem
and in zookeeper, but doing that is extremely risky. Trying to use the
CoreAdmin API is similarly risky. Just don't do it.
2) It looks like you're still running bin/solr as root. Don't do that.
The script refuses to run as root without the -force option, which I am
sure you have figured out.
3) Addressing your other email: If you want to control which server
gets which shard, I don't think that's doable at creation time. But you
can use the ADDREPLICA and DELETEREPLICA actions on the collections API
to put replicas where you want them. If those actions are taken before
any data is indexed, then they will be very fast.
4) You really don't want every core for a collection to have the same
name, especially if that name is the same as the collection. If it has
the same name as the collection, then you would never be able to send a
request directly to the core if you really needed to. It would always
go to the collection. Also, one node would not be able to handle more
than one shard, which is required if you start out with more shards than
nodes, with the idea that you will increase the number of nodes later as
the index grows. In Solr 4.0.0 when cloud mode was introduced, every
core had the same name as the collection. That was quickly changed
because it had too many limitations.
Thanks,
Shawn