3

So I've installed Solr on a linux server and I want to access it from another web server and/or my computer.

From the Solar Server, I can see that it's running

[root@solr ~]# wget -qO- http://localhost:8983/solr




<html>
<head>
<link rel="stylesheet" type="text/css" href="solr-admin.css">
<link rel="icon" href="favicon.ico" type="image/ico"></link>
<link rel="shortcut icon" href="favicon.ico" type="image/ico"></link>
<title>Welcome to Solr</title>
</head>

<body>
<h1>Welcome to Solr!</h1>
<a href="."><img border="0" align="right" height="78" width="142" src="admin/solr_small.png" alt="Solr"/></a>


<a href="admin/">Solr Admin</a>


</body>
</html>

However, plugging http://192.168.1.19:8983/solr/ into my browser, or pinging from my web server, fails to connect. How do I make Solr accessible to other devices on my network?


# netstat -anp | grep :8983
tcp        0      0 :::8983                     :::*                        LISTEN      15138/java 

$ telnet 192.168.1.19 8983
Trying 192.168.1.19...
telnet: connect to address 192.168.1.19: Connection refused
telnet: Unable to connect to remote host
Steve Robbins
  • 1,904
  • 5
  • 23
  • 26

3 Answers3

3

How are you running Solr? Under Tomcat? I will assume so, since I know how to restrict to localhost under Tomcat & if you just undo what I do to restrict it, then you can network your Solr install.

In my case, I disallow Tomcat from dealing with the outside world—I prefer Apache reverse proxying—so I do the following.

I edit the Tomcat server.xml over here:

/etc/tomcat6/server.xml

I look for the Connector settings and add address="127.0.0.1" which locks the Tomcat install to 127.0.0.1 (aka: localhost)

<Connector port="8080" protocol="HTTP/1.1"
           address="127.0.0.1"
           connectionTimeout="20000"
           URIEncoding="UTF-8"
           redirectPort="8443" />

So in your case, I would just remove the address setting like so:

<Connector port="8080" protocol="HTTP/1.1"  
           connectionTimeout="20000"
           URIEncoding="UTF-8"
           redirectPort="8443" />

But then again, no idea how your Solr instance is being served. And if it’s not being served via Tomcat, then someone else needs to chime in.

Giacomo1968
  • 3,522
  • 25
  • 38
0

Can you check that the Solr server is listening to the correct interfaces ?

What's the output of :

netstat -anp | grep :8983

If you see 127.0.0.1:8983 or ::1:8983 that's because your server don't listen to the outside world. You can correct this by editing the configuration of the webserver you are using.

Otherwise, if you see 0.0.0.0:8983 the issue may be somewhere else.

Adrien M.
  • 226
  • 2
  • 5
  • I've updated my answer with the output. – Steve Robbins Nov 07 '13 at 23:41
  • Ok, now can you precise what kind of error it is : A conection Timeout, or a connection refused ? If you issue a `telnet 192.168.1.9 8983` on your client, what's the output ? If it's a Timeout, it should be a firewall or connectivity issue. If it's a Refuse, the server explicitely refused the connection: the firewall or the application explicitely refused it. – Adrien M. Nov 08 '13 at 08:42
  • The connection is being refused. How do I allow it? – Steve Robbins Nov 08 '13 at 18:08
0

If you are using datastax, update (in cassandra.yaml) the listen_address: and rpc_address: to the IP address of the machine and it will work.

By default it's mentioned as localhost.

Daniele Santi
  • 2,479
  • 1
  • 25
  • 22
Sachin
  • 1