Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
1  
Looks like a firewall problem....or a networking configuration issue –  mdpc Apr 30 at 22:32
1  
What is the output of iptables -L on the db server? –  sciurus Apr 30 at 22:51
    
I've updated the post with the output of iptables -L @sciurus –  Eric Uldall Apr 30 at 22:57
    
It's definitely an iptables issue. when i stop iptables my search service works fine. But when i try to add a new rule to accept incoming connections from my web server ip, it doesn't end up in the rules list. –  Eric Uldall Apr 30 at 23:35

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.