redhat-nfvpe / ansible-role-vm-spinup

Sets up a virtualization host and spins up libvirt VMs for labs
Apache License 2.0
3 stars 7 forks source link

Control disk usage of journald #30

Open leifmadsen opened 6 years ago

leifmadsen commented 6 years ago

Right now journald will consume the entire disk of the system if left to its own devices.

We need to make that configurable and template it.

Per @atyronesmith

stopped all master nodes
used guestfish to remove the journal files
restarted
changed

[Journal]
SystemMaxUse=1G
SystemMaxFileSize=10M
leifmadsen commented 6 years ago

@dougbtv this is probably why our OpenShifts die after 12 hours. It was why mine did :)

Assigned to me. I will fix this week. (Out today.)

leifmadsen commented 6 years ago

I have this fixed and working... I think it's mostly adding it to the examples. I'll come back with more information soon...

In your openshift-ansible inventory file though, you can add this to start:

[OSEv3:vars]

# logging control
logrotate_scripts=[{"name": "syslog", "path": "/var/log/cron\n/var/log/maillog\n/var/log/messages\n/var/log/secure\n/var/log/spooler\n", "options": ["daily", "rotate 4", "size 50M", "compress", "sharedscripts", "missingok"], "scripts": {"postrotate": "/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true"}}]

journald_vars_to_replace=[{ "var": "Storage", "val": "persistent" },{ "var": "Compress", "val": "yes" },{ "var": "SyncIntervalSec", "val": "1s" },{ "var": "RateLimitInterval", "val": "1s" },{ "var": "RateLimitBurst", "val": "10000" },{ "var": "SystemMaxUse", "val": "500M" },{ "var": "SystemKeepFree", "val": "20%" },{ "var": "SystemMaxFileSize", "val": "10M" },{ "var": "MaxRetentionSec", "val": "1month" },{ "var": "MaxFileSec", "val": "1day" },{ "var": "ForwardToSyslog", "val": "no" },{ "var": "ForwardToWall", "val": "no" }]