Consulta os relatórios históricos de O&M inteligente de um cluster Elasticsearch.
Depuração
Cabeçalho da requisição
Esta operação não possui cabeçalhos específicos e utiliza apenas os cabeçalhos comuns. Para mais informações, consulte a seção "Parâmetros de requisição comuns" no tópico Parâmetros comuns.
Sintaxe da requisição
GET /openapi/diagnosis/instances/{InstanceId}/reports HTTP/1.1
Parâmetros da requisição
|
Parâmetro |
Tipo |
Posição |
Obrigatório |
Exemplo |
Descrição |
| InstanceId | String | Path | Yes | es-cn-n6w1qu7ei000p**** |
ID da instância. |
| lang | String | Query | No | es |
Idioma dos relatórios. O padrão corresponde ao idioma do navegador. Valores suportados:
|
| startTime | Long | Query | Yes | 1594569600000 |
Início do intervalo de tempo da consulta. O valor deve ser um timestamp UNIX. Unidade: milissegundos.
|
| endTime | Long | Query | Yes | 1595174399999 |
Fim do intervalo de tempo da consulta. O valor deve ser um timestamp UNIX. Unidade: milissegundos.
|
| page | Integer | Query | No | 1 |
Número da página a retornar. Valores válidos: 1 a 200. Valor padrão: 1. |
| size | Integer | Query | No | 20 |
Quantidade de relatórios por página. Valores válidos: 1 a 500. Valor padrão: 10. |
| detail | Boolean | Query | No | true |
Indica se os detalhes dos itens de diagnóstico devem ser exibidos. |
| trigger | String | Query | No | SYSTEM |
Modo de acionamento do diagnóstico de integridade. Métodos disponíveis:
|
Parâmetros de resposta
|
Parâmetro |
Tipo |
Exemplo |
Descrição |
| RequestId | String | 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1**** |
ID da requisição. |
| Headers | Object |
Cabeçalho da resposta. |
|
| X-Total-Count | Integer | 15 |
Número total de entradas retornadas. |
| Result | Array of Result |
Dados retornados. |
|
| trigger | String | USER |
Modo de acionamento do diagnóstico de integridade. Valores válidos:
|
| createTime | Long | 1535745731000 |
Timestamp de criação do relatório. |
| reportId | String | trigger__2020-08-17T17:09:02f |
ID do relatório. |
| state | String | SUCCESS |
Status do diagnóstico. Valores válidos: SUCCESS, FAILED e RUNNING. |
| instanceId | String | es-cn-abc |
ID da instância de diagnóstico. |
| health | String | YELLOW |
Integridade geral do cluster no relatório. Valores válidos: GREEN, YELLOW, RED e UNKNOWN. |
| diagnoseItems | Array of diagnoseItems |
Lista de informações dos itens de diagnóstico do relatório. |
|
| item | String | IndexAliasUseDiagnostic |
Nome do item de diagnóstico. |
| health | String | YELLOW |
Nível de integridade do item de diagnóstico. Valores válidos: GREEN, YELLOW, RED e UNKNOWN. |
| detail | Object |
Detalhes do item de diagnóstico. |
|
| type | String | ES_API |
Tipo do resultado de diagnóstico. Valores válidos:
|
| name | String | Number of Replica Shards |
Nome completo do item de diagnóstico. |
| desc | String | Check whether the number of replica shards is optimal and easy to maintain |
Descrição do item de diagnóstico. |
| result | String | You may need to adjust the numbers of replica shards of some indices as follows: [geoname08 : 0 -> 1][geoname09 : 0 -> 1][geonametest01 : 0 -> 1] |
Resultado do diagnóstico. |
| suggest | String | You can call the following function in the Elasticsearch API.... |
Sugestão para o diagnóstico. |
Exemplos
Exemplos de requisições
GET /openapi/diagnosis/instances/es-cn-n6w1qu7ei000p****/reports?lang=es&startTime=1594569600000&endTime=1595174399999&page=1&size=20&detail=true&trigger=SYSTEM HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json
Exemplos de respostas de sucesso
Formato JSON
HTTP/1.1 200 OK
Content-Type:application/json
{
"Result" : [ {
"reportId" : "scheduled__2020-09-15T02:40:00",
"instanceId" : "es-cn-09k1rocex0006****",
"state" : "SUCCESS",
"trigger" : "SYSTEM",
"health" : "YELLOW",
"createTime" : 1600108800000,
"diagnoseItems" : [ {
"item" : "IndexReplicaDiagnostic",
"health" : "YELLOW",
"detail" : {
"name" : "Number of Replica Shards",
"desc" : "Check whether the number of replica shards is optimal and easy to maintain.\nReplica shards can increase the index data reliability and improve the QPS if the resources are sufficient. However, too many replica shards may consume large amounts of disk space and memory. This reduces the performance of write operations.",
"type" : "CONSOLE_API",
"suggest" : "You can call the following function in the Elasticsearch API: \nPUT ${index}/_settings\n{\n \"settings\": {\n \"index.number_of_replicas\": \"${num}\"\n }\n} \r\nSet the index and num parameters to the actual values.",
"result" : "You may need to adjust the numbers of replica shards of some indices as follows: \n[geoname08 : 0 -> 1][geoname09 : 0 -> 1][geonametest01 : 0 -> 1]"
}
}, {
"item" : "IndexShardsDiagnostic",
"health" : "YELLOW",
"detail" : {
"name" : "Number and Sizes of Shards in Each Index",
"desc" : "Check whether the number and sizes of shards in each index are optimal.\nA small number of shards may degrade the read and write performance of an index. A large number of shards consume a lot of system resources and degrade the read and write performance of an index.",
"type" : "ES_API",
"suggest" : "We recommend the following solution: \nhotmovies [size < 1 GB] [7 -> 1, 3]\ngeoname08 [2 GB] [5 -> 1, 3]\ngeoname09 [3 GB] [5 -> 1, 3]\ngeonametest01 [2 GB] [5 -> 1, 3]\n \r\nThis solution applies to the current index sizes. Adjust the number of shards based on the future indices and nodes.",
"result" : "You may need to adjust the number of shards in some indices."
}
}, {
"item" : "NodeLeftDiagnostic",
"health" : "GREEN",
"detail" : {
"name" : "Missing Nodes",
"desc" : "Check whether any node has not joined the cluster.\nMissing nodes may cause serious problems and requires immediate attention.",
"type" : "TEXT",
"result" : "All nodes have joined the cluster."
}
}, {
"item" : "FullGcLogDiagnostic",
"health" : "GREEN",
"detail" : {
"name" : "Full GC Activities",
"desc" : "Check whether the full GC activities of the cluster are normal.",
"type" : "TEXT",
"result" : "The full GC activities of the cluster are normal."
}
}, {
"item" : "ClusterMinMasterDiagnostic",
"health" : "GREEN",
"detail" : {
"name" : "minimum_master_nodes Configuration",
"desc" : "Check whether the discovery.zen.minimum_master_nodes configuration of the cluster is optimal.\nAn improper zen.min.master configuration may cause cluster instability and even cluster split-brain in the case of a high cluster load. Cluster split-brain may cause problems such as missing nodes, cluster jitter, and data exception, which require immediate attention.",
"type" : "TEXT",
"result" : "The minMaster configuration is optimal. candidateMasterCount is set to 3, and discovery.zen.minimum_master_nodes is set to 2."
}
}, {
"item" : "ClusterStateVersionDiagnostic",
"health" : "GREEN",
"detail" : {
"name" : "Frequent Changes in Cluster Status",
"desc" : "Check whether the cluster status changes frequently.\nFrequent changes in the cluster status can greatly increase the load of the master node, causing frequent GC activities, and may even degrade the cluster performance by blocking the reading and writing of index data.",
"type" : "TEXT",
"result" : "The cluster status changes at an optimal frequency."
}
}, {
"item" : "ErrorLogDiagnostic",
"health" : "GREEN",
"detail" : {
"name" : "Exceptions Log",
"desc" : "Check for exceptions logs.",
"type" : "TEXT",
"result" : "No exceptions log has been detected."
}
} ]
} ],
"RequestId" : "40962041-2864-4877-81C7-9657FDA3****",
"Headers" : {
"X-Total-Count" : 1
}
}
Códigos de erro
Para obter uma lista de códigos de erro, consulte Códigos de erro do serviço.