简体   繁体   English

一段时间后,elasticsearch会停止使用Tyre对新文档建立索引

[英]elasticsearch stops indexing new documents after a while, using Tire

I have my website running, with ElasticSearch, using Tire. 我使用Tire在我的网站上运行ElasticSearch。

In the background, I have a rake task that is looping over thousands of objects and creating one record for each of them. 在后台,我有一个rake任务,该任务遍历数千个对象并为每个对象创建一条记录。

At first, the records are indexed, and every time I refresh my website, I can see the number of records found go up. 首先,对记录进行索引,并且每次刷新网站时,我都会看到发现的记录数上升。 But at some point, it just stops. 但是到了某个时候,它就停止了。 It saves the records to mysql, but does not index them anymore. 它将记录保存到mysql,但不再对其进行索引。 Note that the site and the search are still up and running. 请注意,该站点和搜索仍在运行中。

Why is that? 这是为什么? Is there some kind of lock or...? 是否有某种锁或...?


edit: Here are errors I see in elasticsearch.log 编辑:这是我在elasticsearch.log看到的错误

[2013-03-16 08:49:34,344][WARN ][netty.channel.socket.nio.AbstractNioSelector] Failed to accept a connection. [2013-03-16 08:49:34,344] [WARN] [netty.channel.socket.nio.AbstractNioSelector]无法接受连接。 java.io.IOException: Too many open files java.io.IOException:打开文件过多


[Thakos] [maps][2] failed to read latest segment infos on flush java.io.FileNotFoundException: /usr/local/share/elasticsearch/data/elasticsearch/nodes/0/indices/maps/2/index/segments_3 (Too many open files) [Thakos] [maps] [2]无法读取有关刷新java.io.FileNotFoundException的最新段信息:/ usr / local / share / elasticsearch / data / elasticsearch / nodes / 0 / indices / maps / 2 / index / segments_3(打开的文件太多)

So I guess that's need, I need to look at how to deal with this error. 所以我想这是需要的,我需要看看如何处理该错误。

I basically missed an important part of the "Installation guide": http://www.elasticsearch.org/guide/reference/setup/installation.html 我基本上错过了“安装指南”的重要部分: http : //www.elasticsearch.org/guide/reference/setup/installation.html

I only had like 1024 open file descriptors allowed for the user running elasticsearch, and I needed around 32k (max set to 64k). 我只允许1024个打开文件描述符供运行Elasticsearch的用户使用,而我大约需要32k(最大设置为64k)。

With these settings, everything's running perfectly. 有了这些设置,一切运行正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM