Puppet installation and configuration

Source: Internet
Author: User
Tags rrd ssl certificate

Puppet is a configuration management software designed to achieve automated database center management. Based on the C/S architecture. The puppet server stores all the configuration code for the client server, which is called manifest in puppet. after downloading the manifest, the client can configure the server based on the manifest, such as software package management, user management, and file management. In this way, the daily system management tasks are code-based. The advantage of Code-based is that you can share, save, avoid repetitive work, and quickly restore and quickly deploy servers on a large scale. At the same time, manifest can be dynamically generated based on the configuration of the client server (hardware and software. Let's take a look at it together:

Operations required by both the server and client.
1. Download Software
Wget http://puppetlabs.com/downloads/facter/facter-1.6.4.tar.gz
Wget http://downloads.puppetlabs.com/puppet/puppet-2.7.9.tar.gz
2. Install Ruby puppet, which is developed by ruby.
Yum-y install Ruby
3. Install facter
Ruby install. Rb
4. Install puppet quickly. In less than 1 minute.
Ruby install. Rb
5. Synchronization time
CP/usr/share/zoneinfo/Asia/Shanghai/etc/localtime
/Usr/sbin/ntpdate time.nist.gov
2. server operations.
1. create directories and copy files.
Mkdir/etc/puppet
Cp conf/auth. CONF/etc/puppet/
Cp conf/RedHat/fileserver. CONF/etc/puppet/
Cp conf/RedHat/puppet. CONF/etc/puppet/
Cp conf/RedHat/server. init/etc/init. d/puppetmaster
Chmod 755/etc/init. d/puppetmaster
Chkconfig -- add puppetmaster
Chkconfig puppetmaster on
Mkdir-P/etc/puppet/manifests
2. Create a puppet account
Puppetmasterd -- mkusers
3. Create a directory
Mkdir/var/lib/puppet/RRD/
Chown puppet. Puppet/var/lib/puppet/RRD/
4. Start the service/etc/init. d/puppetmaster start
3. client-side operations
1. create directories and copy files.
Mkdir/etc/puppet
Cp conf/auth. CONF/etc/puppet/
Cp conf/namespaceauth. CONF/etc/puppet/
Cp conf/RedHat/puppet. CONF/etc/puppet/
Cp conf/RedHat/client. init/etc/init. d/puppet
Chmod 755/etc/init. d/puppet
Chkconfig -- add puppet
Chkconfig puppet on
2. Create puppet users and groups
Puppetd-mkusers; if an error is reported, manually create puppet users and groups (put puppet in the puppet group)
3. Create a directory
Mkdir/var/lib/puppet/RRD
Chown puppet. Puppet/var/lib/puppet/RRD
Iv. Test
1. The client executes puppetd -- Test -- server server.puppet.com to send the authentication request.
[[Email protected] puppet-2.7.9] # puppetd -- Test -- server server.puppet.com
Warning: Peer certificate won't be verified in this SSL session
Info: caching certificate for CA
Warning: Peer certificate won't be verified in this SSL session
Warning: Peer certificate won't be verified in this SSL session
Info: creating a new SSL certificate request for localhost. localdomain
Info: certificate request fingerprint (MD5): C5: 76: BF: 68: 12: 82: BD: 42: 86: 0f: 28: 16: 1b: 6a: 75: dd
Warning: Peer certificate won't be verified in this SSL session
Warning: Peer certificate won't be verified in this SSL session
Warning: Peer certificate won't be verified in this SSL session
Exiting; no certificate found and waitforcert is disabled
2. Run puppetca-S-A on the server.
[[Email protected] Soft] # puppetca-S-A sends and accepts the request.
Notice: signed certificate request for localhost. localdomain
Notice: removing file puppet: SSL: certificaterequest localhost. localdomain at '/var/lib/puppet/SSL/CA/requests/localhost. localdomain. pem'
3. The client resends the request puppetd -- Test -- server server.puppet.com
[[Email protected] puppet-2.7.9] # puppetd -- Test -- server server.puppet.com
Info: caching certificate_revocation_list for CA
Info: caching catalog for localhost. localdomain
Info: Applying configuration version '20140901'
Info: Creating state file/var/lib/puppet/State. yaml
Notice: Finished catalog run in 0.04 seconds
The above message indicates that the server has accepted the request and the connection is successful. If the following error is reported:
[[Email protected] puppet-2.7.9] # puppetd -- Test -- server server.puppet.com
Err: cocould not retrieve catalog from remote server: Hostname not match with the server certificate
Warning: Not Using Cache on failed catalog
Err: cocould not retrieve Catalog; skipping run
Err: cocould not send Report: Hostname not match with the server certificate
You need to modify the Host Name and host hosts resolution of the server.
V. Example
The following example shows that the basic settings of puppet are correct:
1. Now put the following content in the/etc/puppet/manifests/site. Pp of the server:
Node default {
File {"/tmp/a.txt ":
Content => "Helo, I am ABC. BBB! ABC. AAA \ n bbbbbb \ n CCCC \ n dddd \ n ",
Ensure => present,
Mode = & gt; 644,
Owner => root,
Group => root,
}
}
2. Run puppetd -- Test -- server server.puppet.com on the client to find that/tmp/will generate the.txt file, which contains content.
[[Email protected] ~] # Cat/tmp/a.txt
Helo, I am ABC. BBB! ABC. AAA
Bbbbbb
CCCC
Dddd
So far, it is completely OK.

This article from the "Island is the sea cry broken heart °" blog, please be sure to keep this source http://dihaifeng.blog.51cto.com/8814208/1553317

Puppet installation and configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.