Sometimes a garbage collection log can help troubleshoot your issues. This article explains how to enable logging of the garbage collection activity on Puppet's services.
Version and installation information
Puppet version: 3.8 to latest
Component and version: PuppetServer, PuppetDB
Solution
To enable garbage collection logging on the Puppet master or PuppetDB nodes:
-
Locate the appropriate file for your OS:
OS Location EL- based /etc/sysconfig/puppet
Ubuntu /etc/default/puppet
Edit the appropriate file for your OS the file to add the following flags to the
JAVA_ARGS
setting:-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/var/log/puppetlabs/<service_name>/<service_name>_gc.log
-
Restart the appropriate service.
puppet resource service <service_name> ensure=stopped
puppet resource service <service_name> ensure=running
Example
On Red Hat Enterprise Linux, enable logging for the Puppet Server garbage collector.
-
Edit
/etc/sysconfig/puppetserver
to add the following to theJAVA_ARGS
setting:-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/var/log/puppetlabs/puppetserver/puppetserver_gc.log
-
Restart Puppet Server.
puppet resource service puppetserver ensure=stopped
puppet resource service puppetserver ensure=running
Comments
0 comments
Please sign in to leave a comment.