Metricbeatのエラーについて

metricbeatの7.6.1を起動すると、下記のようなエラーが出て起動できません。
対応方法などございましたら、ご教授いただけると助かります。

2020-03-09T10:27:22.170+0900 ERROR instance/beat.go:933 Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to http://localhost:5601/api/status fails: . Response: {"statusCode":401,"error":"Unauthorized","message":"Unauthorized"}.
Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to http://localhost:5601/api/status fails: . Response: {"statusCode":401,"error":"Unauthorized","message":"Unauthorized"}.

metricbeat.yml

#========================== Modules configuration ============================

metricbeat.config.modules:
#Glob pattern for configuration loading
path: ${path.config}/modules.d/*.yml

#Set to true to enable config reloading
reload.enabled: false

#Period on which files under path should be checked for changes
#reload.period: 10s

#==================== Elasticsearch template setting ==========================

setup.template.settings:
index.number_of_shards: 1
index.codec: best_compression
#_source.enabled: false

#============================== Dashboards =====================================
#These settings control loading the sample dashboards to the Kibana index. Loading
#the dashboards is disabled by default and can be enabled either by setting the
#options here or by using the setup command.
setup.dashboards.enabled: true

#----------------------------- Logstash output --------------------------------
output.logstash:
#The Logstash hosts
hosts: ["localhost:5044"]

#================================ Processors =====================================

#Configure processors to enhance or manipulate events generated by the beat.

processors:

  • add_host_metadata: ~
  • add_cloud_metadata: ~
  • add_docker_metadata: ~
  • add_kubernetes_metadata: ~

出ているエラーの内容から、Kibanaへの接続時の認証エラーと見受けられます。
そのため、正しい情報を設定してやればエラーが解消するのではと思います。

https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-reference-yml.html

setup.kibana以下でusername, passwordが指定できますので、これを設定してmetricbeatを起動してみたらどうでしょうか?

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: "localhost:5601"

  # Optional protocol and basic auth credentials.
  #protocol: "https"
  username: "elastic"
  password: "changeme"
  #  以下略

ご参考になれば幸いです。

1 Like

ありがとうございました。エラー解消しました。