问题: 我试图在服务器重启后让 sphinx 再次运行。当我尝试启动它时似乎没有 sphinx.conf 文件:
>searchd
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)
FATAL: no readable config file (looked in /etc/sphinxsearch/sphinx.conf, ./sphinx.conf).
我跑了:
rake thinking_sphinx:configure
rake thinking_sphinx:index
rake thinking_sphinx:start
问题是由于某种原因没有创建 etc/sphinxsearch/ sphinx.conf文件...我是 thinking_sphinx 的新手,这可能不是唯一的问题(与网站有关),但似乎没有设置完全。有关输出和更多信息,请阅读以下内容:
背景信息: 我正在做一个我最初没有设置的项目。我们重新启动服务器以查看我们在常量文件中所做的一些更改。但是在重新启动后,当您导航到该站点时,该项目不再显示。当您输入直接的 IP 地址时,它只会显示“欢迎使用 Nginx”。
该端口是开放的并且通过我们的托管服务器工作,所以我被告知我必须重新启动一些服务。我遇到的问题之一是thinking_sphinx。这是我引用的 sphinx 站点的 rake 任务。以及sphinx 的常见配置问题。
我设置了 sphinx.yml 开发路径(我们没有使用生产)。然后我跑了
>rake thinking_sphinx:index
即使它输出一些警告,这似乎也有效:
Generating Configuration to /home/potato/streetpotato/config/development.sphinx.conf
(0.2ms) SELECT @@global.sql_mode, @@session.sql_mode;
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/home/potato/streetpotato/config/development.sphinx.conf'...
indexing index 'bar_core'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 14080 kb
collected 249 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 249 docs, 32394 bytes
total 0.254 sec, 127298 bytes/sec, 978.49 docs/sec
indexing index 'bar_delta'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 14080 kb
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'bar'...
indexing index 'synonym_core'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 13568 kb
collected 3 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 3 docs, 103 bytes
total 0.003 sec, 30356 bytes/sec, 884.17 docs/sec
indexing index 'synonym_delta'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 13568 kb
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.002 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'synonym'...
indexing index 'user_core'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 13568 kb
collected 100 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 100 docs, 3146 bytes
total 0.013 sec, 239348 bytes/sec, 7608.03 docs/sec
skipping non-plain index 'user'...
total 11 reads, 0.000 sec, 3.8 kb/call avg, 0.0 msec/call avg
total 37 writes, 0.000 sec, 2.5 kb/call avg, 0.0 msec/call avg
然后我跑了
>rake thinking_sphinx:configure
Generating Configuration to /home/potato/streetpotato/config/development.sphinx.conf
(0.2ms) SELECT @@global.sql_mode, @@session.sql_mode;
最后运行:
>rake thinking_sphinx:start
Started successfully (pid 29623).
现在即使我的日志说:
[Fri Nov 16 19:34:29.820 2012] [29623] accepting connections
仍然没有生成 sphinx.conf 文件,当我尝试使用 searchd 命令时,它仍然给我错误...
>searchd --stop
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)
FATAL: no readable config file (looked in /etc/sphinxsearch/sphinx.conf, ./sphinx.conf).
我很茫然,我知道这是超长的,但这只是因为我很迷茫并试图提供尽可能多的信息。我比昨天更进一步,但它似乎仍然没有完全工作。我可能还需要在独角兽或瘦身方面做更多的设置。我只是想弄清楚如何让网站重新启动并再次运行......如果有人遇到类似的问题,他们的网站在重新启动后关闭并重新启动(特别是 Nginx 和 unicorn 上的 Rails 项目)或瘦使用狮身人面像)任何见解将不胜感激。
谢谢,
艾伦