On 7/14/2017 6:29 AM, wg85907 wrote:
>         I use Solr(4.10.2) as indexing tool. I use a singleton
> CloudSolrServer instance to query Solr. When meet exception, for example
> current Solr server not response, i will create a new CloudSolrServer
> instance and shutdown the old one.

Why shutdown the object and create a new one?  That should not be necessary.

The SolrJ client objects, including CloudSolrServer (CloudSolrClient in
5.0 and later) are designed to be created once and used by multiple
threads until program exit.  Any problems you encounter with them should
be due to either an incorrect query or server side problems ... if you
are finding that the client stops working after encountering an error
and never starts working again, that's either a problem with your system
or a bug in SolrJ.  A problem with your system is more likely than a
bug, but a bug is always possible.

Since you're using CloudSolrServer and not CloudSolrClient, I am
assuming that your SolrJ version is also 4.x.  Upgrading is strongly
recommended.  Here are a few things you should know about why I am
making that recommendation:  Development on 4.x is completely dead since
the release of 6.0 in April 2016 -- any bug found in 4.x will NOT be
fixed.  The 5.x branch is in maintenance mode, which means that only
very major bugs will be fixed.  The current stable branch is 6.x -- the
vast majority of problems will only be fixed there.  The project is in
the process of gearing up for a 7.0 release, which will end development
on 5.x, put 6.x in maintenance mode, and make 7.x the stable branch.

> 2017-07-06 09:42:37,595 [myid:5] - WARN 
> [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:10199:NIOServerCnxnFactory@193] - Too 
> many connections from /169.171.87.37 - max is 60
>       So I just want to know if I operate CloudSolrServer in a wrong way and 
> do you have any suggestions about how to fill my requirement.

You should not be creating new CloudSolrServer instances.  That
exception may indicate that there is a bug in the shutdown method, but
as already said, you should not need to make a new client object.  Note
that a bug in the SolrServer#shutdown method in 4.x or 5.x isn't going
to be fixed.  In 6.x, the shutdown method is gone and the SolrClient
object now uses a close() method.  If 6.x has a problem with close(),
that is something we need to know.

Thanks,
Shawn

Reply via email to