是什么原因导致尝试启动Solr时Java异常“地址已在使用中”?

时间:2018-12-06 15:42:07

标签: solr lucene solrj

我正在尝试通过在Ubuntu(在Windows计算机上)上运行的Bash shell启动Solr。

我在/ solr目录中并运行bin/solr start,但收到以下错误消息:

```*** [WARN] *** Your open file limit is currently 1024.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 7823.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Waiting up to 180 seconds to see Solr running on port 8983 [/]  Still not seeing Solr listening on 8983 after 180 seconds!
2018-12-06 15:29:46.634 INFO  (main) [   ] o.a.s.m.r.SolrJmxReporter JMX monitoring for 'solr.jetty' (registry 'solr.jetty') enabled at server: com.sun.jmx.mbeanserver.JmxMBeanServer@453da22c
2018-12-06 15:29:46.670 INFO  (main) [   ] o.a.s.c.CorePropertiesLocator Found 0 core definitions underneath /mnt/d/Solr/solr-7.5.0/server/solr
2018-12-06 15:29:46.711 INFO  (main) [   ] o.e.j.s.h.ContextHandler Started o.e.j.w.WebAppContext@4e50c791{/solr,file:///mnt/d/Solr/solr-7.5.0/server/solr-webapp/webapp/,AVAILABLE}{/mnt/d/Solr/solr-7.5.0/server/solr-webapp/webapp}
2018-12-06 15:29:46.714 WARN  (main) [   ] o.e.j.x.XmlConfiguration
java.security.PrivilegedActionException: null
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_191]
        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1511) [jetty-xml-9.4.11.v20180605.jar:9.4.11.v20180605]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_191]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_191]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191]
        at org.eclipse.jetty.start.Main.invokeMain(Main.java:220) [start.jar:9.4.11.v20180605]
        at org.eclipse.jetty.start.Main.start(Main.java:486) [start.jar:9.4.11.v20180605]
        at org.eclipse.jetty.start.Main.main(Main.java:77) [start.jar:9.4.11.v20180605]
Caused by: java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_191]
        at sun.nio.ch.Net.bind(Net.java:433) ~[?:1.8.0_191]
        at sun.nio.ch.Net.bind(Net.java:425) ~[?:1.8.0_191]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_191]
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[?:1.8.0_191]
        at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:331) ~[jetty-server-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:299) ~[jetty-server-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235) ~[jetty-server-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.server.Server.doStart(Server.java:398) ~[jetty-server-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1572) ~[jetty-xml-9.4.11.v20180605.jar:9.4.11.v20180605]
        at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1512) ~[jetty-xml-9.4.11.v20180605.jar:9.4.11.v20180605]
        ... 9 more```

是什么原因导致此问题,以及如何解决?

1 个答案:

答案 0 :(得分:5)

Caused by: java.net.BindException: Address already in use意味着端口8983上已经有监听的东西。可能是您已经启动的其他Solr实例,或者是完全不同的东西。

您可以使用sudo lsof -i :8983查找导致它的进程。