Thinking-sphinx FATAL: failed to create binlog.001, error=打开的文件太多

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

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

通过向 /etc/systemd/system.conf/etc/systemd/user.conf

添加以下行解决了这个问题
DefaultLimitNOFILE=65000