Re: No live SolrServers Solr 4 exceptions on trying to create a collection
Hello! Can you share the command you use to start all four Solr servers ? -- Regards, Rafał Kuć Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch Any clue to why this is happening will be greatly appreciated. This has become a blocker for me. I can use the HTTPSolrServer to create a core/make requests etc, but then it behaves like Solr 3.6 http://host:port/solr/admin/cores and not http://host:port/solr/admin/collections With my setup (4 servers running at localhost 8983, 8900, 7574 and 7500) when I manually do a http://127.0.0.1:7500/solr/admin/cores?action=CREATEname=myColl1instanceDir=defaultdataDir=myColl1Datacollection=myColl1numShards=2 it creates the collection only at the 7500 server. This is similar to when I use HttpSolrServer (Solr 3.6 behavior). And of course when I initiate a http://127.0.0.1:7500/solr/admin/collections?action=CREATEname=myColl2instanceDir=defaultdataDir=myColl2Datacollection=myColl2numShards=2 as expected it creates the collection spread on 2 servers. I am failing to achieve the same with SolrJ. As in the code at the bottom of the mail, I use CloudSolrServer and get the No live SolrServers exception. Any help or direction will of how to create collections (using the collections API) using SolrJ will be highly appreciated. Regards Jay -Original Message- From: Jay Parashar [mailto:jparas...@itscape.com] Sent: Sunday, January 06, 2013 7:42 PM To: solr-user@lucene.apache.org Subject: RE: Solr 4 exceptions on trying to create a collection The exception No live SolrServers is being thrown when trying to create a new Collection ( code at end of this mail). On the CloudSolrServer request method, we have this line ClientUtils.appendMap(coll, slices, clusterState.getSlices(coll)); where coll is the new collection I am trying to create and hence clusterState.getSlices(coll)); is returning null. And then the loop of the slices which adds to the urlList never happens and hence the LBHttpSolrServer created in the CloudSolrServer has a null url list in the constructor. This is giving the No live SolrServers exception. What I am missing? Instead of passing the CloudSolrServer to the create.process, if I pass the LBHttpSolrServer (server.getLbServer()), the collection gets created but only on one server. My code to create a new Cloud Server and new Collection:- String[] urls = {http://127.0.0.1:8983/solr/,http://127.0.0.1:8900/solr/,http://127.0.0.1:7500/solr/,http://127.0.0.1:7574/solr/}; CloudSolrServer server = new CloudSolrServer(127.0.0.1:2181, new LBHttpSolrServer(urls)); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 5000); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 2); server.setDefaultCollection(collectionName); server.connect(); CoreAdminRequest.Create create = new CoreAdminRequest.Create(); create.setCoreName(myColl); create.setCollection(myColl); create.setInstanceDir(defaultDir); create.setDataDir(myCollData); create.setNumShards(2); create.process(server); //Exception No live SolrServers is thrown here Thanks Jay -Original Message- From: Alexandre Rafalovitch [mailto:arafa...@gmail.com] Sent: Friday, January 04, 2013 6:08 PM To: solr-user@lucene.apache.org Subject: Re: Solr 4 exceptions on trying to create a collection Tried Wireshark yet to see what host/port it is trying to connect and why it fails? It is a complex tool, but well worth learning. Regards, Alex. Personal blog: http://blog.outerthoughts.com/ LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch - Time is the quality of nature that keeps events from happening all at once. Lately, it doesn't seem to be working. (Anonymous - via GTD book) On Fri, Jan 4, 2013 at 6:58 PM, Jay Parashar jparas...@itscape.com wrote: Thanks! I had a different version of httpclient in the classpath. So the 2nd exception is gone but now I am back to the first one org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request -Original Message- From: Alexandre Rafalovitch [mailto:arafa...@gmail.com] Sent: Friday, January 04, 2013 4:21 PM To: solr-user@lucene.apache.org Subject: Re: Solr 4 exceptions on trying to create a collection For the second one: Wrong version of library on a classpath or multiple versions of library on the classpath which causes wrong classes with missing fields/variables? Or library interface baked in and the implementation is newer. Some sort of mismatch basically. Most probably in Apache http library. Regards, Alex. Personal blog: http://blog.outerthoughts.com/ LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch - Time is the quality of nature that keeps events from happening all at once. Lately, it doesn't seem to be working. (Anonymous - via GTD book) On
Re: No live SolrServers Solr 4 exceptions on trying to create a collection
On Jan 7, 2013, at 12:33 PM, Jay Parashar jparas...@itscape.com wrote: With my setup (4 servers running at localhost 8983, 8900, 7574 and 7500) when I manually do a http://127.0.0.1:7500/solr/admin/cores?action=CREATEname=myColl1instanceDir=defaultdataDir=myColl1Datacollection=myColl1numShards=2 it creates the collection only at the 7500 server. This is similar to when I use HttpSolrServer (Solr 3.6 behavior). This only starts one core. If you want to use the CoreAdmin API you would need to make four calls, one to each server. If you want this done for you, you must use the Collections API - see the wiki: http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collections_API - Mark
RE: No live SolrServers Solr 4 exceptions on trying to create a collection
Hi Rafat, The following are scripts started in the same order (external zk, 1 instance running at localhost:2181). I also tried with the embedded zk with the same result #Start of Server 1 export SOLR_HOME=/home/apache-solr-4.0.0 cd shard1A java \ -Djetty.port=8983 \ -Djetty.home=$SOLR_HOME/example/ \ -Dsolr.solr.home=multicore \ -Dbootstrap_confdir=./multicore/defaultCore/conf \ -Dcollection.configName=defaultConfig \ -DzkHost=localhost:2181 \ -DnumShards=2 \ -jar $SOLR_HOME/example/start.jar #Start of Server 2 export SOLR_HOME=/home/apache-solr-4.0.0 cd shard2A java \ -Djetty.port=8900 \ -Djetty.home=$SOLR_HOME/example/ \ -Dsolr.solr.home=multicore \ -DzkHost=localhost:2181 \ -jar $SOLR_HOME/example/start.jar #Start of Server 3 export SOLR_HOME=/home/apache-solr-4.0.0 cd shard1B java \ -Djetty.port=7574 \ -Djetty.home=$SOLR_HOME/example/ \ -Dsolr.solr.home=multicore \ -DzkHost=localhost:2181 \ -jar $SOLR_HOME/example/start.jar #Start of Server 4 export SOLR_HOME=/home/apache-solr-4.0.0 cd shard2B java \ -Djetty.port=7500 \ -Djetty.home=$SOLR_HOME/example/ \ -Dsolr.solr.home=multicore \ -DzkHost=localhost:2181 \ -jar $SOLR_HOME/example/start.jar Regards Jay -Original Message- From: Rafał Kuć [mailto:r@solr.pl] Sent: Monday, January 07, 2013 11:44 AM To: solr-user@lucene.apache.org Subject: Re: No live SolrServers Solr 4 exceptions on trying to create a collection Hello! Can you share the command you use to start all four Solr servers ? -- Regards, Rafał Kuć Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch Any clue to why this is happening will be greatly appreciated. This has become a blocker for me. I can use the HTTPSolrServer to create a core/make requests etc, but then it behaves like Solr 3.6 http://host:port/solr/admin/cores and not http://host:port/solr/admin/collections With my setup (4 servers running at localhost 8983, 8900, 7574 and 7500) when I manually do a http://127.0.0.1:7500/solr/admin/cores?action=CREATEname=myColl1instanceDir=defaultdataDir=myColl1Datacollection=myColl1numShards=2 it creates the collection only at the 7500 server. This is similar to when I use HttpSolrServer (Solr 3.6 behavior). And of course when I initiate a http://127.0.0.1:7500/solr/admin/collections?action=CREATEname=myColl2instanceDir=defaultdataDir=myColl2Datacollection=myColl2numShards=2 as expected it creates the collection spread on 2 servers. I am failing to achieve the same with SolrJ. As in the code at the bottom of the mail, I use CloudSolrServer and get the No live SolrServers exception. Any help or direction will of how to create collections (using the collections API) using SolrJ will be highly appreciated. Regards Jay -Original Message- From: Jay Parashar [mailto:jparas...@itscape.com] Sent: Sunday, January 06, 2013 7:42 PM To: solr-user@lucene.apache.org Subject: RE: Solr 4 exceptions on trying to create a collection The exception No live SolrServers is being thrown when trying to create a new Collection ( code at end of this mail). On the CloudSolrServer request method, we have this line ClientUtils.appendMap(coll, slices, clusterState.getSlices(coll)); where coll is the new collection I am trying to create and hence clusterState.getSlices(coll)); is returning null. And then the loop of the slices which adds to the urlList never happens and hence the LBHttpSolrServer created in the CloudSolrServer has a null url list in the constructor. This is giving the No live SolrServers exception. What I am missing? Instead of passing the CloudSolrServer to the create.process, if I pass the LBHttpSolrServer (server.getLbServer()), the collection gets created but only on one server. My code to create a new Cloud Server and new Collection:- String[] urls = {http://127.0.0.1:8983/solr/,http://127.0.0.1:8900/solr/,http://127.0.0.1:7500/solr/,http://127.0.0.1:7574/solr/}; CloudSolrServer server = new CloudSolrServer(127.0.0.1:2181, new LBHttpSolrServer(urls)); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 5000); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 2); server.setDefaultCollection(collectionName); server.connect(); CoreAdminRequest.Create create = new CoreAdminRequest.Create(); create.setCoreName(myColl); create.setCollection(myColl); create.setInstanceDir(defaultDir); create.setDataDir(myCollData); create.setNumShards(2); create.process(server); //Exception No live SolrServers is thrown here Thanks Jay -Original Message- From: Alexandre Rafalovitch [mailto:arafa...@gmail.com] Sent: Friday, January 04, 2013 6:08 PM To: solr-user@lucene.apache.org Subject: Re: Solr 4 exceptions on trying to create
RE: No live SolrServers Solr 4 exceptions on trying to create a collection
Right Mark, I am accessing the Collections API using Solrj. This is where I am stuck. If I just use the Collections API using http thru the browser, the behavior is as expected. Is there an example of using the Collections API using SolrJ? My code looks like String[] urls = {http://127.0.0.1:8983/solr/,http://127.0.0.1:8900/solr/,http://127.0.0 .1:7500/solr/,http://127.0.0.1:7574/solr/}; CloudSolrServer server = new CloudSolrServer(127.0.0.1:2181, new LBHttpSolrServer(urls)); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.CONNECTION_TIMEOUT, 5000); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.SO_TIMEOUT, 2); server.setDefaultCollection(collectionName); server.connect(); CoreAdminRequest.Create create = new CoreAdminRequest.Create(); create.setCoreName(myColl); create.setCollection(myColl); create.setInstanceDir(defaultDir); create.setDataDir(myCollData); create.setNumShards(2); create.process(server); //Exception No live SolrServers is thrown here Regards Jay -Original Message- From: Mark Miller [mailto:markrmil...@gmail.com] Sent: Monday, January 07, 2013 11:57 AM To: solr-user@lucene.apache.org Subject: Re: No live SolrServers Solr 4 exceptions on trying to create a collection On Jan 7, 2013, at 12:33 PM, Jay Parashar jparas...@itscape.com wrote: With my setup (4 servers running at localhost 8983, 8900, 7574 and 7500) when I manually do a http://127.0.0.1:7500/solr/admin/cores?action=CREATEname=myColl1instanceDi r=defaultdataDir=myColl1Datacollection=myColl1numShards=2 it creates the collection only at the 7500 server. This is similar to when I use HttpSolrServer (Solr 3.6 behavior). This only starts one core. If you want to use the CoreAdmin API you would need to make four calls, one to each server. If you want this done for you, you must use the Collections API - see the wiki: http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collectio ns_API - Mark
Re: No live SolrServers Solr 4 exceptions on trying to create a collection
Can you run the SolrJ client from another machine (so you go over the network) and put Wireshark in between? It will tell you if something is actually trying to connect of if the problem is even earlier. Otherwise, if you are on U*ix style machines look into dtrace/truss to see the activity. On Windows machines look at ProcessMonitor from Sysinternals. These are all 'hammer' size tools, but if you are truly stuck, they could be a way forward. Good luck, Alex. Personal blog: http://blog.outerthoughts.com/ LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch - Time is the quality of nature that keeps events from happening all at once. Lately, it doesn't seem to be working. (Anonymous - via GTD book) On Mon, Jan 7, 2013 at 1:20 PM, Jay Parashar jparas...@itscape.com wrote: Right Mark, I am accessing the Collections API using Solrj. This is where I am stuck. If I just use the Collections API using http thru the browser, the behavior is as expected. Is there an example of using the Collections API using SolrJ? My code looks like String[] urls = {http://127.0.0.1:8983/solr/,http://127.0.0.1:8900/solr/,; http://127.0.0 .1:7500/solr/,http://127.0.0.1:7574/solr/}; CloudSolrServer server = new CloudSolrServer(127.0.0.1:2181, new LBHttpSolrServer(urls)); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.CONNECTION_TIMEOUT, 5000); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.SO_TIMEOUT, 2); server.setDefaultCollection(collectionName); server.connect(); CoreAdminRequest.Create create = new CoreAdminRequest.Create(); create.setCoreName(myColl); create.setCollection(myColl); create.setInstanceDir(defaultDir); create.setDataDir(myCollData); create.setNumShards(2); create.process(server); //Exception No live SolrServers is thrown here Regards Jay -Original Message- From: Mark Miller [mailto:markrmil...@gmail.com] Sent: Monday, January 07, 2013 11:57 AM To: solr-user@lucene.apache.org Subject: Re: No live SolrServers Solr 4 exceptions on trying to create a collection On Jan 7, 2013, at 12:33 PM, Jay Parashar jparas...@itscape.com wrote: With my setup (4 servers running at localhost 8983, 8900, 7574 and 7500) when I manually do a http://127.0.0.1:7500/solr/admin/cores?action=CREATEname=myColl1instanceDi r=defaultdataDir=myColl1Datacollection=myColl1numShards=2 it creates the collection only at the 7500 server. This is similar to when I use HttpSolrServer (Solr 3.6 behavior). This only starts one core. If you want to use the CoreAdmin API you would need to make four calls, one to each server. If you want this done for you, you must use the Collections API - see the wiki: http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collectio ns_API - Mark
Re: No live SolrServers Solr 4 exceptions on trying to create a collection
http://127.0.0.1:7500/solr/admin/cores? Why did you paste that as the example then :) ? 4.0 has problems using the collections api with the CloudSolrServer. You will be able to do it for 4.1, but for 4.0 you have to use an HttpSolrServer and pick a node to talk to. For 4.0, CloudSolrServer is just good for querying and updating. - Mark On Jan 7, 2013, at 1:20 PM, Jay Parashar jparas...@itscape.com wrote: Right Mark, I am accessing the Collections API using Solrj. This is where I am stuck. If I just use the Collections API using http thru the browser, the behavior is as expected. Is there an example of using the Collections API using SolrJ? My code looks like String[] urls = {http://127.0.0.1:8983/solr/,http://127.0.0.1:8900/solr/,http://127.0.0 .1:7500/solr/,http://127.0.0.1:7574/solr/}; CloudSolrServer server = new CloudSolrServer(127.0.0.1:2181, new LBHttpSolrServer(urls)); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.CONNECTION_TIMEOUT, 5000); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.SO_TIMEOUT, 2); server.setDefaultCollection(collectionName); server.connect(); CoreAdminRequest.Create create = new CoreAdminRequest.Create(); create.setCoreName(myColl); create.setCollection(myColl); create.setInstanceDir(defaultDir); create.setDataDir(myCollData); create.setNumShards(2); create.process(server); //Exception No live SolrServers is thrown here Regards Jay -Original Message- From: Mark Miller [mailto:markrmil...@gmail.com] Sent: Monday, January 07, 2013 11:57 AM To: solr-user@lucene.apache.org Subject: Re: No live SolrServers Solr 4 exceptions on trying to create a collection On Jan 7, 2013, at 12:33 PM, Jay Parashar jparas...@itscape.com wrote: With my setup (4 servers running at localhost 8983, 8900, 7574 and 7500) when I manually do a http://127.0.0.1:7500/solr/admin/cores?action=CREATEname=myColl1instanceDi r=defaultdataDir=myColl1Datacollection=myColl1numShards=2 it creates the collection only at the 7500 server. This is similar to when I use HttpSolrServer (Solr 3.6 behavior). This only starts one core. If you want to use the CoreAdmin API you would need to make four calls, one to each server. If you want this done for you, you must use the Collections API - see the wiki: http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collectio ns_API - Mark
RE: No live SolrServers Solr 4 exceptions on trying to create a collection
Thanks Mark! I will wait for 4.1 then. Actually I pasted both /admin/cores and /admin/collections to highlight that the problem was only with SolrJ and both admin/collections and admin/collections were working as expected. Sorry for the confusion. Regards Jay -Original Message- From: Mark Miller [mailto:markrmil...@gmail.com] Sent: Monday, January 07, 2013 1:14 PM To: solr-user@lucene.apache.org Subject: Re: No live SolrServers Solr 4 exceptions on trying to create a collection http://127.0.0.1:7500/solr/admin/cores? Why did you paste that as the example then :) ? 4.0 has problems using the collections api with the CloudSolrServer. You will be able to do it for 4.1, but for 4.0 you have to use an HttpSolrServer and pick a node to talk to. For 4.0, CloudSolrServer is just good for querying and updating. - Mark On Jan 7, 2013, at 1:20 PM, Jay Parashar jparas...@itscape.com wrote: Right Mark, I am accessing the Collections API using Solrj. This is where I am stuck. If I just use the Collections API using http thru the browser, the behavior is as expected. Is there an example of using the Collections API using SolrJ? My code looks like String[] urls = {http://127.0.0.1:8983/solr/,http://127.0.0.1:8900/solr/,http://127.0.0 .1:7500/solr/,http://127.0.0.1:7574/solr/}; CloudSolrServer server = new CloudSolrServer(127.0.0.1:2181, new LBHttpSolrServer(urls)); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.CONNECTION_TIMEOUT, 5000); server.getLbServer().getHttpClient().getParams().setParameter(CoreConnection PNames.SO_TIMEOUT, 2); server.setDefaultCollection(collectionName); server.connect(); CoreAdminRequest.Create create = new CoreAdminRequest.Create(); create.setCoreName(myColl); create.setCollection(myColl); create.setInstanceDir(defaultDir); create.setDataDir(myCollData); create.setNumShards(2); create.process(server); //Exception No live SolrServers is thrown here Regards Jay -Original Message- From: Mark Miller [mailto:markrmil...@gmail.com] Sent: Monday, January 07, 2013 11:57 AM To: solr-user@lucene.apache.org Subject: Re: No live SolrServers Solr 4 exceptions on trying to create a collection On Jan 7, 2013, at 12:33 PM, Jay Parashar jparas...@itscape.com wrote: With my setup (4 servers running at localhost 8983, 8900, 7574 and 7500) when I manually do a http://127.0.0.1:7500/solr/admin/cores?action=CREATEname=myColl1instanceDi r=defaultdataDir=myColl1Datacollection=myColl1numShards=2 it creates the collection only at the 7500 server. This is similar to when I use HttpSolrServer (Solr 3.6 behavior). This only starts one core. If you want to use the CoreAdmin API you would need to make four calls, one to each server. If you want this done for you, you must use the Collections API - see the wiki: http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collectio ns_API - Mark