gpt4 book ai didi

elasticsearch - Elasticsearch:升级到7.9.3后无法创建索引(mapper_parsing_exception)

转载 作者:行者123 更新时间:2023-12-02 23:41:57 26 4
gpt4 key购买 nike

我已经将群集从6.8升级到7.93,现在无法创建索引了
起初我以为我的默认映射有问题,但是即使没有指定映射也得到了mapper_parsing_exception

curl -X PUT localhost:9200/test-index?pretty
结果是
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [_all : {enabled=false}]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "Failed to parse mapping [_default_]: Root mapping definition has unsupported parameters: [_all : {enabled=false}]",
"caused_by" : {
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [_all : {enabled=false}]"
}
},
"status" : 400
}
我意识到ES 7不再支持_all meta字段,这是我为ES 7计划的默认映射(使用它创建索引也不起作用)
{
"mappings": {
"properties": {
"data": {
"type": "text",
"index": false
},
"metadata": {
"type": "object",
"properties": {
"date": {
"format": "strict_date_optional_time||epoch_millis",
"type": "date"
},
"reception_date": {
"format": "strict_date_optional_time||epoch_millis",
"type": "date"
},
"source": {
"type": "keyword"
},
"env": {
"type": "keyword"
},
"type": {
"type": "keyword"
"filename": {
"type": "text",
"index": false
"ts_ms": {
"type": "long"
},
"ts": {
"type": "long"
}
}
}
}
}
}
我在docker中运行的PC上的测试实例上没有此错误。当我在测试实例上构建项目时,测试运行良好。它似乎仅在群集上特别失败。在集群上,存在ES 6指数。什么可能导致此映射错误?是否有可能是从ES 6继承的设置导致此问题?
这是我的日志中不太漂亮的java回溯
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [_default_]: Root mapping definition has unsupported parameters:  [_all : {enabled=false}]
at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:390) ~[elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:351) ~[elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.updateIndexMappingsAndBuildSortOrder(MetadataCreateIndexService.java:913) ~[elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.lambda$applyCreateIndexWithTemporaryService$5(MetadataCreateIndexService.java:399) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.indices.IndicesService.withTempIndexService(IndicesService.java:620) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexWithTemporaryService(MetadataCreateIndexService.java:397) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequestWithV1Templates(MetadataCreateIndexService.java:483) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequest(MetadataCreateIndexService.java:360) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequest(MetadataCreateIndexService.java:367) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.metadata.MetadataCreateIndexService$1.execute(MetadataCreateIndexService.java:290) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:47) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:678) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [elasticsearch-7.9.3.jar:7.9.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: org.elasticsearch.index.mapper.MapperParsingException: Root mapping definition has unsupported parameters: [_all : {enabled=false}]
at org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:148) ~[elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:136) ~[elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:88) ~[elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:74) ~[elasticsearch-7.9.3.jar:7.9.3]
at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:388) ~[elasticsearch-7.9.3.jar:7.9.3]
... 23 more

最佳答案

您可能拥有旧的索引模板,这些模板在创建新索引时会产生干扰。
尝试GET _template,看看是否有任何不兼容的映射参数可以更改以使其起作用。
最终,删除旧的未使用的模板。

关于elasticsearch - Elasticsearch:升级到7.9.3后无法创建索引(mapper_parsing_exception),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64718449/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com