spring-boot - 千分尺无法将指标保存到弹性搜索,因为最终映射将具有超过 1 种类型:[_doc, doc]
问题描述
我正在尝试实施 Micrometer Elasticsearch 注册表,但出现以下错误
{
"took": 158,
"errors": true,
"items": [
{
"index": {
"_index": "metrics-2019-11",
"_type": "doc",
"_id": "PDzhNm4BiJBtovrbDFDF",
"status": 400,
"error": {
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [metrics--2019-11] as the final mapping would have more than 1 type: [_doc, doc]"
}
}
},
{
"index": {
"_index": "metrics--2019-11",
"_type": "doc",
"_id": "PTzhNm4BiJBtovrbDFDF",
"status": 400,
"error": {
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [metrics--2019-11] as the final mapping would have more than 1 type: [_doc, doc]"
}
}
}
]
}
我不得不说我不太了解这个错误,千分尺是否试图将同一个文档推送到 2 个不同的键(doc 和 _doc)?
我在文档中没有看到任何关于文档类型或其密钥或任何相关内容的信息
同样,索引没有事先创建,我让千分尺创建它们,所以这怎么行不通。
弹性搜索 7.4.2
千分尺 1.2.1
春季启动 2.1.2
解决方案
spring-boot-gradle-plugin
我在使用不兼容版本的和时遇到了这个错误mavenBom
。
例如,我的 build.gradle 文件中有以下内容:
buildscript {
...
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.2.5.RELEASE"
}
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Greenwich.SR1"
}
}
但是2.2.5.RELEASE
和Greenwich.SR1
不在同一个版本的火车上。更改“Bom”版本以Hoxton.SR1
解决问题。
即使您没有使用 gradle,问题也可能是由于不兼容的依赖版本。
推荐阅读
- vue.js - Vue 组件错误:属性或方法 X 未在实例上定义,但在渲染期间引用
- r - R文本挖掘——去除特殊字符和引号
- azure-devops - 在 VSTS / Azure DevOps 中重置分支更新的构建策略
- multithreading - 使用 DatagramSocket Android 的线程运行方法和处理程序
- batch-file - 需要批处理命令获取 mac 地址并比较 txt 文件吗?
- vba - 显示访问报告列表框一个字段分为 3 列
- orchardcms - Pluralsight Advanced - 电影内容未显示在内容表中
- c - “ssize_t wb;”中变量名的命名约定
- mysql - 闭表插入查询
- python-3.x - 是否可以通过字节而不是宽度和高度来调整图像的大小?