Does the Solr admin UI>>cloud view show the gettingstarted collection? The "graph" view might help. It _sounds_ like somehow you didn't actually create the collection.
What steps did you follow to create the collection in SolrCloud? It's possible you have the wrong ZK root somehow I suppose. Best, Erick On Wed, Mar 18, 2015 at 12:32 PM, Adnan Yaqoob <itsad...@gmail.com> wrote: > I'm getting following exception while trying to upload document on > SolrCloud using CloudSolrServer. > > Exception in thread "main" org.apache.solr.common.SolrException: > *Could not find collection :* gettingstarted > at > org.apache.solr.common.cloud.ClusterState.getCollection(ClusterState.java:162) > at > org.apache.solr.client.solrj.impl.CloudSolrServer.directUpdate(CloudSolrServer.java:305) > at > org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:533) > at > org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:124) > at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:116) > at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:102) > at Test.addDocumentSolrCloud(Test.java:265) > at Test.main(Test.java:284) > > I can query through Solr admin, able to upload document using > HttpSolrServer (single instance - non cloud mode) but CloudSolrServer. I've > also verified the collection exists on zookeeper using zkCli command. > > Following is the code snippet > > CloudSolrServer server = new CloudSolrServer("localhost:2181"); > server.setDefaultCollection("gettingstarted"); > SolrInputDocument doc = new SolrInputDocument(); > doc.addField("id", id); > doc.addField("name", name); > > server.add(doc); > > server.commit(); > > Not sure what I'm missing. My Zookeeper is running externally with two solr > nodes on same mac > > -- > Regards, > *Adnan Yaqoob*