I started a Solrcloud by running the included example bin/solr -e cloud
, and in that case, I managed to start up a three nodes Solr cloud and created a gettingstarted
collection:
http://localhost:8983/solr/admin/collections?action=CREATE&name=gettingstarted&numShards=3&replicationFactor=2&maxShardsPerNode=2&collection.configName=gettingstarted
I think it comes with a embedded zookeeper running on port 9983 because I saw this output when I started the cloud:
...
Starting up Solr on port 7574 using command:
bin/solr start -cloud -p 7574 -s "example/cloud/node2/solr" -z localhost:9983
Waiting up to 30 seconds to see Solr running on port 7574 [/]
...
However, when I tried to connect to the SolrCloud using SolrJ, it failed with the error message:
Exception in thread "main" org.apache.solr.common.SolrException: Cannot connect to cluster at localhost:9983/solr: cluster not found/not ready
Can anyone help me understand what is going on here?
/solr
appears at the end of the query string. This would be needed when you have a chroot at/solr
within Zookeeper. For most configurations this can be omitted. – Dimitry