自从我在Ubuntu Server上安装sphinx以来,我遇到了一个奇怪的问题。我经常注意到,我会在Mysql进程列表中看到一个sphinx配置文件sql查询。检查top之后,我发现它实际上正在运行。当我终止查询时,索引器似乎中止了。如何停止呢?我正在从网上找到的教程中使用此配置文件:

source src1
{
type          = mysql

sql_host      = localhost
sql_user      = ***********
sql_pass      = ***********
sql_db        = ***********
sql_port      = 3306

sql_query     = \
SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title,
content \
FROM documents

sql_attr_uint         = group_id
sql_attr_timestamp    = date_added
}
index test1
{
source            = src1
path              = /var/lib/sphinxsearch/data/test1
docinfo           = extern
}
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
}

最佳答案

删除文件/etc/cron.d/sphinxsearch中的行

# Rebuild all indexes daily and notify searchd.
@daily      root . /etc/default/sphinxsearch && if [ "$START" = "yes" ] && [ -x /usr/bin/indexer ]; then /usr/bin/indexer --quiet --rotate --all; fi

10-07 12:44