【skywalking】index“:“skywalking_metrics-all“},“status“:404}

发布于:2025-05-17 ⋅ 阅读:(21) ⋅ 点赞:(0)

skywalking 启动报错

java.lang.RuntimeException: {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [skywalking_metrics-all]","resource.t
ype":"index_or_alias","resource.id":"skywalking_metrics-all","index_uuid":"_na_","index":"skywalking_metrics-all"}],"type":"index_not_found_exception","reason":
"no such index [skywalking_metrics-all]","resource.type":"index_or_alias","resource.id":"skywalking_metrics-all","index_uuid":"_na_","index":"skywalking_metrics
-all"},"status":404}
        at org.apache.skywalking.library.elasticsearch.client.SearchClient.lambda$search$0(SearchClient.java:51) ~[library-elasticsearch-client-10.1.0.jar:10.1.
0]
        at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
        at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147) ~[?:?]
        at com.linecorp.armeria.common.stream.AggregationSupport.lambda$aggregate$2(AggregationSupport.java:133) ~[armeria-1.29.3.jar:?]
        at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911) ~[?:?]
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
        at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147) ~[?:?]
        at com.linecorp.armeria.common.stream.DeferredStreamMessage.lambda$delegate$1(DeferredStreamMessage.java:187) ~[armeria-1.29.3.jar:?]
        at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911) ~[?:?]

去ES里面查看

没有找到

skywalking_metrics-all

在 Elasticsearch 的管理后台中创建名为 skywalking_records-all 的索引的详细步骤:

一、使用 Kibana Dev Tools(推荐)

  1. 打开 Kibana

    • 默认地址为 http://your_kibana_host:5601(如 http://localhost:5601)。

    • 登录到 Kibana。

  2. 进入 Dev Tools

    • 在左侧菜单中,点击 "Dev Tools"

  3. 执行创建索引的命令

    • 在控制台中输入以下命令并运行:

PUT /skywalking_records-all
{
  "mappings": {
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "operation_name": {
        "type": "keyword"
      },
      "service_name": {
        "type": "keyword"
      },
      "latency": {
        "type": "float"
      },
      "status": {
        "type": "keyword"
      },
      "tags": {
        "type": "object"
      }
    }
  }
}

再次启动Kibana

提示:找不到 kywalking_records-all

创建一下:

PUT /skywalking_records-all
{
  "mappings": {
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "operation_name": {
        "type": "keyword"
      },
      "service_name": {
        "type": "keyword"
      },
      "latency": {
        "type": "float"
      },
      "status": {
        "type": "keyword"
      },
      "tags": {
        "type": "object"
      },
      "start_time": {
        "type": "date"
      }
    }
  }
}

再次启动Kibana

提示:

{
	"error": {
		"root_cause": [
			{
				"type": "query_shard_exception",
				"reason": "No mapping found for [start_time] in order to sort on",
				"index_uuid": "ZENCEY8DTqmALuxkuSiYdA",
				"index": "skywalking_records-all"
			}
		],
		"type": "search_phase_execution_exception",
		"reason": "all shards failed",
		"phase": "query",
		"grouped": true,
		"failed_shards": [
			{
				"shard": 0,
				"index": "skywalking_records-all",
				"node": "KUGv_q19QomaoM8D5H1NPQ",
				"reason": {
					"type": "query_shard_exception",
					"reason": "No mapping found for [start_time] in order to sort on",
					"index_uuid": "ZENCEY8DTqmALuxkuSiYdA",
					"index": "skywalking_records-all"
				}
			}
		]
	},
	"status": 400
}

这个错误表明在 skywalking_records-all 索引中尝试对 start_time 字段进行排序时,Elasticsearch 无法找到该字段的映射。这通常是因为索引中没有定义 start_time 字段,或者该字段从未被写入过数据。

执行下面命令

PUT /skywalking_records-all/_mapping
{
  "properties": {
    "start_time": {
      "type": "date"
    }
  }
}

再再次启动Kibana

 ./startup.sh 


这会OK了





网站公告

今日签到

点亮在社区的每一天
去签到