ログストア=永続 - ディスクのみまたはRAMとディスク

ログストア=永続 - ディスクのみまたはRAMとディスク

私はログエントリの継続的な保存の面でJournaldの役割を理解しようとしています。 SDCard 設定があるため、ディスクへの書き込みを最小限に抑え、ロギングである程度の耐久性を求めます。

すぐに利用可能な(Raspbian)ジャーナルはieを使用します。これはStorage=auto、インストールされていない限り、すべての/var/log/journalジャーナルをRAMにのみ保存します。

問題は、マウントポイントが存在する場合、ジャーナルは引き続き/var/log/journalRAMを最大限に使用しますか、それとも基本的にすべてをディスクに書き込みますか?

主にRAMに書き込む場合、ログ永続性を管理するためにどのような基本的なメカニズムが設定されていますか?

ベストアンサー1

Journal.confのマンページから抜粋

       Storage=
           Controls where to store journal data. One of "volatile", "persistent", "auto" and "none". If "volatile", journal log data
           will be stored only in memory, i.e. below the /run/log/journal hierarchy (which is created if needed). If "persistent",
           data will be stored preferably on disk, i.e. below the /var/log/journal hierarchy (which is created if needed), with a
           fallback to /run/log/journal (which is created if needed), during early boot and if the disk is not writable.  "auto" is
           similar to "persistent" but the directory /var/log/journal is not created if needed, so that its existence controls where
           log data goes.  "none" turns off all storage, all log data received will be dropped. Forwarding to other targets, such as
           the console, the kernel log buffer, or a syslog socket will still work however. Defaults to "auto".

私が知っている限り、autoこの文はパターンですその存在がログデータの場所を制御するように具体的に定義:

  • それ以外の場合は/var/log/journalログのみが記録されます。/run/log/journal
  • を使用すると、/var/log/journalログは次にのみ記録されます。/var/log/journal

おすすめ記事