线程" main"中的例外情况org.apache.solr.client.solrj.SolrServerException:服务器拒绝连接:http:// localhost:8983 / solr

时间:2015-07-02 07:34:35

标签: solr

我正在尝试使用;

运行solr(5.2.1)
$ bin/solr start -e cloud -noprompt

但是我得到了

Welcome to the SolrCloud example!


Starting up 2 Solr nodes for your example SolrCloud cluster.

Starting up SolrCloud node1 on port 8983 using command:

solr start -cloud -s example/cloud/node1/solr -p 8983  -m 512m 


Waiting to see Solr listening on port 8983 [/]  Still not seeing Solr listening on 8983 after 30 seconds!
tail: cannot open '/home/altair/Solr/example/cloud/node1/solr/../logs/solr.log' for reading: No such file or directory


Starting node2 on port 7574 using command:

solr start -cloud -s example/cloud/node2/solr -p 7574 -z localhost:9983 -m 512m  


Waiting to see Solr listening on port 7574 [/]  Still not seeing Solr listening on 7574 after 30 seconds!
tail: cannot open '/home/altair/Solr/example/cloud/node2/solr/../logs/solr.log' for reading: No such file or directory
WARN  - 2015-07-02 10:22:47.156; org.apache.solr.util.SolrCLI; Request to http://localhost:8983/solr/admin/info/system failed due to: Connection refused, sleeping for 5 seconds before re-trying the request ...
Exception in thread "main" java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:220)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
    at org.apache.solr.util.SolrCLI.getJson(SolrCLI.java:527)
    at org.apache.solr.util.SolrCLI.getJson(SolrCLI.java:471)
    at org.apache.solr.util.SolrCLI.getJson(SolrCLI.java:481)
    at org.apache.solr.util.SolrCLI.getZkHost(SolrCLI.java:1156)
    at org.apache.solr.util.SolrCLI$CreateCollectionTool.runTool(SolrCLI.java:1210)
    at org.apache.solr.util.SolrCLI.main(SolrCLI.java:215)

Enabling auto soft-commits with maxTime 3 secs using the Config API

POSTing request to Config API: http://localhost:8983/solr/gettingstarted/config
{"set-property":{"updateHandler.autoSoftCommit.maxTime":"3000"}}

Exception in thread "main" org.apache.solr.client.solrj.SolrServerException: Server refused connection at: http://localhost:8983/solr
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:567)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:235)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:227)
    at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1220)
    at org.apache.solr.util.SolrCLI.postJsonToSolr(SolrCLI.java:1882)
    at org.apache.solr.util.SolrCLI$ConfigTool.runTool(SolrCLI.java:1856)
    at org.apache.solr.util.SolrCLI.main(SolrCLI.java:215)
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:466)
    ... 6 more


SolrCloud example running, please visit http://localhost:8983/solr 

我做了一些搜索,但我什么都没得到。我之前使用相同的命令启动了solr,但这次我得到了这个。

此错误的原因是什么,我该如何解决?

1 个答案:

答案 0 :(得分:0)

尝试在没有-e选项的情况下启动(不包括任何示例)。我遇到了同样的问题,甚至无法通过重启系统来解决。当我在开始时删除命令以包含示例时,它工作。

仅供参考:bin / solr start -noprompt