Problem scenario
Your newly installed Puppet Master is not working. The main service will not start. You try this command: service puppetserver restart
You see this as the results of the above command:
"Job for puppetserver.service failed because the control process exited with error code. See "systemctl status puppetserver.service" and "journalctl -xe" for details."
You then try this command to see what is wrong (per the error message above):systemctl status puppetserver.service
It results in this:
? puppetserver.service - LSB: puppetserver
Loaded: loaded (/etc/init.d/puppetserver; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-01-12 19:17:18 EST; 22s ago
Docs: man:systemd-sysv-generator(8)
Process: 6434 ExecStart=/etc/init.d/puppetserver start (code=exited, status=1/
How do you fix this problem?
Solution
It is recommended that you have 6 GB of memory for Puppet Enterprise. For testing purposes the Puppet Master service will run with less than 1 GB. Modify this file /etc/default/puppetserver.
Find this line in /etc/default/puppetserver:
JAVA_ARGS="-Xms2g -Xmx2g -XX:MaxPermSize=256m"
Change it to this (where 256 is the number of MB your server has*):
JAVA_ARGS="-Xms900m -Xmx900m -XX:MaxPermSize=256m"
* Use this command: free -m
In the results of free -m
, the value under "total" for "Mem:" is the value of "x" you should use for this computation:
y = x * .9
The resulting value of y (based on this formula) should be in the JAVA_ARGS statement in the file /etc/default/puppetserver in a certain way: Replace the "2" in both instances of "Xms2g" (as shown above) with the value of y. Replace the "g" in these two strings with the letter m. (The "g" is for gigabytes and the "m" is for megabytes.) This example involving changing "g" to "m" assumes you have only 1 GB of RAM on the server. In some instances your JAVA_ARGS stanza in the /etc/default/puppetserver file would have a "g" and not an "m".
If you need assistance adding virtual memory (aka swap space), see this posting. If you want to upgrade your AWS EC-2 instance, see this posting. If you want to resize your GCP virtual machine (aka server in Google Cloud), see this posting.
check if you have ruby installed on your system. if not, install ruby and rerun “systemctl start puppetserver”.
it will work.