LoginSignup
6
3

More than 5 years have passed since last update.

AWS Systems Managerを利用しているとinodeが枯渇するはなし

Last updated at Posted at 2018-04-25

環境

AMI version

Amazon Linux AMI release 2017.09

SSM agent version

2.2.45.0

概要

AWSでSystems Manager(以下ssm)を利用していたら、inodeが枯渇して、新規ファイルが作れなくなりました。
もちろん現象発生以降のssmの実行もコンソールで「失敗」ステータスになっていました。

エラーメッセージ

failed to open stream: No space left on device

原因

amazon-ssm-agentのGithubにissueが上がっていました。
https://github.com/aws/amazon-ssm-agent/issues/94
ssm実行時のファイルが削除されずにずっと残ってしまうようです。最新のamazon-ssm-agentでも直っていないようです。

解決法

issueにも記載のあるように、findで一定日数以上経過したものを削除するコマンドをcronに仕込むと良いと思います。

0 0 * * * find /var/lib/amazon/ssm/i-*/document/orchestration -mindepth 2 -maxdepth 2 -type d -mtime +3 -print0 | xargs -0 rm -rf
6
3
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
6
3