Rejecting mapping update to [house] as the final mapping would have more than 1 type: [housetype, do

本文记录了在使用Logstash将MySQL数据同步到Elasticsearch时遇到的索引类型冲突问题,并提供了修改索引映射解决冲突的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本人今天创建索引及索引mapping
当logstash将mysql同步到es索引文档的时候,出现如上错误

[2018-03-22T14:17:42,271][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"%{houseId}", :_index=>"house", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0xbb14a9d>], :response=>{"index"=>{"_index"=>"house", "_type"=>"doc", "_id"=>"%{houseId}", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [house] as the final mapping would have more than 1 type: [housetype, doc]"}}}}

原因是我自己在创建索引映射的时候的索引类型设置为housetype,但是logstash在同步的时候会自动创建一个doc类型的index,所以引起冲突,,解决方式可以修改自己的索引映射为doc,这样就不会发生冲突了!

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值