AmazonLinux2のjournaldの挙動

ルートボリュームのサイズを100GBにして普通のAmazonLinux2インスタンスを起動する。

$ journalctl -u systemd-journald
-- Logs begin at Tue 2018-11-20 01:30:57 UTC, end at Tue 2018-11-20 01:31:22 UTC. --
Nov 20 01:30:57 localhost systemd-journal[914]: Runtime journal is using 6.1M (max allowed 49.2M, trying to leave 73.9M free of 486.6M available → current limit 49.2M).
Nov 20 01:30:57 localhost systemd-journal[914]: Journal started
Nov 20 01:30:59 localhost systemd-journal[914]: Journal stopped
Nov 20 01:31:00 localhost systemd-journal[1913]: Runtime journal is using 6.1M (max allowed 49.2M, trying to leave 73.9M free of 480.5M available → current limit 49.2M).
Nov 20 01:31:00 localhost systemd-journal[1913]: Journal started
Nov 20 01:31:00 localhost systemd-journal[1913]: Permanent journal is using 8.0M (max allowed 818.0M, trying to leave 1.1G free of 6.9G available → current limit 818.0M).
Nov 20 01:31:00 localhost systemd-journal[1913]: Time spent on flushing to /var is 20.910ms for 542 entries.

一度 Runtime journal (=tmpfsでメモリにログが吐かれる)で起動し、再起動した後、 Permanent journal に変わっている。

まぁこの辺の挙動はAmazonLinuxの挙動なんだろうということで(未確認)受け入れるとして、気になるのは Permanent journal になったときにDISKが6.9GBしか認識されていないという点。EBSのデフォルトサイズである8GBが認識されるタイミングでもあるんですかね?(わかりません)

$ sudo systemctl restart systemd-journald
$ journalctl -u systemd-journald
Nov 20 01:35:25 ip-172-31-1-38.ap-northeast-1.compute.internal systemd-journal[1913]: Journal stopped
Nov 20 01:35:25 ip-172-31-1-38.ap-northeast-1.compute.internal systemd-journal[3419]: Permanent journal is using 8.0M (max allowed 4.0G, trying to leave 4.0G free of 98.7G available → current limit 4.0G).
Nov 20 01:35:25 ip-172-31-1-38.ap-northeast-1.compute.internal systemd-journal[3419]: Journal started

journaldを再起動すると直りますw

ついでにhost名もついてますね。AmazonLinuxの初期化タイミングとの兼ね合いっぽいですね。

$ sudo reboot
$ journalctl -u systemd-journald
-- Reboot --
Nov 20 01:36:52 localhost systemd-journal[912]: Runtime journal is using 6.1M (max allowed 49.2M, trying to leave 73.9M free of 486.6M available → current limit 49.2M).
Nov 20 01:36:52 localhost systemd-journal[912]: Journal started
Nov 20 01:36:55 ip-172-31-1-38.ap-northeast-1.compute.internal systemd-journal[1912]: Runtime journal is using 6.1M (max allowed 49.2M, trying to leave 73.9M free of 480.5M available → current limit 49.2M).
Nov 20 01:36:55 ip-172-31-1-38.ap-northeast-1.compute.internal systemd-journal[1912]: Journal started
Nov 20 01:36:55 ip-172-31-1-38.ap-northeast-1.compute.internal systemd-journal[1912]: Permanent journal is using 8.0M (max allowed 4.0G, trying to leave 4.0G free of 98.7G available → current limit 4.0G).
Nov 20 01:36:55 ip-172-31-1-38.ap-northeast-1.compute.internal systemd-journal[1912]: Time spent on flushing to /var is 67.158ms for 545 entries.

rebootすると、またRuntime -> restart -> Permanentの流れをたどりますが、DISKの認識は問題なさそうです。