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 Ritesh Kumar <ri...@hotwaxsystems.com> on 2018/07/02 07:49:07 UTC

Server refused connection at: http://localhost:xxxx/solr/collectionName

Hello Team,

I have two Solr nodes running in cloud mode. I know that we send queries
and updates directly to Solr's collection e.g.http://host:
port/solr/<your_collection_name>. Any of the Solr nodes can be used. If the
node does not have the collection being queried then the request will be
forwarded internally to a Solr instance which has that collection.

But, my question is what happens when the node being queried is down. I am
getting this
error: Server refused connection at http://localhost:xxxx
/solr/collectionName.

Does not Zookeeper handle this scenario?

Everything is fine when the node being queried is running. I am able to
index and fetch data.

Please, help me.

Best,
Ritesh Kumar

Re: Server refused connection at: http://localhost:xxxx/solr/collectionName

Posted by Ritesh Kumar <ri...@hotwaxsystems.com>.
I think this might be the problem. I was casting CloudSolrClient object or
HttpSolrClient object to SolrClient inside the indexing service and
performed add or query operation on this SolrClient object.

I had to cast the client object because the client object may be of any
type based on whether the Solr is running in cloud mode or stand-alone mode.

For now, I am using the CloudSolrClient.  Everything seems to be running
fine. I have not even closed the client object after execution.

I am still not sure if casting the client object to SolrClient was the
issue.

I am still looking for an answer where I should be able to run my
application in both the Solr modes with the same piece of code barring the
client object.



On Mon, Jul 2, 2018 at 7:49 PM Erick Erickson <er...@gmail.com>
wrote:

> Given your other e-mail I suspect you're not closing the client
> and creating new ones for every update request.
>
> You should simply not run out of connections, your client is
> most probably incorrect.
>
> Best,
> Erick
>
> On Mon, Jul 2, 2018 at 3:38 AM, Ritesh Kumar
> <ri...@hotwaxsystems.com> wrote:
> > I could get the live Solr nodes using this piece of code
> >
> >     ZkStateReader zkStateReader = client.getZkStateReader();
> >     ClusterState clusterState = zkStateReader.getClusterState();
> >     Set<String> liveNodes = clusterState.getLiveNodes();
> >
> > This way, I will be able to send a query to one of the live nodes and
> > Zookeeper will take care of the rest, but, I was wondering if this is a
> > good practice to query from SolrCloud.
> >
> > What if the Solr node goes down in the middle of bulk indexing.
> >
> > On Mon, Jul 2, 2018 at 3:37 PM Ritesh Kumar <
> ritesh.kumar@hotwaxsystems.com>
> > wrote:
> >
> >> I did use CloudSolrClient to query or index data. I did not have to
> check
> >> which Solr node is active. The problem I am facing during bulk indexing
> is
> >> that the Zookeeper runs out of connections resulting in Connection
> Timeout
> >> error.
> >>
> >> How can I get to know in advance the active Solr nodes? Any reference
> >> would be helpful.
> >>
> >> Thanks
> >>
> >> On Mon, Jul 2, 2018 at 2:36 PM Yasufumi Mizoguchi <
> yasufumi0410@gmail.com>
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> I think ZooKeeper can not notice requests to dead nodes, if you send
> >>> requests to Solr nodes directly.
> >>> It will be better that asking ZooKeeper which Solr nodes will be
> running
> >>> before requesting Solr nodes with CloudSolrClient etc...
> >>>
> >>> Thanks,
> >>> Yasufumi
> >>>
> >>> 2018年7月2日(月) 16:49 Ritesh Kumar <ri...@hotwaxsystems.com>:
> >>>
> >>> > Hello Team,
> >>> >
> >>> > I have two Solr nodes running in cloud mode. I know that we send
> queries
> >>> > and updates directly to Solr's collection e.g.http://host:
> >>> > port/solr/<your_collection_name>. Any of the Solr nodes can be used.
> If
> >>> the
> >>> > node does not have the collection being queried then the request
> will be
> >>> > forwarded internally to a Solr instance which has that collection.
> >>> >
> >>> > But, my question is what happens when the node being queried is
> down. I
> >>> am
> >>> > getting this
> >>> > error: Server refused connection at http://localhost:xxxx
> >>> > /solr/collectionName.
> >>> >
> >>> > Does not Zookeeper handle this scenario?
> >>> >
> >>> > Everything is fine when the node being queried is running. I am able
> to
> >>> > index and fetch data.
> >>> >
> >>> > Please, help me.
> >>> >
> >>> > Best,
> >>> > Ritesh Kumar
> >>> >
> >>>
> >>
>

