You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Adnan Yaqoob <it...@gmail.com> on 2015/03/18 20:32:57 UTC

CloudSolrServer : Could not find collection : gettingstarted

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*

Re: CloudSolrServer : Could not find collection : gettingstarted

Posted by Chris Hostetter <ho...@fucit.org>.
: Chris,
: Please find attached Dump

nothing jumps out at me as looking odd, but i'm not the expert on this 
stuff either -- hopefully someone else can take a look.

can you provide us with some more detials on what exactly you've done?  
you said ...

: > : What steps did you follow to create the collection in SolrCloud? It's
: > : possible you have the wrong ZK root somehow I suppose.
: > : [Adnan] - I followed the steps from reference guide -
: > :
: > https://cwiki.apache.org/confluence/display/solr/Getting+Started+with+SolrCloud
: > :
: > https://cwiki.apache.org/confluence/display/solr/Setting+Up+an+External+ZooKeeper+Ensemble

...but can you be more explicit please?  how exactly did you start up your 
solr nodes?  what exact commands did you run?

my best guess: maybe you've specified a chroot on your zk server when 
running Solr, but maybe you don't have that same chroot path when 
constructing the client?  knowing exactly how you started the solr 
processes would help (and/or: what "-DzkHost" option do you see in the 
"JVM" "Args" section of the "Dashboard" screen in the Solr UI; and/or 
what command line args do you specify when running zkcli to see the 
collection?) 





-Hoss
http://www.lucidworks.com/

Re: CloudSolrServer : Could not find collection : gettingstarted

Posted by Adnan Yaqoob <it...@gmail.com>.
Chris,
Please find attached Dump


On Thu, Mar 19, 2015 at 12:41 PM, Chris Hostetter <ho...@fucit.org>
wrote:

>
> : 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.
> : [Adnan]- Yes
>
> if you can see the collection in the admin ui, can you please use the
> "Dump" menu option in the "Cloud" section to get the full JSON details of
> your cloud setup and include all of that verbatim in an email?
>
> (I can't explain your problem, but those details might help folks spot
> where something went wrong)
>
>
>
> : What steps did you follow to create the collection in SolrCloud? It's
> : possible you have the wrong ZK root somehow I suppose.
> : [Adnan] - I followed the steps from reference guide -
> :
> https://cwiki.apache.org/confluence/display/solr/Getting+Started+with+SolrCloud
> :
> https://cwiki.apache.org/confluence/display/solr/Setting+Up+an+External+ZooKeeper+Ensemble
> :
> : The collection exists and active - I verified from Solr Admin - Cloud
> graph
> : as well as zkCli
> :
> : Adnan
> :
> : On Wed, Mar 18, 2015 at 8:36 PM, Erick Erickson <erickerickson@gmail.com
> >
> : wrote:
> :
> : > 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 <it...@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*
> : >
> :
> :
> :
> : --
> : Regards,
> : *Adnan Yaqoob*
> :
>
> -Hoss
> http://www.lucidworks.com/
>



-- 
Regards,
*Adnan Yaqoob*

Re: CloudSolrServer : Could not find collection : gettingstarted

Posted by Chris Hostetter <ho...@fucit.org>.
: 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.
: [Adnan]- Yes

if you can see the collection in the admin ui, can you please use the 
"Dump" menu option in the "Cloud" section to get the full JSON details of 
your cloud setup and include all of that verbatim in an email?

(I can't explain your problem, but those details might help folks spot 
where something went wrong)



: What steps did you follow to create the collection in SolrCloud? It's
: possible you have the wrong ZK root somehow I suppose.
: [Adnan] - I followed the steps from reference guide -
: https://cwiki.apache.org/confluence/display/solr/Getting+Started+with+SolrCloud
: https://cwiki.apache.org/confluence/display/solr/Setting+Up+an+External+ZooKeeper+Ensemble
: 
: The collection exists and active - I verified from Solr Admin - Cloud graph
: as well as zkCli
: 
: Adnan
: 
: On Wed, Mar 18, 2015 at 8:36 PM, Erick Erickson <er...@gmail.com>
: wrote:
: 
: > 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 <it...@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*
: >
: 
: 
: 
: -- 
: Regards,
: *Adnan Yaqoob*
: 

-Hoss
http://www.lucidworks.com/

Re: CloudSolrServer : Could not find collection : gettingstarted

Posted by Adnan Yaqoob <it...@gmail.com>.
Erick

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.
[Adnan]- Yes

What steps did you follow to create the collection in SolrCloud? It's
possible you have the wrong ZK root somehow I suppose.
[Adnan] - I followed the steps from reference guide -
https://cwiki.apache.org/confluence/display/solr/Getting+Started+with+SolrCloud
https://cwiki.apache.org/confluence/display/solr/Setting+Up+an+External+ZooKeeper+Ensemble

The collection exists and active - I verified from Solr Admin - Cloud graph
as well as zkCli

Adnan

On Wed, Mar 18, 2015 at 8:36 PM, Erick Erickson <er...@gmail.com>
wrote:

> 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 <it...@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*
>



-- 
Regards,
*Adnan Yaqoob*

Re: CloudSolrServer : Could not find collection : gettingstarted

Posted by Erick Erickson <er...@gmail.com>.
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 <it...@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*

Re: CloudSolrServer : Could not find collection : gettingstarted

Posted by Adnan Yaqoob <it...@gmail.com>.
Yes. Just before your email I was able to figure out. My project was set to
user solrj 4.10.3 everything was working fine except cloud so I didn't
noticed.
After I switched to Solrj 5 it's working now

Thanks everyone for supporting

Re: CloudSolrServer : Could not find collection : gettingstarted

Posted by Timothy Potter <th...@gmail.com>.
Are you using a SolrJ client from 4.x to connect to a Solr 5 cluster?

On Wed, Mar 18, 2015 at 1:32 PM, Adnan Yaqoob <it...@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*
>