我最近将 sphinx 移动到与我们的数据库相同的服务器上,所以我们的架构是:
- 托管我们的网络应用程序的文件服务器
- 带 Sphinx 实例的数据库服务器(搜索)
当我尝试连接到 sphinx 时,ip.to.db.server
出现以下错误:
Sphinx response connection to ip.to.db.server:9312 failed (errno=113, msg=No route to host)
为了让我的网络应用程序可以访问端口 9312,我需要做些什么特别的事情吗?
当前TCP
端口LISTEN
:
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
输出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
到目前为止,我已经做了很多搜索,但没有运气。任何帮助深表感谢。
乙
问题是
IPTABLES
阻止我的远程连接,所以我添加了两行以确保安全:vi /etc/sysconfig/iptables
添加以下行:
将端口调整
9312
为您有 sphinx 侦听的端口。然后我跑了
service iptables restart
,狮身人面像开始了!感谢@mdpc 和@sciurus 为我指明了正确的方向。
NOTE:
Rackspace 使用RH-Firewall-1-INPUT
,但您可能需要使用 justINPUT
或其他东西