我只是在Centos7.3上安装了Sphinx版本sphinx-2.2.11-1.rhel7.x86_64
因此,我成功安装了它并为数据库建立了索引,并且在我第一次启动Sphinx时启动它,但是当我尝试使用service searchd stop或service searchd重新启动时,每次都会自动删除searchd.pid,但再也不会创建它,因此狮身人面像可以由于错误而无法重新开始
[root@ns510209 log]# service searchd start
Redirecting to /bin/systemctl start searchd.service
Job for searchd.service failed because a configured resource limit was exceeded. See "systemctl status searchd.service" and "journalctl -xe" for details.
任何建议我如何可以解决这个问题,我试图几天寻找一种方法,但仍然没有运气...
最佳答案
我遇到了同样的问题。根本原因是由于以下文件夹中的元数据不正确,searchd无法写入binlog文件:
# ls -al /var/lib/sphinx/
total 23580
drwxr-xr-x 2 sphinx sphinx 4096 Jul 9 16:52 .
drwxr-xr-x 33 root root 4096 Mar 12 14:18 ..
-rw------- 1 sphinx sphinx 8 Jul 9 16:47 binlog.001
-rw------- 1 sphinx sphinx 8 Jul 9 16:52 binlog.002
-rw------- 1 sphinx sphinx 0 Jul 9 16:52 binlog.lock
-rw------- 1 sphinx sphinx 12 Jul 9 16:52 binlog.meta
-rw------- 1 sphinx sphinx 0 Jun 21 18:53 doc.old.spl
-rw-r--r-- 1 sphinx sphinx 0 Jul 9 16:52 doc.spa
从此文件夹中移动除doc。*(或使用的前缀)以外的所有文件。然后启动服务:
# systemctl start searchd
# systemctl status searchd
● searchd.service - SphinxSearch Search Engine
Loaded: loaded (/usr/lib/systemd/system/searchd.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-07-09 16:52:43 MSK; 6min ago
Process: 1690 ExecStart=/usr/bin/searchd --config /etc/sphinx/sphinx.conf (code=exited, status=0/SUCCESS)
Process: 1687 ExecStartPre=/bin/chown sphinx.sphinx /var/run/sphinx (code=exited, status=0/SUCCESS)
Process: 1684 ExecStartPre=/bin/mkdir -p /var/run/sphinx (code=exited, status=0/SUCCESS)
Main PID: 1693 (searchd)
CGroup: /system.slice/searchd.service
├─1692 /usr/bin/searchd --config /etc/sphinx/sphinx.conf
└─1693 /usr/bin/searchd --config /etc/sphinx/sphinx.conf
关于centos - Sphinx重启/停止searchd.pid删除时,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44965272/