Puppet:IT基础设施自动化管理工具
参考文章:
https://yq.aliyun.com/articles/120228
http://www.51niux.com/?id=105
http://www.zsythink.net/archives/category/%E8%BF%90%E7%BB%B4%E7%9B%B8%E5%85%B3/puppet/
可以管理整个生命周期:
provisioning:自动化安装系统
configuration:配置
orchestration:编排 
reporting:报告
Puppet是C/S架构的,所以需要在client端安装agent,那么在安装agent之前,client是不受server端控制的,那么该如何在大量的client上安装agent呢?
可以在自动部署系统的时候直接把puppet的agent加入到系统中,当部署好的系统启动时,client会自动去查找server端。
master/agent
master:puppet server
agent:接受每一个master发来的指令,接受指令后完成操作,agent端拥有管控功能,几乎可以实现所有功能;
      所以只要将需要实现的功能扔到master端,master就会分发到agent端,agent就会实现大部分功能,所以puppet的中心在agent上;
   所以agent是真正执行相应管理操作的核心部件。但是agent只能管理单个节点,所以需要master协调、管理agent端;
   agent会周期性的去master端请求与自己相关的配置,并根据master端提供的配置,确保本地(agent)的配置符合master端的要求;
master和agent两端通过逻辑认证,就可以通信,agent在本地(即client端)拥有权限。
puppet的工作模式:
声明性、基于模型的配置语言: 定义:puppet的master端要指明每一个agent,为每个agent提供配置,管理员使用puppet配置语言定义基础配置信息
模拟:master端定义完配置信息,puppet的agent就会在本地模拟、此时运行,没有错误后再执行;
强制:强制当前节点与定义的目标状态保持一致;
报告:执行完成后,agent端通过puppet api将执行结果发送给接收者 Puppet是如何工作的: Configuration Language:配置语言
Transactional Layer:事务层,资源之间可能会有依赖关系
Resource Abstration Layer:资源抽象层
资源类型:例如用户、组、文件、服务、cron任务等等;
属性及状态 与 其实现方式是分离的:
期望状态: 
puppet的核心组件:资源
资源清单:manifests
资源清单及清单中的资源定义的所依赖文件、模板等数据按特定结构组织起即为"模板"
Puppet本地工作模式 Puppet的master\agent工作模式 站点清单是为一个主机所定义的清单,即一个站点相当于一个主机; 
清单主要是用来放资源的,
Puppet是如何工作的?
这里大致分为三个模块,紫色模块、黄色模块、蓝色模块
第一个主机用到了两个蓝色模块,说明这台主机用到了蓝色模块中的不同的资源资源清单
每一个agent到master端去请求与自己相关的配置的时候,将会将请求发送给master端,发送时还会报告自己的facter,master端收到报告后会查找此主机的名称,并找与主机名称相对应的站点清单文件,站点清单定义了这个主机需要的清单,master会把这些清单调出来进行编译,然后发给agent。
m
定义模块是为了代码重用的,模块可以理解为是清单的组合 学习puppet主要学习它的配置语言是如何使用的。puppet也可以在单机模式进行使用,即在agent上配置资源清单,直接在agent上执行

puppet的agent端安装配置

单机安装puppet时:

agent端需要安装puppet和facter,因为agent端链接master端需要报告自己的facter。

如果是C/S架构的话,master端则需要安装puppet-server,如果master端需要跟自己交互,也需要安装puppet

# yum list all | grep -i "puppet"   //查看epel源中收录的rpm包

https://yum.puppet.com/index_by_lastModified_reverse.html

yum.repos.d]# wget https://yum.puppet.com/puppet-release-el-7.noarch.rpm

yum.repos.d]# rpm -ivh puppet-release-el-.noarch.rpm
warning: puppet-release-el-.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID ef8d349f: NOKEY
Preparing... ################################# [%]
Updating / installing...
:puppet-release-1.0.-.el7 ################################# [%]

yum.repos.d]# yum install puppet

# rpm -ql puppet-agent

# puppet help   //查看命令的用法格式

Usage: puppet <subcommand> [options] <action> [options]

Available subcommands:

  agent             The puppet agent daemon
