在为我们的一个MySQL数据库重建Sphinx索引时,我们遇到了一个问题。循环和重建索引反复失败,系统继续使用旧索引。在过去的几个月中,数据库的大小翻了一番,现在它包含了超过1000万行的表。在使用重新构建Sphinx索引期间
indexer --config our_config.conf --rotate --all(由这里使用的UltraSphinx插件生成),我们在Sphinx守护进程日志文件searchd.log中得到以下错误
WARNING: rotating index 'main': preread failed: failed to open
~/etc/sphinx//sphinx_index_main.new.spi: No such file or directory;
using old index
WARNING: rotating index 'main': preread failure reported随着数据库变得越来越大,错误消息的出现频率也在不断增加。完整的索引现在大约需要1个半小时,并且索引文件加在一起超过1 GB。我们将Sphinx版本从0.9.8.1更新到2.0.4来解决这个问题,但它仍然存在。服务器内存约为4 GB,配置文件开头为
indexer {
mem_limit = 1024M
}
searchd {
read_timeout = 5
max_children = 300
log = ~/etc/sphinx/log/searchd.log
port = 3313
max_matches = 100000
query_log = ~/etc/sphinx/log/query.log
seamless_rotate = 1
pid_file = ~/etc/sphinx/log/searchd.pid
address = 127.0.0.1
}
..有没有人知道如何解决这个问题?我猜似乎有某种索引大小限制与2 GB的限制有关,它是有符号32位整数的最大值和某些文件系统上文件大小的最大值。我们在Ubuntu/Debian系统上使用的ext3文件系统允许最大文件大小为16 GB,但某些库实际上可能会将文件大小限制在2 GB (参见here和here)。
发布于 2012-04-25 02:58:01
检查索引器本身的输出-它显示了它在索引过程中的进度,并可能给出问题的线索。
发布于 2012-04-25 02:28:13
请检查您的数据位置。看起来Sphinx想要在~/etc/sphinx//sphinx_index_main.new.spi上创建一个临时索引文件(这就是索引器所做的事情)。我在这里看到了两件事,一个是~,不确定这是否有效。另一件事是double /。
IIRC这是您的Sphinx配置文件的索引部分。
https://stackoverflow.com/questions/10301942
复制相似问题