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. linux基础—课堂随笔010_系统启动和内核管理

    系统启动和内核管理 Linux: kernel+rootfs kernel: 进程管理.内存管理.网络管理.驱动程序.文件系统.安全功能 rootfs:程序和glibc 库:函数集合, functio ...

  2. LoadRunner(1)

    性能测试:HP LoadRunner11 一.初步概念: 1.功能测试:测试产品的功能是否满足功能需求. 如:ATM取款(在线取款)是否成功或转账操作是否成功 -- 一个用户 2.性能测试:测试产品的 ...

  3. js抽奖,跑马灯

    分享自己写的跑马灯抽奖. HTML代码 <!--首先将一个div的背景设为一个圆形--> <div style=" width:240px; height:232px; b ...

  4. python和ruby:一些需要注意的小区别。

    python和ruby的一些区别 基础区别 运算符号/和// ruby只有/符号.它根据操作的数字类型返回对应的结果.如果数字的类型是int,则返回整除结构,如果是float,则返回float类型的计 ...

  5. HTTPClick调用WebApi帮助类

    1.创建ApiHelper类 2.复制以下代码到类中 using System; using System.Collections.Generic; using System.Linq; using ...

  6. JQuery 中each的使用方法

    JQuery中的each函数在1.3.2的官方文档中的描述如下: each(callback) 以每一个匹配的元素作为上下文来执行一个函数. 意味着,每次执行传递进来的函数时,函数中的this关键字都 ...

  7. hive优化方式总结

    1. 多表join优化代码结构: select .. from JOINTABLES (A,B,C) WITH KEYS (A.key, B.key, C.key) where .... 关联条件相同 ...

  8. (转载) Consul 使用手册(感觉比较全了)

    使用consul 介绍 Consul包含多个组件,但是作为一个整体,为你的基础设施提供服务发现和服务配置的工具.他提供以下关键特性: 服务发现 Consul的客户端可用提供一个服务,比如 api 或者 ...

  9. pro git 读书笔记 3 Git 分支

    分支 新建分支:git branch 分支名 切换到该分支:git checkout 分支名 补充:以上两条语句等价于一句:git checkout -b 分支名 转换分支的时候最好保持一个清洁的工作 ...

  10. [Python之路] 实现简单Web服务器(TCP3次握手4次挥手解释)

    一.如何使用Python实现一个返回固定页面的Web Server 1.使用socket创建一个TCP Server 2.接受来自浏览器的TCP链接,并接收HTTP请求 3.返回固定响应数据给浏览器 ...