1

I recently moved sphinx onto the same server as our db so our architecture is:

  1. File Server that hosts our web app
  2. DB server w/ Sphinx instance (searchd)

When I try to connect to sphinx at ip.to.db.server I get the following error:

Sphinx response connection to ip.to.db.server:9312 failed (errno=113, msg=No route to host)

Is there something special I need to do to make port 9312 accessible to my web app?

Current TCP ports LISTENing:

tcp        0      0 0.0.0.0:9306                0.0.0.0:*                   LISTEN      23496/searchd       
tcp        0      0 0.0.0.0:9312                0.0.0.0:*                   LISTEN      23496/searchd 

Output of iptables -L:

Chain INPUT (policy ACCEPT) 
target     prot opt source               destination         
fail2ban-ssh  tcp  --  anywhere             anywhere            multiport dports ssh 
RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh /* SSH */ 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:lmsocialserver /* monit */ 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https /* HTTPS */ 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:webcache /* HTTPProxy */ 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http /* HTTP */ 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:mysql /* MySQL */ 
ACCEPT     all  --  ipremoved_by_poster  anywhere            /* Rackspace monitoring */ 
ACCEPT     all  --  ipremoved_by_poster  anywhere            /* Rackspace monitoring */ 
ACCEPT     all  --  ipremoved_by_poster  anywhere            /* Rackspace monitoring */ 
ACCEPT     all  --  ipremoved_by_poster  anywhere            /* Rackspace monitoring */ 
ACCEPT     all  --  ipremoved_by_poster  anywhere            /* Rackspace monitoring */ 
ACCEPT     all  --  ipremoved_by_poster  anywhere            /* Rackspace monitoring */ 
ACCEPT     all  --  ipremoved_by_poster  anywhere            /* Rackspace monitoring */ 
ACCEPT     all  --  anywhere             anywhere            /* localhost */ 
ACCEPT     icmp --  anywhere             anywhere            icmp any /* ping */ 
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain fail2ban-ssh (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere 

I've done lots of searching with no luck so far. Any help is much appreciated.

E

Eric Uldall
  • 161
  • 2
  • 10

1 Answers1

2

The problem was IPTABLES was blocking my remote connection so I added two lines to be safe:

vi /etc/sysconfig/iptables

add the following lines:

-A RH-Firewall-1-INPUT -i eth1 -p tcp -m tcp --dport 9312 -m comment --comment "Sphinx" -j ACCEPT
-A RH-Firewall-1-INPUT -s your.remote.ip.address/32 -i eth0 -p tcp -m tcp --dport 9312 -j ACCEPT

Adjust port 9312 to whichever port/ports you have sphinx listening on.

Then I ran service iptables restart and sphinx was a go!

Thanks to @mdpc and @sciurus for pointing me in the right direction.

NOTE: Rackspace uses RH-Firewall-1-INPUT, but you may need to use just INPUT, or something different

Eric Uldall
  • 161
  • 2
  • 10