官术网_书友最值得收藏!

Setting up the server machine

Getting the puppetserver software onto a Linux machine is just as simple as the agent package (which you did at the very beginning of Chapter 1, Writing Your First Manifests). Packages are available on Red Hat Enterprise Linux and its derivatives, Debian and Ubuntu, and any other operating system that is supported to run a Puppet server.

Until now, the Puppet server must run on a Linux-based operating system, and cannot run on Windows or any other Unix. A great way to get Puppet Inc. packages on any platform is the Puppet Collection. Shortly after the release of Puppet 4, Puppet Inc. created this new way of supplying software. This can be considered as a distribution in its own right. Unlike Linux distributions, it does not contain a Kernel, system tools, or libraries. Instead, it comprises various software from the Puppet ecosystem. Software versions that are available from the same Puppet collection are guaranteed to work well together.

Use the following commands to install puppetserver from the first Puppet Collection (PC1) on a Debian 8 machine (the collection for Debian 9 has not yet received a puppetserver package at the time of writing this):

root@puppetmaster# wget http://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb
root@puppetmaster# dpkg -i puppetlabs-release-pc1-jessie.deb
root@puppetmaster# apt-get update
root@puppetmaster# apt-get install puppetserver

The puppetserver package comprises only the Jetty server and the Clojure API, but the all-in-one puppet-agent package is pulled in as a dependency.

The package name, puppet-agent, is misleading. This AIO package contains all the parts of Puppet, including the master core, a vendored Ruby build, and several pieces of additional software.

Specifically, you can use the puppet command on the master node. You will soon learn how this is useful. However, when using the packages from Puppet Labs, everything gets installed under /opt/puppetlabs. It is advisable to make sure that your PATH variable always includes the /opt/puppetlabs/bin directory so that the puppet command is found here.

Regardless of this, once the puppetserver package is installed, you can start the master service:

root@puppetmaster# systemctl start puppetserver  

Depending on the power of your machine, the startup can take a few minutes. Once initialization completes, the server will operate very smoothly, though. As soon as the master port 8140 is open, your Puppet master is ready to serve requests.

If the service fails to start, there might be an issue with certificate generation (we observed such issues with some versions of the software). Check the log file at /var/log/puppetlabs/puppetserver/puppetserver-daemon.log. If it indicates that there are problems while looking up its certificate file, you can work around the problem by temporarily running a standalone master as follows:
puppet master --no-daemonize
After initialization, you can stop this process. The certificate is available now, and  puppetserver  should now be able to start as well.

Another reason for start failures is an insufficient amount of memory. The Puppet server process needs 2 GB of memory.

主站蜘蛛池模板: 香港| 博爱县| 满洲里市| 黄陵县| 和田市| 宜川县| 鄂伦春自治旗| 黎川县| 太仓市| 北安市| 普陀区| 兰溪市| 喀喇沁旗| 新民市| 盐源县| 那坡县| 龙岩市| 达尔| 济源市| 突泉县| 台前县| 孟连| 华蓥市| 肇州县| 德阳市| 武义县| 垫江县| 长岭县| 越西县| 中方县| 五台县| 绥阳县| 桃园市| 大洼县| 永定县| 蒲江县| 通渭县| 河北省| 朔州市| 穆棱市| 怀柔区|