即使是不成熟的尝试,也胜于胎死腹中的策略。

failed to put mappings on indices

Elasticsearch | 作者 qwefdrt | 发布于2018年05月18日 | 阅读数:16933

通过Logstash的Geoip将字段转化为坐标,再通过ElasticSearch的Mapping API将索引中的geo字段转化为geo_point类型。
但是发现报错,日志打印如下:
[2018-05-18T09:39:44,765][DEBUG][o.e.a.a.i.m.p.TransportPutMappingAction] [elk01] failed to put mappings on indices [[[mbxlog-2018.05.18/lop1219XTVa_0pgkeE932w]]], type [doc]
java.lang.IllegalArgumentException: Rejecting mapping update to [mbxlog-2018.05.18] as the final mapping would have more than 1 type: [doc, my_type]
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:494) ~[elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:350) ~[elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:282) ~[elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:311) ~[elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:230) ~[elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:640) ~[elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:270) ~[elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:195) [elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:130) [elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:568) [elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) [elasticsearch-6.1.2.jar:6.1.2]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) [elasticsearch-6.1.2.jar:6.1.2]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

 
已邀请:

rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk

赞同来自: qwefdrt

日志里面说了,你这个 index 有两个 type,不允许,你肯定是之前有一个 type 了。建议手动自己提前设定好相关 mapping,不要自动创建
 


java.lang.IllegalArgumentException: Rejecting mapping update to [mbxlog-2018.05.18] as the final mapping would have more than 1 type: [doc, my_type]

yayg2008

赞同来自: qwefdrt

楼上正解,最好先手工创建好mapping,然后再写入数据。

qwefdrt

赞同来自:

感谢!

要回复问题请先登录注册