Issue of the upgrade from elasticsearch 1.6 to 2.0


#1

hello everyone,
We have an elasticsearch cluster which includes 3 nodes, elasticsearch 1.6(rpm package) was installed on them,and hold some indices on them.
I just updated the es version from 1.6 to 2.0 on the 3 nodes,following the official guide:
https://www.elastic.co/guide/en/elasticsearch/reference/current/restart-upgrade.html
then I started the elasticsearch serivce,but an error appeared and the services stopped on all the 3 node server:
and how can I solve it? thanks.

---------------------NODE1-------------------------
[root@NODE1 ~]# Exception in thread "main" java.lang.IllegalStateException: unable to upgrade the mappings for the index [allie_traceability_1], reason: [Mapper for [status] conflicts with existing mapping in other types:
[mapper [status] cannot be changed from type [int] to [string]]]
Likely root cause: java.lang.IllegalArgumentException: Mapper for [status] conflicts with existing mapping in other types:
[mapper [status] cannot be changed from type [int] 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.(GatewayMetaState.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
..........

------------------NODE2--------------------

[root@NODE2 indices]# Exception in thread "main" java.lang.IllegalStateException: unable to upgrade the mappings for the index [allie_traceability_10], reason: [Mapper for [usn] conflicts with existing mapping in other types:
[mapper [usn] has different [index] values, mapper [usn] has different [omit_norms] values, cannot change from disable to enabled, mapper [usn] has different [analyzer], mapper [usn] is used by multiple types. Set update_all_types to true to update [omit_norms] across all types., mapper [usn] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [usn] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]]
Likely root cause: java.lang.IllegalArgumentException: Mapper for [usn] conflicts with existing mapping in other types:
[mapper [usn] has different [index] values, mapper [usn] has different [omit_norms] values, cannot change from disable to enabled, mapper [usn] has different [analyzer], mapper [usn] is used by multiple types. Set update_all_types to true to update [omit_norms] across all types., mapper [usn] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [usn] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]
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.(GatewayMetaState.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
........

-------------------NODE3------------------------
the error is similar to the NODE1 and NODE2.


(Mark Walkom) #2

This is why reading breaking changes for major updates is really important.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html


#3

thanks so much,we will study it.


(system) #4