首页 > 解决方案 > Thinking-sphinx FATAL: failed to create binlog.001, error=Too many open files

问题描述

我正在使用Sphinx 2.2.11-id64-releasegem 'thinking-sphinx', '3.3.0'

rake ts:configure工作正常并生成开发 development.sphinx.conf

但是在运行 sphinx 时rake ts:index ts:start它会失败并在日志中显示这些错误:

[Fri Dec 21 18:00:19.858 2018] [31823] WARNING: index 'section_not_today_1_with_text_89_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/89/section_not_today_1_with_text_89_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.858 2018] [31823] WARNING: index 'section_today_0_with_text_address_89_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/89/section_today_0_with_text_address_89_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.858 2018] [31823] WARNING: index 'section_not_today_0_with_text_address_89_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/89/section_not_today_0_with_text_address_89_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.859 2018] [31823] WARNING: index 'section_today_1_with_text_address_89_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/89/section_today_1_with_text_address_89_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.859 2018] [31823] WARNING: index 'section_not_today_1_with_text_address_89_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/89/section_not_today_1_with_text_address_89_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.860 2018] [31823] WARNING: index 'section_today_0_with_text_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/90/section_today_0_with_text_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.860 2018] [31823] WARNING: index 'section_not_today_0_with_text_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/90/section_not_today_0_with_text_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.860 2018] [31823] WARNING: index 'section_today_1_with_text_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/90/section_today_1_with_text_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.861 2018] [31823] WARNING: index 'section_not_today_1_with_text_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/90/section_not_today_1_with_text_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.861 2018] [31823] WARNING: index 'section_today_0_with_text_address_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/90/section_today_0_with_text_address_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.862 2018] [31823] WARNING: index 'section_not_today_0_with_text_address_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/90/section_not_today_0_with_text_address_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.862 2018] [31823] WARNING: index 'section_today_1_with_text_address_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/90/section_today_1_with_text_address_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.863 2018] [31823] WARNING: index 'section_not_today_1_with_text_address_90_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/90/section_not_today_1_with_text_address_90_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.863 2018] [31823] WARNING: index 'section_today_0_with_text_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/91/section_today_0_with_text_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.864 2018] [31823] WARNING: index 'section_not_today_0_with_text_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/91/section_not_today_0_with_text_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.864 2018] [31823] WARNING: index 'section_today_1_with_text_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/91/section_today_1_with_text_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.864 2018] [31823] WARNING: index 'section_not_today_1_with_text_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/91/section_not_today_1_with_text_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.865 2018] [31823] WARNING: index 'section_today_0_with_text_address_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/91/section_today_0_with_text_address_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.865 2018] [31823] WARNING: index 'section_not_today_0_with_text_address_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development0/91/section_not_today_0_with_text_address_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.865 2018] [31823] WARNING: index 'section_today_1_with_text_address_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/91/section_today_1_with_text_address_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.866 2018] [31823] WARNING: index 'section_not_today_1_with_text_address_91_idx_core': preload: failed to open /home/tyler/nmir/db/sphinx/development1/91/section_not_today_1_with_text_address_91_idx_core.spa: Too many open files; NOT SERVING
[Fri Dec 21 18:00:19.868 2018] [31823] FATAL: failed to create /home/tyler/nmir/tmp/binlog/development/binlog.001: errno=24, error=Too many open files
[Fri Dec 21 18:00:19.915 2018] [31822] watchdog: main process 31823 exited cleanly (exit code 1), shutting down

标签: sphinxthinking-sphinx

解决方案


正如@barryhunter 所指出的,这里的问题是允许您在操作系统级别打开的文件数量。您之所以遇到这个问题,是因为您已经定义了大量的 Sphinx 索引 - 但应该有办法解决它 - 也许通过使用ulimit, 正如 Barry 在评论中链接的那样。


推荐阅读