Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 12-02-2015 12:01 PM
Does anyone know if we have an option for solr create_collection command to specify the nodes for the index to be created on?
Created 12-02-2015 12:08 PM
I believe this is what you are looking for
https://cwiki.apache.org/confluence/display/solr/Collections+API
createNodeSetstringNoAllows defining the nodes to spread the new collection across. If not provided, the CREATE operation will create shard-replica spread across all live Solr nodes. The format is a comma-separated list of node_names, such aslocalhost:8983_solr,localhost:8984_solr,localhost:8985_solr. Alternatively, use the special value ofEMPTYto initially create no shard-replica within the new collection and then later use the ADDREPLICA operation to add shard-replica when and where required.
Created 12-02-2015 12:08 PM
I believe this is what you are looking for
https://cwiki.apache.org/confluence/display/solr/Collections+API
createNodeSetstringNoAllows defining the nodes to spread the new collection across. If not provided, the CREATE operation will create shard-replica spread across all live Solr nodes. The format is a comma-separated list of node_names, such aslocalhost:8983_solr,localhost:8984_solr,localhost:8985_solr. Alternatively, use the special value ofEMPTYto initially create no shard-replica within the new collection and then later use the ADDREPLICA operation to add shard-replica when and where required.
Created 12-02-2015 12:09 PM
You have to use the option "createNodeSet"
Allows defining the nodes to spread the new collection across. If not provided, the CREATE operation will create shard-replica spread across all live Solr nodes. The format is a comma-separated list of node_names, such as localhost:8983_solr, localhost:8984_solr,localhost:8985_solr. Alternatively, use the special value of EMPTY to initially create no shard-replica within the new collection and then later use the ADDREPLICA operation to add shard-replica when and where required.
For example:
http://localhost:8983/solr/admin/collections?action=CREATE&name=newCollection&numShards=2&replicatio...
See full documentation here
Created 12-02-2015 12:33 PM
Thanks @Jonas Straub for the example.
Created 12-02-2015 12:24 PM
Thanks @Neeraj Sabharwal and @Jonas Straub.
Already asked customer to try this option but it did not work via command line. Did I miss something?
tried it and it didn't recognise the option: solr create_collection -c universe_counts -d /home/xyz/solrhorton/solr_universe_counts/universe_counts/ -n universe_counts -shards 1 -replicationFactor 3 -createNodeSet xyz01:8983_solr,xyz03:8983_solr,xyz05:8983_solr ERROR: Unrecognized or misplaced argument: -createNodeSet! Usage: solr create_collection [-c collection] [-d confdir] [-n configName] [-shards #] [-replicationFactor #] [-p port]
Created 12-02-2015 12:31 PM
@Arti Wadhwani I believe you need to do this using API
Created 12-02-2015 12:35 PM
Agree with @Neeraj Sabharwal this is an API specific command, I dont think this option is available via "solr create_collection..."
Created 12-05-2015 12:55 AM
@Arti Wadhwani Did it work?
Created 12-08-2015 06:55 PM
You can use a command line utility like 'curl' or 'wget' to make this REST PUT request from the command line.
Created 12-03-2015 02:53 PM
/ @Jonas Straub - how to pass -d confdir option in API ?