2017-06-21 121 views
0

我禁用动态映射与无法打开Elasticsearch动态映射在

curl -XPUT 'localhost:9200/_template/template_all?pretty' -H 'Content-Type: application/json' -d' { "template": "*", "order":0, "settings": { "index.mapper.dynamic": false }}' 

我想与

curl -XPUT 'localhost:9200/_template/template_all?pretty' -H 'Content-Type: application/json' -d' { "template": "*", "order":0, "settings": { "index.mapper.dynamic": true }}' 

它已经证实了它作为真正打开它,但是当我尝试有logstash发送信息给它,在logstash错误日志中我回来了 -

"reason"=>"trying to auto create mapping, but dynamic mapping is disabled" 

我该如何实际上重新打开动态映射?

回答

2

看起来像logstash的索引是使用旧模板创建的(在更新模板之前)。因为当你更新你的模板时,只有新的索引会有更新的映射和设置。

检查是存在索引:

curl -XGET 'localhost:9200/LOGSTASH_INDEX_NAME_HERE' 

如果索引存在,你可以删除这个索引 - 做到这一点。在此之后,logstash将尝试发送内容 - 将使用新映射创建索引。