Elasticsearch

[Elasticsearch] monitoring execution failed 오류

joonsei 2020. 3. 19. 12:12

Elasticsearch 로그 모니터링 중, 아래와 같은 오류가 발생했다.

[2020-03-19T00:00:17,340][WARN ][o.e.x.m.MonitoringService] [xx-xx-log-1] monitoring execution failed
org.elasticsearch.xpack.monitoring.exporter.ExportException: Exception when closing export bulk
        at org.elasticsearch.xpack.monitoring.exporter.ExportBulk$1$1.<init>(ExportBulk.java:95) ~[?:?]
        at org.elasticsearch.xpack.monitoring.exporter.ExportBulk$1.onFailure(ExportBulk.java:93) ~[?:?]
        at org.elasticsearch.xpack.monitoring.exporter.ExportBulk$Compound$1.onResponse(ExportBulk.java:206) ~[?:?]
        at org.elasticsearch.xpack.monitoring.exporter.ExportBulk$Compound$1.onResponse(ExportBulk.java:200) ~[?:?]

monitoring execution failed 으로 구글링해보니,
<There are no ingest nodes in this cluster, unable to forward request to an ingest node.>
elasticsearch.yml 설정 파일에서 node.ingest: false 로 바꿔주라고 나와있다.

node.ingest: false로 바꿔줘도 계속 발생하였다.


Cluster의 Node 할당 관련 문제가 있나 확인해보니

curl -XGET localhost:9200/_cluster/allocation/explain?pretty
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true]"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true]"
    },
    "status": 400
}

할당되지 않은 unassinged shard 가 있다고 나오기는 하나,
실제 cluster status 는 Green이였다.

혹시 해서 cluster 설정값을 확인해보니

curl -XGET localhost:9200/_cluster/settings?pretty
{
  "persistent" : {
    "cluster" : {
      "routing" : {
        "rebalance" : {
          "enable" : "all"
        },
        "allocation" : {
          "allow_rebalance" : "always"
        }
      }
    },
    "xpack" : {
      "monitoring" : {
        "collection" : {
          "enabled" : "true"
        }
      }
    }
  },
  "transient" : {
    "cluster" : {
      "routing" : {
        "allocation" : {
          "enable" : "all"
        }
      }
    }
  }
}

xpack.monitoring.collection.enabled 값이 true로 설정 되어있었다.
해당 값은 elasticsearch.yml 에서 설정 가능하며, default는 false임에도 불구하고..
true로 설정 되어 있어서 오류가 발생하였다.

해당 xpack monitoring 설정 값을 false 로 변경해주고 나니, 오류가 발생하지 않았다.

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
    "persistent" : {
        "xpack.monitoring.collection.enabled" : "false"
    }
}
'