apply Apply Puppet manifests locally
ca Local Puppet Certificate Authority management.
catalog Compile, save, view, and convert catalogs.
cert Manage certificates and requests
certificate Provide access to the CA for certificate management.
certificate_request Manage certificate requests.
certificate_revocation_list Manage the list of revoked certificates.
config Interact with Puppet's settings.
describe Display help about resource types
device Manage remote network devices
doc Generate Puppet documentation and references
facts Retrieve and store facts.
file Retrieve and store files in a filebucket
filebucket Store and retrieve files in a filebucket
help Display Puppet help.
inspect Send an inspection report
instrumentation_data Manage instrumentation listener accumulated data.
instrumentation_listener Manage instrumentation listeners.
instrumentation_probe Manage instrumentation probes.
key Create, save, and remove certificate keys.
kick Remotely control puppet agent
man Display Puppet manual pages.
master The puppet master daemon
module Creates, installs and searches for modules on the Puppet Forge.
node View and manage node definitions.
parser Interact directly with the parser.
plugin Interact with the Puppet plugin system.
queue Deprecated queuing daemon for asynchronous storeconfigs
report Create, display, and submit reports.
resource The resource abstraction layer shell
resource_type View classes, defined resource types, and nodes from all manifests.
secret_agent Mimics puppet agent.
status View puppet server status. See 'puppet help <subcommand> <action>' for help on a specific subcommand action.
See 'puppet help <subcommand>' for help on a specific subcommand.
Puppet v3.6.2

# puppet describe -l

# puppet describe RESOURCE_TYPE

These are the types known to puppet:
augeas - Apply a change or an array of changes to the ...
computer - Computer object management using DirectorySer ...
cron - Installs and manages cron jobs
exec - Executes external commands
file - Manages files, including their content, owner ...
filebucket - A repository for storing and retrieving file ...
group - Manage groups
host - Installs and manages host entries
interface - This represents a router or switch interface
k5login - Manage the `.k5login` file for a user
macauthorization - Manage the Mac OS X authorization database
mailalias - .. no documentation ..
maillist - Manage email lists
mcx - MCX object management using DirectoryService ...
mount - Manages mounted filesystems, including puttin ...
nagios_command - The Nagios type command
nagios_contact - The Nagios type contact
nagios_contactgroup - The Nagios type contactgroup
nagios_host - The Nagios type host
nagios_hostdependency - The Nagios type hostdependency
nagios_hostescalation - The Nagios type hostescalation
nagios_hostextinfo - The Nagios type hostextinfo
nagios_hostgroup - The Nagios type hostgroup
nagios_service - The Nagios type service
nagios_servicedependency - The Nagios type servicedependency
nagios_serviceescalation - The Nagios type serviceescalation
nagios_serviceextinfo - The Nagios type serviceextinfo
nagios_servicegroup - The Nagios type servicegroup
nagios_timeperiod - The Nagios type timeperiod
notify - .. no documentation ..
package - Manage packages
resources - This is a metatype that can manage other reso ...
router - .. no documentation ..
schedule - Define schedules for Puppet
scheduled_task - Installs and manages Windows Scheduled Tasks
selboolean - Manages SELinux booleans on systems with SELi ...
selmodule - Manages loading and unloading of SELinux poli ...
service - Manage running services
ssh_authorized_key - Manages SSH authorized keys
sshkey - Installs and manages ssh host keys
stage - A resource type for creating new run stages
tidy - Remove unwanted files based on specific crite ...
user - Manage users
vlan - .. no documentation ..
whit - Whits are internal artifacts of Puppet's curr ...
yumrepo - The client-side description of a yum reposito ...
zfs - Manage zfs
zone - Manages Solaris zones
zpool - Manage zpools

