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(推薦)
-
打開 Kibana
-
默認地址為
http://your_kibana_host:5601
(如http://localhost:5601
)。 -
登錄到 Kibana。
-
-
進入 Dev Tools
-
在左側菜單中,點擊 "Dev Tools"。
-
-
執行創建索引的命令
-
在控制臺中輸入以下命令并運行:
-
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了