狮身人面像安装centos7

时间:2018-03-24 20:33:37

标签: centos7 sphinx

我刚刚在运行centos 7的专用服务器上将sphinx更新到最新版本,但经过数小时的搜索我无法找到问题。

狮身人面像指数创造得很好,但我无法启动搜索守护程序。我一直收到这条消息:

systemctl status searchd.service
searchd.service - SphinxSearch Search Engine
Loaded: loaded (/usr/lib/systemd/system/searchd.service; disabled; vendor preset: disabled)
Active: failed (Result: timeout) since Sat 2018-03-24 21:14:09 CET; 3min 4s ago
Process: 17865 ExecStartPre=/bin/chown sphinx.sphinx /var/run/sphinx (code=exited, status=0/SUCCESS)
Process: 17863 ExecStartPre=/bin/mkdir -p /var/run/sphinx (code=killed, signal=TERM)

Mar 24 21:14:09  systemd[1]: Starting SphinxSearch Search Engine...
Mar 24 21:14:09  systemd[1]: searchd.service start-pre operation timed out. Terminating.
Mar 24 21:14:09  systemd[1]: Failed to start SphinxSearch Search Engine.
Mar 24 21:14:09  systemd[1]: Unit searchd.service entered failed state.
Mar 24 21:14:09  systemd[1]: searchd.service failed.

我真的不知道这个问题来自哪里。

3 个答案:

答案 0 :(得分:0)

在你的systemd服务文件中(我在/usr/lib/systemd/system/searchd.service中)注释掉: SELECT posts.id, posts.body, posts.posted_at, posts.postimg, posts.likes, users.`username` FROM ( SELECT followers.user_id FROM followers WHERE followers.follower_id = :userid UNION ALL SELECT :user_id ) uids JOIN users ON users.id = uids.user_id JOIN posts ON posts.user_id = uids.user_id

(如果尚未完成,可以手动运行这些命令)。

然后改变 /bin/chown sphinx.sphinx /var/run/sphinx /bin/mkdir -p /var/run/sphinx manually Type=forking

然后执行 Type=simple ,您可以启动/停止/状态服务:

systemctl daemon-reload

答案 1 :(得分:0)

我遇到了同样的问题,终于找到了适合我的解决方案。

我已经编辑了“ /etc/systemd/system/sphinx.service”,使其看起来像

[Unit]
Description=SphinxSearch Search Engine
After=network.target remote-fs.target nss-lookup.target
After=syslog.target

[Service]
User=sphinx
Group=sphinx
RuntimeDirectory=sphinxsearch
RuntimeDirectoryMode=0775
# Run ExecStart with User=sphinx / Group=sphinx
ExecStart=/usr/bin/searchd --config /etc/sphinx/sphinx.conf
ExecStop=/usr/bin/searchd --config /etc/sphinx/sphinx.conf --stopwait
KillMode=process
KillSignal=SIGTERM
SendSIGKILL=no
LimitNOFILE=infinity
TimeoutStartSec=infinity
#PIDFile=/var/run/sphinx/searchd.pid
PIDFile=/var/run/sphinxsearch/searchd.pid

[Install]
WantedBy=multi-user.target
Alias=sphinx.service
Alias=sphinxsearch.service

在这种情况下,我的searchd能够幸免于重启。在我的情况下,重新启动后/ var / run / sphinxsearch目录删除之前,上一篇文章中的解决方案存在重新启动后开始搜索的问题。

答案 2 :(得分:0)

事实是RHEL(CentOS)7无法感知“ TimeoutStartSec”参数的“ Infinity”值。您必须设置一个数值。例如,TimeoutStartSec = 600