rocco
rocco

Reputation: 111

Solr Configuration

I tried to installed Solr using:

java -jar start.jar

However I downloaded the source code and didn't compile it (Didn't pay attention). And the error was:

http://localhost:8983/solr/admin/

HTTP ERROR: 404
Problem accessing /solr/admin/. Reason:
NOT_FOUND 

Then I downloaded the compiled version of solr but when trying to run the example configuration I'm getting exception:

java.net.BindException: Address already in use 

Is there a way to revert solr configuration and start from scratch? Looks like the configuration got messed up. I don't see anything related to it in the manual.

Here is the error:

2011-07-10 22:41:27.631:WARN::failed [email protected]:8983: java.net.BindException: Address already in use
2011-07-10 22:41:27.632:WARN::failed Server@c4e21db: java.net.BindException: Address already in use
2011-07-10 22:41:27.632:WARN::EXCEPTION 
java.net.BindException: Address already in use
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
    at java.net.ServerSocket.bind(ServerSocket.java:328)
    at java.net.ServerSocket.<init>(ServerSocket.java:194)
    at java.net.ServerSocket.<init>(ServerSocket.java:150)
    at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80)
    at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
    at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
    at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.Server.doStart(Server.java:235)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.mortbay.start.Main.invokeMain(Main.java:194)
    at org.mortbay.start.Main.start(Main.java:534)
    at org.mortbay.start.Main.start(Main.java:441)
    at org.mortbay.start.Main.main(Main.java:119)
Jul 10, 2011 10:41:27 PM org.apache.solr.core.SolrCore registerSearcher
INFO: [] Registered new searcher Searcher@5b6b9e62 main

Upvotes: 10

Views: 11357

Answers (6)

Mohamed23gharbi
Mohamed23gharbi

Reputation: 1780

ps aux  | grep solr

OR

ps aux | grep start.jar

AND the get then process id and kill it:

kill -9 #PID#

example : kill -9 4989

UPDATE: after killing the process if you want to reinstall solr you soul first uninstall it, the following is one of the solutions to uninstall it:

sudo service solr stop
sudo rm -r /var/solr
sudo rm -r /opt/solr-5.3.1
sudo rm -r /opt/solr
sudo rm /etc/init.d/solr
sudo deluser --remove-home solr
sudo deluser --group solr

An now you can reinstall it with no problem.

Upvotes: 2

Carlos Zerga
Carlos Zerga

Reputation: 190

Maybe some crazy idea is to use docker to read a complete extended step by step and repeatable installation:

Here dockerhub to select the specific version tu run in docker Docker Hub Solr

And here github to read the docker recipe Solr docker Recipe

Upvotes: 0

kenorb
kenorb

Reputation: 166319

If sudo lsof -i:8983 won't help finding application running on the same port, the common mistake is Tomcat misconfiguration (if you're using it).

For example by default Tomcat listens on port 8005 for SHUTDOWN command and if you set another Connector to listen on the same port, you'll get port conflict.

So please double check in server.xml if these ports are different:

<Server port="8005" shutdown="SHUTDOWN">
    <Connector port="8983" protocol="HTTP/1.1"

Upvotes: 0

Patricia
Patricia

Reputation: 934

This means you already have an application running on that particular port.

Run:

$ lsof -i :8983

This gives you a list of any application running on that port. In my case, Solr is already running, and I get back:

COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    10289 patricia  111u  IPv6 399410      0t0  TCP *:8983 (LISTEN)

Kill this process by filling in your PID:

$ kill 10289

And then try running Solr again.

Upvotes: 17

Charith De Silva
Charith De Silva

Reputation: 3720

Its bound to a some other application. In case if its a important app you can change jetty default port using following:

java -Djetty.port=8181 -jar start.jar

Upvotes: 6

Ray Baxter
Ray Baxter

Reputation: 3200

The java.net.BindException means that you are attempting to restart solr while an earlier instance continues to run, or less probably that you have something else running on port 8983. You should find that process, kill it, and then start solr again.

Upvotes: 9

Related Questions