我试图让我的SphinxQL安装在我的Ubuntu 16.04LTS环境中运行。但是,我无法连接到服务器。我使用的配置如下:
searchd
{
listen = 9306:mysql41
log = /var/log/sphinxsearch/searchd.log
query_log = /var/log/sphinxsearch/query.log
read_timeout = 5
max_children = 30
pid_file = /var/run/sphinxsearch/searchd.pid
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
binlog_path = /var/lib/sphinxsearch/data
}
为了确认或守护程序正在运行,我执行了:sudo systemctl status sphinxsearch.service
返回:
sphinxsearch.service - LSB: Fast standalone full-text SQL search engine
Loaded: loaded (/etc/init.d/sphinxsearch; bad; vendor preset: enabled)
Active: active (running) since Thu 2018-06-07 11:23:09 CEST; 12min ago
Docs: man:systemd-sysv-generator(8)
Process: 10552 ExecStop=/etc/init.d/sphinxsearch stop (code=exited, status=0/SUCCESS)
Process: 10614 ExecStart=/etc/init.d/sphinxsearch start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/sphinxsearch.service
├─10621 /usr/bin/searchd
└─10622 /usr/bin/searchd
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: listening on all interfaces, port=9306
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: Sphinx 2.2.9-id64-release (rel22-r5006)
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: Copyright (c) 2001-2015, Andrew Aksyonoff
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: precaching index 'I2455'
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: [1.4K blob data]
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: Copyright (c) 2001-2015, Andrew Aksyonoff
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
Jun 07 11:23:09 Serv001 sphinxsearch[10614]: sphinxsearch.
Jun 07 11:23:09 Serv001 systemd[1]: Started LSB: Fast standalone full-text SQL search engine.
要验证守护程序是否正在侦听,我执行了sudo lsof -i -P -n | grep LISTEN
,它显示了我:
searchd 10622 sphinxsearch 8u IPv4 423245474 0t0 TCP *:9306 (LISTEN)
但是,当我尝试与mysql -h0 -P9306
联系时,它会在一段时间后返回我:ERROR 2002 (HY000): Can't connect to MySQL server on '0' (115)
注意:索引已经构建没有问题,因此之前已建立了数据库连接
注2:我遵循了这个documentation
那么,我错误的是我无法通过端口9306连接到SphinxQL?
答案 0 :(得分:1)
从您的iptables看起来您将所有内容列入黑名单(请参阅INPUT链中的DROP行),然后将所选端口列入白名单。因此,要允许访问9306,您应该
iptables -A INPUT -p tcp --destination-port 9306 -j ACCEPT