我正在从 MongoDB Solr 加载数据。
SolrInputDocument doc = new SolrInputDocument();
BasicDBObject record = (BasicDBObject) cursor.next();
doc.addField("_id", record.get("_id"));
// add more fields
server.add(doc);
server.commit();
我正处于异常之下。
Exception in thread "main" org.apache.solr.client.solrj.SolrServerException: java.net.ConnectException: Connection timed out: connect
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:483)
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244)
at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:64)
Caused by: java.net.ConnectException: Connection timed out: connect
此代码之前适用于我。我没有更改代码中的任何内容。但现在添加少量文件后给出了错误。这有什么不对?