我正在尝试将Windows上的CSV上的Solr索引上传到Linux上的Solr服务器。使用cygwin,我的curl命令如下所示:
curl --max-time 3600 http://10.xxx.xxx.xxx/solr/update/csv -F commit=true -F stream.url=file://10.xxx.xxx.xxx/Users/testdata/sample.csv -F stream.contentType=text/plain -F fieldnames=partId,desc,category
有问题的csv文件大小只有4K,但我仍然遇到连接超时错误。这些计算机位于同一网络中,没有防火墙或代理。 solr服务器在Tomcat 7上运行,我增加了connectionTimeOut = 3600000,但仍然没有帮助。有任何想法吗?感谢。
另外这是错误:
>HTTP Status 500 - Connection timed out
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.NetworkClient.openServer(NetworkClient.java:118)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:488)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:475)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:270)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:352)
at org.apache.solr.common.util.ContentStreamBase$URLStream.getStream(ContentStreamBase.java:88)
at org.apache.solr.common.util.ContentStreamBase.getReader(ContentStreamBase.java:165)
at org.apache.solr.handler.CSVLoader.load(CSVRequestHandler.java:355)
at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:58)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:241)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
再次感谢您的帮助。
答案 0 :(得分:1)
试试这个,看看你是否可以让它来更新数据。
curl 'http://10.xxx.xxx.xxx/solr/update/csv?fieldnames=partId,desc,category' -H 'Content-type:text/plain; charset=utf-8' --data-binary [file_name]
这比您使用的命令稍微简单,可能有助于识别出错的地方。您可能还需要检查Tomcat日志(/ var / log / tomcat7)以查看是否存在任何有意义的错误。