Re: Server refused connection at: http://localhost:xxxx/solr/collectionName

Posted by Erick Erickson <er...@gmail.com>.
Given your other e-mail I suspect you're not closing the client
and creating new ones for every update request.

You should simply not run out of connections, your client is
most probably incorrect.

Best,
Erick

On Mon, Jul 2, 2018 at 3:38 AM, Ritesh Kumar
<ri...@hotwaxsystems.com> wrote:
> I could get the live Solr nodes using this piece of code
>
>     ZkStateReader zkStateReader = client.getZkStateReader();
>     ClusterState clusterState = zkStateReader.getClusterState();
>     Set<String> liveNodes = clusterState.getLiveNodes();
>
> This way, I will be able to send a query to one of the live nodes and
> Zookeeper will take care of the rest, but, I was wondering if this is a
> good practice to query from SolrCloud.
>
> What if the Solr node goes down in the middle of bulk indexing.
>
> On Mon, Jul 2, 2018 at 3:37 PM Ritesh Kumar <ri...@hotwaxsystems.com>
> wrote:
>
>> I did use CloudSolrClient to query or index data. I did not have to check
>> which Solr node is active. The problem I am facing during bulk indexing is
>> that the Zookeeper runs out of connections resulting in Connection Timeout
>> error.
>>
>> How can I get to know in advance the active Solr nodes? Any reference
>> would be helpful.
>>
>> Thanks
>>
>> On Mon, Jul 2, 2018 at 2:36 PM Yasufumi Mizoguchi <ya...@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I think ZooKeeper can not notice requests to dead nodes, if you send
>>> requests to Solr nodes directly.
>>> It will be better that asking ZooKeeper which Solr nodes will be running
>>> before requesting Solr nodes with CloudSolrClient etc...
>>>
>>> Thanks,
>>> Yasufumi
>>>
>>> 2018年7月2日(月) 16:49 Ritesh Kumar <ri...@hotwaxsystems.com>:
>>>
>>> > Hello Team,
>>> >
>>> > I have two Solr nodes running in cloud mode. I know that we send queries
>>> > and updates directly to Solr's collection e.g.http://host:
>>> > port/solr/<your_collection_name>. Any of the Solr nodes can be used. If
>>> the
>>> > node does not have the collection being queried then the request will be
>>> > forwarded internally to a Solr instance which has that collection.
>>> >
>>> > But, my question is what happens when the node being queried is down. I
>>> am
>>> > getting this
>>> > error: Server refused connection at http://localhost:xxxx
>>> > /solr/collectionName.
>>> >
>>> > Does not Zookeeper handle this scenario?
>>> >
>>> > Everything is fine when the node being queried is running. I am able to
>>> > index and fetch data.
>>> >
>>> > Please, help me.
>>> >
>>> > Best,
>>> > Ritesh Kumar
>>> >
>>>
>>

Re: Server refused connection at: http://localhost:xxxx/solr/collectionName

Posted by Ritesh Kumar <ri...@hotwaxsystems.com>.
I could get the live Solr nodes using this piece of code

    ZkStateReader zkStateReader = client.getZkStateReader();
    ClusterState clusterState = zkStateReader.getClusterState();
    Set<String> liveNodes = clusterState.getLiveNodes();

This way, I will be able to send a query to one of the live nodes and
Zookeeper will take care of the rest, but, I was wondering if this is a
good practice to query from SolrCloud.

What if the Solr node goes down in the middle of bulk indexing.

On Mon, Jul 2, 2018 at 3:37 PM Ritesh Kumar <ri...@hotwaxsystems.com>
wrote:

> I did use CloudSolrClient to query or index data. I did not have to check
> which Solr node is active. The problem I am facing during bulk indexing is
> that the Zookeeper runs out of connections resulting in Connection Timeout
> error.
>
> How can I get to know in advance the active Solr nodes? Any reference
> would be helpful.
>
> Thanks
>
> On Mon, Jul 2, 2018 at 2:36 PM Yasufumi Mizoguchi <ya...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I think ZooKeeper can not notice requests to dead nodes, if you send
>> requests to Solr nodes directly.
>> It will be better that asking ZooKeeper which Solr nodes will be running
>> before requesting Solr nodes with CloudSolrClient etc...
>>
>> Thanks,
>> Yasufumi
>>
>> 2018年7月2日(月) 16:49 Ritesh Kumar <ri...@hotwaxsystems.com>:
>>
>> > Hello Team,
>> >
>> > I have two Solr nodes running in cloud mode. I know that we send queries
>> > and updates directly to Solr's collection e.g.http://host:
>> > port/solr/<your_collection_name>. Any of the Solr nodes can be used. If
>> the
>> > node does not have the collection being queried then the request will be
>> > forwarded internally to a Solr instance which has that collection.
>> >
>> > But, my question is what happens when the node being queried is down. I
>> am
>> > getting this
>> > error: Server refused connection at http://localhost:xxxx
>> > /solr/collectionName.
>> >
>> > Does not Zookeeper handle this scenario?
>> >
>> > Everything is fine when the node being queried is running. I am able to
>> > index and fetch data.
>> >
>> > Please, help me.
>> >
>> > Best,
>> > Ritesh Kumar
>> >
>>
>

Re: Server refused connection at: http://localhost:xxxx/solr/collectionName

Posted by Ritesh Kumar <ri...@hotwaxsystems.com>.
I did use CloudSolrClient to query or index data. I did not have to check
which Solr node is active. The problem I am facing during bulk indexing is
that the Zookeeper runs out of connections resulting in Connection Timeout
error.

How can I get to know in advance the active Solr nodes? Any reference would
be helpful.

Thanks

On Mon, Jul 2, 2018 at 2:36 PM Yasufumi Mizoguchi <ya...@gmail.com>
wrote:

> Hi,
>
> I think ZooKeeper can not notice requests to dead nodes, if you send
> requests to Solr nodes directly.
> It will be better that asking ZooKeeper which Solr nodes will be running
> before requesting Solr nodes with CloudSolrClient etc...
>
> Thanks,
> Yasufumi
>
> 2018年7月2日(月) 16:49 Ritesh Kumar <ri...@hotwaxsystems.com>:
>
> > Hello Team,
> >
> > I have two Solr nodes running in cloud mode. I know that we send queries
> > and updates directly to Solr's collection e.g.http://host:
> > port/solr/<your_collection_name>. Any of the Solr nodes can be used. If
> the
> > node does not have the collection being queried then the request will be
> > forwarded internally to a Solr instance which has that collection.
> >
> > But, my question is what happens when the node being queried is down. I
> am
> > getting this
> > error: Server refused connection at http://localhost:xxxx
> > /solr/collectionName.
> >
> > Does not Zookeeper handle this scenario?
> >
> > Everything is fine when the node being queried is running. I am able to
> > index and fetch data.
> >
> > Please, help me.
> >
> > Best,
> > Ritesh Kumar
> >
>

Re: Server refused connection at: http://localhost:xxxx/solr/collectionName

Posted by Yasufumi Mizoguchi <ya...@gmail.com>.
Hi,

I think ZooKeeper can not notice requests to dead nodes, if you send
requests to Solr nodes directly.
It will be better that asking ZooKeeper which Solr nodes will be running
before requesting Solr nodes with CloudSolrClient etc...

Thanks,
Yasufumi

2018年7月2日(月) 16:49 Ritesh Kumar <ri...@hotwaxsystems.com>:

> Hello Team,
>
> I have two Solr nodes running in cloud mode. I know that we send queries
> and updates directly to Solr's collection e.g.http://host:
> port/solr/<your_collection_name>. Any of the Solr nodes can be used. If the
> node does not have the collection being queried then the request will be
> forwarded internally to a Solr instance which has that collection.
>
> But, my question is what happens when the node being queried is down. I am
> getting this
> error: Server refused connection at http://localhost:xxxx
> /solr/collectionName.
>
> Does not Zookeeper handle this scenario?
>
> Everything is fine when the node being queried is running. I am able to
> index and fetch data.
>
> Please, help me.
>
> Best,
> Ritesh Kumar
>