你能判断一下弹性搜索索引是否正在重新编制索引吗?

时间:2015-04-08 22:00:24

标签: elasticsearch

我改变了一个映射,所以我开始使用kopf重新索引。怎样才能判断reindex何时完成?

我已尝试搜索以下内容:

curl -GET http://example-elastic:9200/logstash-2015.03.31/_status?pretty
curl -GET http://example-elastic:9200/_cat/indices
curl -GET http://example-elastic:9200/_stats/indices

更新

我用kopf插件启动了reindex。 (从问题中删除了错误的索引命令)

UPDATE2

我想出了如何查看最后一个索引日期,但在我看来,有一种更好的方法可以判断它当前是否已编入索引。

适用于OSX

FOO=logstash-2015.03.31
curl -s -XGET "http://example-elastic:9200/l$FOO?pretty" | grep creation_date | sed  s'/[^0-9]//g' | date -j

Wed Apr  8 16:42:23 MDT 2015

Update3

我安装了a plugin以提供有关索引所需时间的更多反馈。

 elasticsearch-reindex -f http://example-elastic:9200/logstash-2015.03.22/string -t http://example-elastic:9200

看起来索引过程需要很长时间。 5分钟后仍然是2%

...
reindexing [=-----------------------------] 165200/8492680(2%) 158.1 7971.1s
reindexing [=-----------------------------] 165300/8492680(2%) 158.5 7984.9s
reindexing [=-----------------------------] 165400/8492680(2%) 158.5 7981.0s

有没有办法从elasticsearch看到这个进展?

1 个答案:

答案 0 :(得分:0)

查看cat api,特别是/_cat/nodes?help的输出。您可能希望通过以下方式监控索引操作:

curl -XGET 'http://localhost:9200/_cat/nodes?v&h=indexing.index_current'

相关问题