简体   繁体   English

SolrNet连接错误(IIS-> Tomcat),是由于同一子网上的服务器之间只有两个并发连接

[英]SolrNet connection errors (IIS->Tomcat) due to only two concurrent connections between servers on same subnet

I have an IIS server which serves a search page using SolrNet. 我有一个IIS服务器,该服务器使用SolrNet提供搜索页面。 The search index is Solr, running inside Tomcat, on a separate machine on the same subnet (in the same room). 搜索索引是Solr,它在Tomcat内的同一子网(位于同一房间)的另一台计算机上运行。

I get intermittent connection errors from IIS to the search server, mainly (InnerException): 我收到从IIS到搜索服务器的间歇性连接错误,主要是(InnerException):

Error: The operation has timed out
In: System.Net.WebResponse GetResponse()
Stack Trace: at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()

As well as sometimes (InnerException): 有时(InnerException):

Error: Unable to connect to the remote server
In: System.Net.WebResponse GetResponse()
Stack Trace: at System.Net.HttpWebRequest.GetResponse()

I believe the problem is that IIS only ever has two concurrent connections to Tomcat (which I can see using CurPorts ), so eventually the calls get so backed up it times out, but I can't work out why. 我相信问题在于IIS仅与Tomcat有两个并发连接(我可以使用CurPorts看到它们 ),因此最终调用被备份如此超时,但是我无法弄清楚原因。 My preview site, on the same server, is able to create more connections, but increasing the setting using this code in web.config makes no difference: 我在同一服务器上的预览站点可以创建更多连接,但是使用web.config中的以下代码来增加设置没有什么区别:

<connectionManagement>
  <add address="*" maxconnection="100"/>
</connectionManagement>

I have already increased the SolrNet timeout to 30s using: 我已经使用以下命令将SolrNet超时增加到30秒:

SolrNet.Startup.Init<SolrDataObject>(new SolrNet.Impl.SolrConnection(System.Configuration.ConfigurationManager.AppSettings["SolrURL"]) { Timeout = 30000 });

I first asked this question about these same errors - I have since found out that there are only ever two connections from IIS to Tomcat, and this seems a very likely cause for this problem to me. 我第一次问这个问题有关这些同样的错误-因为我已经发现,只有不断两位来自IIS到Tomcat的连接,这似乎对这个问题非常有可能的原因给我。

This was because the machine.config was apparently locked only for some sites in IIS - though I'm not sure how that happened, changing the machine.config fixed this problem. 这是因为machine.config显然仅针对IIS中的某些站点被锁定-尽管我不确定这是怎么发生的,更改machine.config可以解决此问题。

(This didn't fix the underlying problem, but I'll update that now) (这不能解决潜在的问题,但我现在将对其进行更新)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM