0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Telegraf】 MongoDBを3.4から7.0にしたらGrafanaでMongoDBのグラフが出なくなった

Posted at

タイトルの通りですが、この場合、Telegraf をインストールしたサーバで

tail /var/log/telegraf/telegraf.log

とすると

2025-01-01T08:00:35Z E! [inputs.mongodb] Error in plugin: unable to connect to MongoDB: no reachable servers

などと出ます。結論から言うと Telegraf をバージョンアップすれば解決します。

ちなみに上記の問題が出た Telegraf のバージョンは telegraf-1.17.0-1.x86_64 でした。

Telegraf の更新、具体的には、CentOS7では以下。

yum update telegraf

ですが、

The GPG keys listed for the "InfluxDB Repository - RHEL 7" repository are already installed but they are not correct for this package.

と出て、バージョンアップできないことがあります。

その場合は、 /etc/yum.repos.d/influxdb.repo を書き替えて、

gpgkey = https://repos.influxdata.com/influxdb.key

となっているところを

gpgkey = https://repos.influxdata.com/influxdata-archive_compat.key

とし、

yum clean all

としたあと、 yum update telegraf でうまく行くかと思います。

systemctl restart telegraf をお忘れなく。


Telegraf をバージョンアップしたあと、ログにこんなエラーが出ることがあるようです。

2025-01-01T08:00:29Z E! [outputs.influxdb] When writing to [udp://xxx.xxx.xxx.xxx:8089] could not serialize metric: "xxxxxxxxxxxxxxxxxxxx": need more space

/etc/telegraf/telegraf.conf[[outputs.influxdb]] 下に

  udp_payload = 10240

としたら治りました。10240はちょっと大きすぎかもしれないので、最初は1024とかから試してみてください。

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?