Elasticsearch - Updating a problem with conversion error from 1.5 to 2.0

When I try to start the node wizard of my cluster, immediately after upgrading from 1.5 to 2.0 (yes, this is a big jump), I get this error log:

[2015-11-03 18:15:10,948][ERROR][gateway ] [mon-01] failed to read local state, exiting... java.lang.IllegalStateException: unable to upgrade the mappings for the index [logstash-2015.10.18], reason: [Mapper for [timestamp] conflicts with existing mapping in other types: [mapper [timestamp] cannot be changed from type [date] to [string]]] 

Unfortunately, I do not have a detailed description of the field or the corresponding analyzer configuration for this field, but, as indicated in its name, it is a timestamp from the logstash, so it should look like one of the following:

  • "dd / MMM / yyyy: HH: mm: ss Z"
  • "YYYY-MM-dd HH: mm: ss"
  • "HH: mm: ss"
  • "YYYY-MM-dd HH: mm: ss, SSS ZZ"
  • "YYYY-MM-dd HH: mm: ss, SSSZZ"
  • "YYYY-MM-dd HH: mm: ss, SSS"

The magazine ends with this:

 [2015-11-03 18:15:11,383][ERROR][bootstrap ] Guice Exception: java.lang.IllegalStateException: unable to upgrade the mappings for the index [logstash-2015.10.18], reason: [Mapper for [timestamp] conflicts with existing mapping in other types: [mapper [timestamp] cannot be changed from type [date] to [string]]] Likely root cause: java.lang.IllegalArgumentException: Mapper for [timestamp] conflicts with existing mapping in other types: [mapper [timestamp] cannot be changed from type [date] to [string]] at org.elasticsearch.index.mapper.FieldTypeLookup.checkCompatibility(FieldTypeLookup.java:117) at org.elasticsearch.index.mapper.MapperService.checkNewMappersCompatibility(MapperService.java:345) at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:296) at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:242) at org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService.checkMappingsCompatibility(MetaDataIndexUpgradeService.java:329) at org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService.upgradeIndexMetaData(MetaDataIndexUpgradeService.java:112) at org.elasticsearch.gateway.GatewayMetaState.pre20Upgrade(GatewayMetaState.java:226) at org.elasticsearch.gateway.GatewayMetaState.<init>(GatewayMetaState.java:85) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at <<<guice>>> at org.elasticsearch.node.Node.<init>(Node.java:198) at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145) at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35) 

And node turns off ..

I carefully read problems # 13169 and # 13345 , but none of them helped me, node continues to not start.

I know that changing mappings is easy when the ES gets up, but I'm kinda stuck here.

Any idea?

+5
source share
1 answer

from the Elasticsearch developer, it looks like a problem in my data, and not in the ES itself: https://github.com/elastic/elasticsearch/issues/14491

your logstash-2015.10.18 index has a timestamp field that displays as a string on one type and as a date on another type, which is something elasticsearch can't handle. In elasticsearch 1.x, this question will be quiet and only trip when trying to search / sort / aggregate on the field. In Elasticsearch 2.0, we discover these inconsistencies more proactively.

The final answer is here: https://www.elastic.co/blog/great-mapping-refactoring

You cannot update indexes with a conflicting mapping field with Elasticsearch v2.0.

If the data in these indexes is no longer needed, you can simply delete the indexes, otherwise you will need to reindex your data using the correct displays.

This tool can help to extract data and reimport it: https://github.com/taskrabbit/elasticsearch-dump

+5
source

Source: https://habr.com/ru/post/1235172/


All Articles