# Metricbeatのエラーについて

**URL:** <https://discuss.elastic.co/t/metricbeat/222631>\
**Category:** 日本語による質問・議論はこちら\
**Created:** [March 9, 2020, 1:49am UTC](https://discuss.elastic.co/t/metricbeat/222631 "2020-03-09T01:49:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![knm](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@knm](https://discuss.elastic.co/u/knm)\
**Post date:** [March 9, 2020, 1:49am UTC](https://discuss.elastic.co/t/metricbeat/222631/1 "2020-03-09T01:49:34Z")

</div>

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](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](http://localhost:5601/api/status) fails: . Response: {"statusCode":401,"error":"Unauthorized","message":"Unauthorized"}.
> 
> ![metricbeat_log](https://us1.discourse-cdn.com/elastic/original/3X/b/0/b073cfef92d1df46cea3d00c20032747412dda6e.png)

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: ~

---

<div class="post-metadata">

**Author:** ![tsgkdt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsgkdt/32/39151_2.png) [@tsgkdt](https://discuss.elastic.co/u/tsgkdt)\
**Post date:** [March 9, 2020, 4:38am UTC](https://discuss.elastic.co/t/metricbeat/222631/2 "2020-03-09T04:38:50Z")

</div>

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

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

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

```auto
#============================== 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"
  # 以下略

```

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

---

<div class="post-metadata">

**Author:** ![knm](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@knm](https://discuss.elastic.co/u/knm)\
**Post date:** [March 9, 2020, 5:18am UTC](https://discuss.elastic.co/t/metricbeat/222631/3 "2020-03-09T05:18:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 6, 2020, 5:18am UTC](https://discuss.elastic.co/t/metricbeat/222631/4 "2020-04-06T05:18:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
