Puppet building notes
I. Introduction
Puppet is a C/S structure software that centrally manages files, packages, servers, cron, user, group, exec (execute shell commands), yumrepo, and other common resources of multiple servers.
Ii. puppet Workflow
Puppet client collects client information through facter (host name, memory, IP address, system information ......) Concurrently sent to the server
The server detects the client host name, and then parses the corresponding node configuration in manifest (syntax detection, pseudo code generation, and pseudo code sending to the client), only parses and modifies the node configuration.
The client receives the code and then executes it. Then, the client passes the execution result to the server.
The server then writes the execution result of the client to the log.
Iii. installation and configuration
Puppet server: 192.168.1.10 master.puppet.com
Puppet agent: 192.168.1.11 agent.puppet.com
The Host Name and IP address must be resolved. You can manually modify the hosts file or use DNS resolution.
Configure the epel Source:
Rpm-ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
Operations on puppet server:
Yum install puppet-server-y
Generate the configuration file:
Puppet master -- genconfig>/etc/puppet. conf
Touch/etc/puppet/manifests/site. pp
This file is equivalent to an index file, which records the agent configuration and can also define global variables.
Example:
Cat/etc/puppet/manifests/site. pp
Import 'nodes. PP'
Import 'nodes/*. PP'
$ Puppetserver = 'master .puppet.com'
Operations on puppet agent:
Yum install puppet-y
Vim/etc/puppet. conf
Add
Server = master.puppet.com (master host name, which must be pinged, hosts or dns resolution bound)
Add in agent
Runinterval = 10 (query interval to master, in seconds)
Iv. Test
Puppet server is started for the first time:
Puppet master -- verbose -- no-daemonize
Puppet agent is started for the first time:
Puppet agent -- server = master.puppet.com -- no-daemonize -- verbose -- noop -- onetime
If no authentication is reported, run on the CA server (CA and puppet server are on the same stage ):
Puppet cert -- list displays unauthenticated clients
Puppet cert -- sign agent.puppet.com
If the restart command runs normally again, the service is enabled separately.
/Etc/init. d/puppetmaster start
Chkconfig puppetmaster on
/Etc/init. d/puppet start
Chkconfig puppet on
Puppet Learning Series:
Puppet Learning 1: Installation and simple instance applications
Puppet 2: simple module configuration and application
Research on three Backup Recovery solutions for Puppet agent
Register your Puppet node in a safer way
Deep understanding of Puppet syntax and working mechanism through SSH Configuration
Puppet uses Nginx multiple ports for Load Balancing
C/S mode instance of Puppet in CentOS (5 and 6)
For more information about Puppet, click here.
Puppet: click here
This article permanently updates the link address: