Logo

Personal Ops Runbook

Personal runbook covering infrastructure operations for Cloud, Kubernetes, OpenStack, and Ceph environments. Includes deployment and teardown procedures, node management, cluster monitoring setup, and incident response workflows compiled from day-to-day operational work. Intended strictly for personal reference — configurations and scripts are environment-specific and not guaranteed to work as-is elsewhere.

[ELK] Một số lỗi trong ELK


1. Lỗi không tìm thấy server Elasticsearch.

[2022-11-20T04:26:59,579][WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://elasticsearch:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}

Hãy trỏ đúng server Elasticsearch của bạn, trường hợp bạn đã trỏ đúng và Logstash của bạn đã lắng nghe được cổng 9200 của Elasticsearch thì lỗi có thể do config mặc định của Logstash. Cách fix như sau.

Vào chỉnh sử file /usr/share/logstash/config/logstash.yml, tại phần xpack.monitoring.elasticsearch.hosts bạn hãy sửa lại thông tin Elasticsearch của bạn cho đúng hoặc có thể comment nó lại.

$ vi /usr/share/logstash/config/logstash.yml
http.host: "0.0.0.0"
xpack.monitoring.elasticsearch.hosts: [ "http://elasticsearch:9200" ]

Kết quả khi comment nó lại sẽ như sau.

$ vi /usr/share/logstash/config/logstash.yml
http.host: "0.0.0.0"
# xpack.monitoring.elasticsearch.hosts: [ "http://elasticsearch:9200" ]

2. Lỗi Unable to retrieve license information from license server.

[2022-11-20T04:14:37,130][ERROR][logstash.licensechecker.licensereader] Unable to retrieve license information from license server {:message=>"No Available connections"}

Hãy thêm biến môi trường này cho Logstash, nhớ trỏ đúng server Elasticsearch của bạn.

environment:
  ELASTICSEARCH_URL: http://es01:9200

Còn upadte nếu gặp lỗi ….