Deploying Code without blocking requests to Puppet Server
When compiling code, Puppet Server typically blocks requests, including catalog compilation, until file sync is done updating the Puppet code directory. You can enable lockless deploys so the file sync client updates code into versioned code directories instead of blocking requests and overwriting the live code directory.
With lockless deploys enabled, each new deploy writes code to versioned directories at
The standard code directory,
points via symlink to the most recent versioned code directory. If you disable lockless
deploys after enabling it, your code directory moves back to the default location.
To conserve disk space, code written to version directories is optimized to reduce
duplication, and directories older than the latest and its predecessor are cleaned up
after 30 minutes. If you deploy code very frequently, you might prefer to decrease the
versioned-dirs-ttl setting, which is specified, in
file-sync.conf within each file sync
Deploy code without blocking requests
When you enable lockless deploys, the file sync client updates code into versioned code directories without blocking requests.
- In the console, click Node groups and select the PE Master node group.
On the Classes tab, in the
versioned_deploys= true and click Add parameter.
- Commit changes.
Run Puppet on your primary server and all
puppet agent -t
/etc/puppetlabs/puppetserver/code, and versioned code directories are added at
System requirements for lockless deploys
Enabling lockless deploys increases the disk storage required on your primary server and compilers, because code is written to multiple versioned directories, instead of a single live code directory. Follow these guidelines to estimate your required system capacity.
Estimate required disk storage
You can estimate your required disk storage with this equation:
(Size of typical environment)(Number of active environments)
For example, if your typical environment, when deployed, is 200 MB on disk, and you
have 25 active environments, your disk storage calculation is 200 MB
= 5,000 MB or 5 GB.
Estimate additional disk storage
The number of times you deploy a given environment each day also impacts your disk use. Deploying multiple versions of the same environment uses approximately 25 percent more disk space than deploying multiple unique environments. To estimate the additional disk storage required for deploying environments multiple times a day, use this equation:
(Size of typical environment x .25)(Number of environments deployed multiple times per day)(Number of deployments per day)
Expanding on the previous example, if 10 of your active environments are deployed up to 10 times per day, your disk storage calculation is 50 MB x 10 x 10 = 5,000 MB or an additional 5 GB of disk space. In total then, you need 10 GB available for your primary server and each compiler.