1、puppet基础的更多相关文章

  1. Puppet基础应用

    Puppet简介 IT基础设施自动化管理工具,作者:Luck Kanies,官方站点:www.puppetlabs.com 管理设施的整个生命周期: provisioning.configuratio ...

  2. Puppet基础

    基础架构图介绍 自动化运维框架:  自动化监控: puppet介绍 常用的批量工具介绍: OS Provisioning:PXE,Cobbler OS Configuration:ansible,pu ...

  3. 自动化运维工具之Puppet基础入门

    一.简介 puppet是什么?它能做什么? puppet是一个IT基础设施自动化运维工具,它能够帮助系统管理员管理基础设施的整个生命周期:比如,安装服务,提供配置文件,启动服务等等一系列操作:基于pu ...

  4. Advanced Puppet 系列的前言

    什么是Advanced 在网络上,你能找到大量关于Puppet的安装,配置以及基础用法的文章和博客.你在通过一段时间的实战后,熟练掌握了Puppet基础用法,随着你管理的集群日益扩大,你的部署逻辑越来 ...

  5. puppet一个完整的实例

    一个具体实例来简单说明puppet的具体结构 创建第一个配置 puppet的组成清单这主要包含这几个部分 资源,文件,模板,节点,类,定义 puppet中有个模块的定义,这个比较重要,基本是puppe ...

  6. ansible puppet saltstack三款自动化运维工具的对比

    一.基础介绍 ansible基础介绍可参考:http://www.linuxidc.com/Linux/2017-12/149671.htm puppet基础介绍可参考:http://www.linu ...

  7. ansible超详细使用指南

    在工作中有用到ansible用于自动部署和环境配置,这里整理了一份很详尽的使用指南,如果有用到的可以看看.关于使用ansible自动部署一个网站和docker化,将在下一篇文章中介绍,敬请期待.文章内 ...

  8. DveOps路线指南

    学习DevOps所需的技能 1. 编程语言 python  java javascrit 2. 学习不同的操作系统概念 进程管理,线程和兵法,套接字,I/O管理,虚拟化,内存储存储和文件系统. 3. ...

  9. [翻译]用 Puppet 搭建易管理的服务器基础架构(4)

    我通过伯乐在线翻译了一个Puppet简明教程,一共分为四部分,这是第四部分. 原文地址:http://blog.jobbole.com/89214/ 本文由 伯乐在线 - Wing 翻译,黄利民 校稿 ...

随机推荐

  1. goquery 解析不了noscript

    今天在用goquery的时候 解析noscript标签的时候.发现一直获取不到里面的元素. google得到.需要去除noscript标签. s.Find("noscript"). ...

  2. QTP(16)

    一.QTP项目(ECShop) 1.ECShop是一个开源免费的一个B2C的电子商务系统,主要用于商家和顾客进行商品交易操作. 2.ECShop分为前台和后台两个子系统: (1)ECShop前台:顾客 ...

  3. 【BZOJ 3514】Codechef MARCH14 GERALD07 加强版

    题意 \(n\) 个点 \(m\) 条边的无向图,\(k\) 次询问保留图中编号在 \([l,r]\) 的边的时候图中的联通块个数.强制在线. \(n,m,k\le 2\times 10^5\) 题解 ...

  4. 解决Android无法正常https://dl.google.com/dl/android/maven2/com/的办法

    最近需要进行移动开发,在安装Android Studio时,遇到了很纠结的问题,安装一直很不顺利.经过2天的百度搜索终于是找到解决的办法. 问题花了2天的时间才从茫茫大海中找到确切的答案.所以必须开个 ...

  5. hive中的 lateral view

    lateral view用于和split, explode等UDTF一起使用,它能够将一列数据拆成多行数据,在此基础上可以对拆分后的数据进行聚合. 一个简单的例子,假设我们有一张表pageAds,它有 ...

  6. 点双联通分量(BCC)的正确姿势

    Tarjan求点双连通分量 - 李昊哲

  7. jq load()方法实现html 模块化。

    在我们写项目的时候,会遇到一个模块在多个页面使用,如果没有页面都写一次,那就太费劲了. 如果你使用了框架(vue,react,Angular)的话,那框架都有模块化,可以轻松解决. 如果你使用原生开发 ...

  8. js 密码为空显示错误

    <script> var user = document.getElementById("user"); var pwd = document.getElementBy ...

  9. 【Python之路】特别篇--RabbitMQ

    RabbitMQ 解释RabbitMQ,就不得不提到AMQP(Advanced Message Queuing Protocol)协议. AMQP协议是一种基于网络的消息传输协议,它能够在应用或组织之 ...

  10. Sogou for Linux

    造冰箱的大熊猫,本文适用于Ubuntu 18.04@cnblogs 2019/5/8 在Ubuntu(安装时选择英文语言环境)下安装搜狗输入法 1)从搜狗官网下载sogou拼音输入法的deb安装包. ...