# Elasticsearch异常：无法启动汇总作业 [my_rollup]，因为索引模式 [logs-*] 不匹配任何具有匹配汇总配置的现有索引

- **ID:** `elasticsearch/rollup-job-configuration-mismatch`
- **领域:** elasticsearch
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 78%

## 根因

汇总作业的索引模式不匹配任何具有所需汇总配置的索引，或者索引是在汇总作业定义之后创建的，缺少正确的元数据。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7.13.0 | active | — | — |
| 8.6.0 | active | — | — |
| 8.12.0 | active | — | — |

## 解决方案

1. ```
   Delete the rollup job and recreate it after ensuring the index pattern matches existing indices: DELETE /_rollup/job/my_rollup, then PUT /_rollup/job/my_rollup with the correct index pattern and matching field definitions.
   ```
2. ```
   Use the Rollup Index Capabilities API to check which indices have rollup metadata: GET /logs-*/_rollup/data, then manually add the rollup metadata to missing indices using the Update Index Settings API: PUT /logs-2025/_settings { 'index.rollup.meta': { 'job': 'my_rollup' } }.
   ```

## 无效尝试

- **** — Manually creating indices with the same name pattern does not automatically set the rollup metadata; the indices must be created through the rollup job or have the _rollup.meta field set. (75% 失败率)
- **** — Restarting the rollup job with the same configuration will fail again because the underlying indices are still mismatched. (90% 失败率)
