puppet安装以及遇到的问题
puppet安装及使用
puppet是一种Linux、Unix、windows平台的集中配置管理系统,使用自有的puppet描述语言,可管理配置文件、用户、cron任务、软件包、系统服务等。
puppet把这些系统实体称之为资源,puppet的设计目标是简化对这些资源的管理以及妥善处理资源间的依赖关系。
puppet采用C/S星状的结构,所有的客户端和一个或几个服务器交互。
每个客户端周期的(默认半个小时)向服务器发送请求,获得其最新的配置信息,保证和该配置信息同步。
每个puppet客户端每半小时(可以设置)连接一次服务器端, 下载最新的配置文件,并且严格按照配置文件来配置服务器. 配置完成以后,puppet客户端可以反馈给服务器端一个消息. 如果出错,也会给服务器端反馈一个消息.第二,工作原理:puppet既可以在单机上使用,也可以以c/s结构使用.在大规模使用puppet的情况下,通常使用c/s结构.在这种结构中puppet客户端只是指运行puppet的服务器,puppet服务器端是只运行puppetmaster的服务器.puppet客户端首先会连接到puppet服务器端,并且通过facter工具把客户端的基本配置信息发送给服务器端. 服务器端通过分析客户端的主机名,通过node 定义,找到该主机的配置代码,然后编译配置代码,把编译好的配置代码发回客户端,客户端执行代码完成配置.并且把代码执行情况反馈给puppet服务器端.修改系统配置puppet 通过管理资源的方式来管理系统, 例如管理某个软件是否要安装,是安装最新的还是安装了就行. 管理某个服务是否开启, 管理某个文件的属性,内容等等. 所有的资源都有对应的几个属性可以设置. 通过设置属性的方式来管理资源. 有一种特殊的属性可以用在所有的资源上面,这种属性叫做metaparams ( 元参数或者元属性).1) 客户端通过facter收集客户端信息并发送至服务端2) 连接服务端并请求catalog日志3) 请求节点(node)的信息4) 从服务器端接收节点(node)的实例5) 编译代码(包括语法检查等工作)6) 查询是否有exported 虚拟资源7) 如有,则从数据库接收虚拟资源8) 接收完整的catalog日志9) 存储catalog日志到数据库10) 客户端接收完整的catalog日志第三,案例目标:实现文件同步并修改文件所属帐户:测试环境:puppetserver : 10.0.3.170puppet1 : 10.0.3.171第四,安装配置:两台机器都需要安装必要软件:yum install ntp vixie-cron vim-enhanced telnet软件的下载地址:facter:/facter/facter-1.6.17.tar.gz]http://d /facter/facter-1.6.17.tar.gzfacter是一个系统盘点工具,收集主机的一些资料,比如CPU,主机IP等,它收集到值发送给puppet服务器端,服务器端就可以根据不同的条件来对不同的节点机器生成不同的puppet配置文件,安装puppet之前必须先安装facter。
puppet安装配置
puppet安装配置puppet是一款开源自动化部署工具,下面介绍puppet安装和配置。
1、操作系统:redhat5.3 (64位系统)2、系统架构:192.168.0.200 服务器192.168.0.201 客户端192.168.0.202 客户端3、安装ruby.(安装puppet先决条件服务端和客户端都要安装)#rpm –Uvh/pub/epel/5/x86_64/epel-release-5-4.noarch.r pm#yum -y install mysql* ruby-mysql ruby ruby-devel ruby-irb ruby-rdoc ruby-ri安装ruby 1.8.2以上版本,但不要安装1.87以上版本。
还不支持。
4、服务端安装(1)安装Facter 用来获取客户端系统信息(如hostname,ip,OS-version,fqdn 等)采用源码安装#cd /usr/local/src#wget /downloads/facter/facter-latest.tgz下载最新稳定版facter#tar -xvzf facter-latest.tgz#cd facter-latest#ruby install.rb 安装#cd ../(2)安装puppet#wget /downloads/puppet/puppet-latest.tgz下载最新稳定版puppet。
#cd puppet-*#ruby install.rb安装#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/server.init /etc/init.d/puppetmaster#chmod +x /etc/init.d/puppetmaster5、客户端安装和服务端安装方法一样。
Puppet部署
Puppet部署1.Puppet服务器端部署Puppet服务器端可以安装于常见的Linux发行版本中,本例操作系统为CentOS5.564位。
主机名设置为Puppet的安装方式支持源码安装、yum和ruby的gem包安装,CentOS可以直接使用yum来安装,CentOS的默认源中没有puppet,需要先安装EPEL包。
Tips:什么是EPELEPEL(/wiki/EPEL)是由Fedora社区打造,为RHEL及衍生发行版如CentOS、Scientific Linux等提供高质量软件包的项目。
安装过程如下:2.Puppet客户端安装Puppet服务器端对客户端的管理是基于主机名的,所以在安装之前需要为客户端设置唯一的主机名,主机名命令最好能体现出主机的机房、业务系统名称及IP信息。
客户端安装的过程如下:3.证书分发Puppet客户端与服务器端是通过SSL隧道通信的,客户端安装完成后,需要向服务器端申请证书:3.1客户端首次连接服务器端发起证书申请:客户端如出现以下错误,请检查puppet服务器端和客户端的/etc/hosts文件是否有设置彼此3.2服务器端查看申请证书的客户端3.3服务器端为特定的主机颁发证书3.4客户端运行3.5服务器端撤销和清除证书3.6执行3.5操作后请务必重启puppetmaster3.7D ebug调试4.P uppet目录结构安装目录默认为/etc/puppet,该目录下的manifests存放manifest文件5.P uppet使用简介5.1文件分发5.2文件执行5.3自动同步5.4强制同步(服务器端发起)编辑服务器端和客户端文件/etc/puppet/namespaceauth.conf5.5crontab管理参考:/category/puppet/projects/1/wiki/Certificates_And_Security /guides/language_guide.html/system/linux/puppet-man.html/p/puppet-manifest-share/downloads/list/s/blog_505fbe360100y79s.html/tag/puppetrun//cluster-managemant/puppet/注:。
Puppet 运维自动化
Puppet 运维自动化随着互联网行业发展,运维工程师(ops/devops)的职位也变的越来越具挑战性,作为一个运维工程师要照顾到从硬件到软件,从基础架构到应用层业务的方方面面。
日常运维工作纷繁复杂,占用了大量工作时间,大量重复性劳动严重打击运维工程师的积极性,而且极易出错。
如何实现对日常工作的自动化变的越来越迫在眉睫。
本课程主要讲解自动化配置管理软件Puppet及其相关的组件,希望能帮助陷于沉重日常重复劳动的运维工程师们解放出来,把精力在更有价值,更有挑战的工作上面。
课程大纲:第一课:Puppet 入门介绍目前存在多个不同的配置管理软件,各有优劣,本届课程做简要介绍对比,讲解puppet基本原理和入门知识。
课程内容:运维自动化软件简要介绍和对比Puppet安装(master/agent,standalone模式),升级,主要配置选项简要介绍,支持系统和平台,Ruby环境依赖(RVM简要介绍)。
基本工作原理,编译和catalogs。
核心配置文件。
puppet的第一个基本配置文件。
第二课:Puppet基本命令和语法puppet实现了自己的DSL,本节课讲解puppet的语法。
课程内容:puppet基本命令语法风格。
保留关键字,命名规范变量(作用域),数据类型表达式,条件语句functions(函数/方法)检查puppet配置的命令。
第三课:资源和资源类型puppet的资源是整个puppet配置最为核心的地方,puppet对整个系统的管理主要依赖于资源实现。
本节课程讲解puppet资源和资源类型。
课程内容:介绍RAL(Puppet’s resource abstraction layer),types和providers。
讲解puppet资源和资源类型,核心资源类型。
获取当前系统的存在资源和资源类型,manifest,并创建自己的puppet资源配置文件。
资源顺序 ordering(元参数,order关键字, stage,auto-order)。
Puppet系统安装运维手册
Puppet系统安装运维手册1安装配置 (1)1.1版本信息 (1)1.2服务器安装 (1)1.2.1锁定YUM安装版本(如果需要安装旧版) (1)1.2.2安装配置Puppet-server (1)1.2.3安装Foreman (2)1.3客户端安装 (5)2管理服务 (9)2.1Puppet-Server (9)2.2Foreman (9)2.3Foreman-Proxy (9)3修改记录 (10)1安装配置1.1版本信息操作系统:CentOS5.X 64bit1.2服务器安装1.2.1锁定YUM安装版本(如果需要安装旧版)1.2.1.1安装yum-versionlock1.2.2安装配置Puppet-server1.2.2.1安装1.2.3 安装Foreman 1.2.3.1 安装Mysql-Server1.2.3.3安装foremanvi /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb初始化admin口令安装foreman-proxy1.2.3.4登录foreman,右侧more→Smart-Proxies菜单中新增proxy,name:puppet-master主机名url:http:// puppet-master:84431.3客户端安装1.3.1Puppet-clinet客户端安装双击ruby186-27_rc2.exe进行ruby的安装配置puppet.conf ,将里面的内容替换为Labs\Puppet\bin 目录下。
上面的命令。
在运行链接时报下面的错误,这种情况是由于前面已经签名过,进行第二次的签名。
添加随机启动文件runpuppet.bat 到:C:\Program Files\Puppet Labs\Puppet\bin ,并将该文件添加到系统计划任务中,设置为随系统启动执行。
Puppet client 文件以及脚本列表Labs\Puppet\facter\lib\facter文件目录下面的XSpeed建库_v1.0.0.1.bat改名为XspeedSqlUpdate.bat(这是因为puppet不识别中文)2管理服务2.1Puppet-Server2.2Foreman2.3Foreman-Proxy第10页 3 修改记录。
Windows下Node爬虫神器Puppeteer安装记
Windows下Node爬⾍神器Puppeteer安装记对于爬⾍,相信⼤家并不陌⽣。
当希望得到⼀些⽹站的数据并做⼀些有趣的事时,必不可少要爬取⽹页,⽤到爬⾍。
⽽⽬前⽹络上也有很多爬⾍的教程资料,不过⼜尤以python语⾔居多。
想来⾃⼰是做web的,就希望以js的⽅式解决问题,于是希望利⽤nodejs。
今天介绍⼀款node的爬⾍利器:。
Puppeteer正如其名“⽊偶”,它允许我们像牵线⽊偶⼀样操纵它。
它是⼀个建⽴在上的提供控制⽆头Chrome或Chromium的⾼级接⼝的Node库。
官⽹上对其应⽤举了⼏个例⼦:- ⽣成⽹页的截屏(⽬前仅⽀持⽀持jpeg、png格式)和pdf⽂件- 爬取SPA和异步渲染⽹页- ⾃动表单提交、键盘输⼊、UI测试等- 创建最新的⾃动测试环境,也就是说可以使⽤最新的浏览器特性- 捕获站点的时间线以帮助分析性能问题Puppeteer本质上是⼀个headless chrome。
⽆头浏览器,相信如果⼤家做爬⾍肯定有所⽿闻。
其实就是⼀个没有UI界⾯的浏览器,它包含了浏览器应该具有的功能,通常做web测试⽤,不过做爬⾍也是没问题的。
就提供这样的功能,基于webkit内核,已经有好⼏年历史了。
不过因为Puppeteer有背景(⾕歌Chrome团队开发),我最后还是选择了Puppeteer。
它们之间的不同点是后者只关注于Chromium或Chrome。
这也导致了最坑的⼀点是总是绑定最新版本的Chromium。
上⾯说到Puppeteer会绑定最新版本的Chromium,这意味着每次使⽤npm i puppeteer安装使⽤它时都会下载最新版本的Chromium,该版本在Windows上⼤约是130Mb。
本来下载npm包就很不易,还要下载⼀个⼀百多兆的东西更是难上加难了。
当然可以使⽤cnpm,下图是我下载的⼀个界⾯。
可以看到下载了55分钟,这固然有我⽹络慢的问题,但是能不下载Chromium就尽量不下载了吧。
puppet安装文档
Puppet安装文档一.什么是puppet?puppet是一个开源的新一代集中化配置管理工具,它由自己所声明的语言表达系统配置,通过客户端与服务端之间的连接,维护着关系库。
可管理配置文件、用户、Cron、软件包、系统服务等,puppet把这些统称为“资源”。
Puppet的设计目标就是简化对这些资源的管理以及妥善处理资源之间的依赖关系。
二.Puppet组织结构|--Auth.conf #ACL权限控制文件|--Fileserver.conf #文件服务配置文件|--Manifests #节点存储目录(puppet会首先加载site.pp)| --Site.pp #定义puppet变量及默认配置|--Modules #模块目录| --Nginx #以Nginx为例| |--Manifests| --Init.pp #模块主配置文件,定义class相关信息。
读取模块后先读取它| |--Templates| --Nginx.conf.erb #模板配置文件(erb为主)|--Namespaceauth.conf #命名空间配置文件(配置权限)|--Puppet.conf #puppet主配置文件|--tagmail.conf #邮件报告配置文件三.Puppet安装与配置1.设置主机名,域名解析或指定hosts文件将服务端、客户端的域名--IP地址写入hosts文件#服务器端hosts文件#192.168.30.211 puppet-server2.puppet需Ruby支持yum -y install ruby ruby-libs ruby-shadow3.安装facter puppet puppet-server#Centos 5.XWget /puppetlabs-release-el-5.noarch.rpmrpm -ivh puppetlabs-release-el-5.noarch.rpm#Centos 6.Xwget /puppetlabs-release-el-6.noarch.rpmrpm -ivh puppetlabs-release-el-6.noarch.rpmyum clean all#服务端安装yum -y install facter puppet-server#客户端安装yum -y install puppet facter(客户端安装)4.启动puppet/etc/init.d puppetmaster start或/etc/init.d/puppet start(客户端启动)5.检查安装版本:Ruby -vPuppet -VFacter -v6.配置puppet#服务端a)Vi /etc/puppet/puppet.conf #添加一行服务端主机名[master]server = certname = #客户端b) 客户端向服务端请求证书Vi /etc/puppet/puppet.conf #添加一行服务端主机名#server = c)#客户端Puppet agent --test #客户端执行,请求证书签名认证#服务端对客户端证书签名:Puppet cert --list #查看所有客户端请求证书签名Puppet cert sign agent.pip.co #同意单个客户端证书签名请求puppet cert sign --all #同意所有客户端证书签名请求四.各类资源常用属性参数:1.文件资源a)Ensure:默认为目录或文件,需声明,值可以为absent(删除),文件file,目录directory,文件present(检查文件是否存在,不存在则创建)b)Content:文件内容,与source和target属性互斥c)Force:强制删除文件、软链接及目录d)Owner:用户名及用户IDe)Group:指定该文件的用户组,可以是组名或Gidf)Link:软链接g)Mode:文件权限配置h)Path:文件路径,必须用双引号i)Targe:当文件类型为link时,需使用target指定目标文件j)Type:只读状态检查文件类型2.用户资源a)Ensure:默认属性,指定用户是否存在,创建用户使用present,删除用户使用absentb)Allowupe:是否允许使用同一uid,值为true or falsec)Comment:对用户的描述d)Expiry:过期时间e)Gid:该用户的用户组gid,可以是数字及组名f)Groups:指定该用户属于哪些组,有多个组建议使用数组,如[ …g1‟,‟g2‟ ]g)Home:用户家目录h)Shell:登陆时指定登陆Shell,不支持windowsi)Uid:指定用户uid,不指定则自动选择j)Password:指定用户密码,填写已使用sha1加密过的字符串,一般复制/etc/shadow 文件中用户对应的密码k)Managehome:是否创建用户家目录,值为true or false3.用户组资源a)Ensure:默认属性,创建present,删除absentb)Name:组名c)Allowupe:是否允许使用同一gidd)Gid:用户组gid,不指定则自动选择e)Members:用户组成员4.服务管理a)Ensure:服务状态,运行为true,停止为falseb)Enable:是否设置为开机启动,值为true或falsec)Hasrestart:指出管理脚本是否支持restart参数,如不支持则使用stop/start实现restart效果,值为true或falsed)Hasstatus:指出管理脚本是否支持status参数,值为true或falsee)Name:服务名称f)Path:指定查找init脚本的路径g)Restart:重启命令,可指定h)Start:启动命令,可指定i)Status:状态命令,可指定j)Stop:停止命令,可指定5.执行命令a)Command:执行的命令,必须是完整合法的命令b)Creates:指定命令生成文件,只会在所指定的文件不存在的情况下才执行c)Cwd:指定命令执行的当前目录,如不存在则执行失败d)Path:执行命令的搜索路径e)Group:运行命令的组f)Onlyif:参数中设置的命令返回0才执行g)Refreshonly:该参数可以使命令变成仅刷新触发h)Tires:命令尝试执行次数i)Timeout:命令执行超时时间j)Unless:结束代码k)User:执行命令的用户6.软件资源a)Ensure:设置软件包安装状态。
puppet master client 安装
Puppet3.1Master Client安装测试一,测试环境Master端#uname -aLinux 2.6.32-279.22.1.el6.centos.plus.x86_64 #1 SMP Wed Feb 6 05:16:56 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux#cat /etc/redhat-releaseCentOS release 6.3 (Final)]#cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.234.135 master 192.168.234.134 client #cat /etc/resolv.conf# Generated by NetworkManagerdomain localdomainsearch nameserver 192.168.234.2client端# uname -aLinux 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux# cat /etc/redhat-releaseCentOS release 5.8 (Final)[root@client C]# cat /etc/hosts127.0.0.1 localhost.localdomain localhost::1 localhost6.localdomain6 localhost6192.168.234.134 client 192.168.234.135 master # cat /etc/resolv.conf; generated by /sbin/dhclient-scriptsearch nameserver 192.168.234.2二,Master端安装1,下载安装puppet.repo安装包#wget /el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm、#ls /etc/yum.repos.d/puppetlabs.repo/etc/yum.repos.d/puppetlabs.repo18:12:07 root@master (~) [335]#cat /etc/yum.repos.d/puppetlabs.repo[puppetlabs-products]name=Puppet Labs Products El 6 - $basearchbaseurl=/el/6/products/$basearchgpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsenabled=1gpgcheck=1[puppetlabs-deps]name=Puppet Labs Dependencies El 6 - $basearchbaseurl=/el/6/dependencies/$basearchgpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsenabled=1gpgcheck=1[puppetlabs-devel]name=Puppet Labs Devel El 6 - $basearchbaseurl=/el/6/devel/$basearchgpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsenabled=0gpgcheck=1[puppetlabs-products-source]name=Puppet Labs Products El 6 - $basearch - Sourcebaseurl=/el/6/products/SRPMSgpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsfailovermethod=priorityenabled=0gpgcheck=1[puppetlabs-deps-source]name=Puppet Labs Source Dependencies El 6 - $basearch - Sourcebaseurl=/el/6/dependencies/SRPMSgpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsenabled=0gpgcheck=1[puppetlabs-devel-source]name=Puppet Labs Devel El 6 - $basearch - Sourcebaseurl=/el/6/devel/SRPMSgpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsenabled=0gpgcheck=12,在master 上安装和启用puppet 服务:由于软件自身依赖关系会自动安装ruby,facter 等软件# yum install puppet-server# chkconfig puppetmaster on# service puppetmaster startStarting puppetmaster: [ O K ]三,Client端安装由于clietn端是CentOS5.8所以puppet.repo源要改变下,改成5的1,下载安装puppet.repo安装包#wget /el/5/products/x86_64/puppetlabs-release-5-7.noarch.rpm#yum –y install puppetlabs-release-5.7.noarch.rpm安装报错error: rpmts_HdrFromFdno: Header V4 RSA/SHA1 signature: BAD, key ID 4bd6ec30报错解决方法# gpg --recv-key 4bd6ec30gpg: requesting key 4BD6EC30 from hkp server gpg: /root/.gnupg/trustdb.gpg: trustdb createdgpg: key 4BD6EC30: public key "Puppet Labs Release Key (Puppet Labs Release Key) <info@>" importedgpg: no ultimately trusted keys foundgpg: Total number processed: 1gpg: imported: 1 (RSA: 1)# gpg -a --export 4bd6ec30 >/opt/key.txt# cat /opt/key.txt-----BEGIN PGP PUBLIC KEY BLOCK-----Version: GnuPG v1.4.5 (GNU/Linux)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i8vT-----END PGP PUBLIC KEY BLOCK-----# rpm --import /opt/key.txt# yum -y install puppetlabs-release-5-7.noarch.rpmLoaded plugins: aliases, allowdowngrade, changelog, downloadonly, fastestmirror, filter- : data, kernel-module, keys, kmod, list-data, merge-conf, priorities,: protect-packages, protectbase, refresh-updatesd, security, tmprepo,: tsflags, upgrade-helper, verify, versionlockLoading mirror speeds from cached hostfile* Base: Skipping filters plugin, no data0 packages excluded due to repository protectionsReading version lock configurationSetting up Install ProcessExamining puppetlabs-release-5-7.noarch.rpm: puppetlabs-release-5-7.noarchMarking puppetlabs-release-5-7.noarch.rpm to be installedResolving DependenciesSkipping filters plugin, no data--> Running transaction check---> Package puppetlabs-release.noarch 0:5-7 set to be updated--> Finished Dependency ResolutionDependencies Resolved=============================================================================== =========Package Arch Version Repository Size=============================================================================== =========Installing:puppetlabs-release noarch 5-7 /puppetlabs-release-5-7.noarch 2.9 kTransaction Summary=============================================================================== =========Install 1 Package(s)Upgrade 0 Package(s)Total size: 2.9 kDownloading Packages:Running rpm_check_debugRunning Transaction TestFinished Transaction TestTransaction Test SucceededRunning TransactionInstalling : puppetlabs-release 1/1Installed:puppetlabs-release.noarch 0:5-7Complete!2,安装puppet[root@client ~]# yum install puppetLoaded plugins: aliases, allowdowngrade, changelog, downloadonly, fastestmirror, filter- : data, kernel-module, keys, kmod, list-data, merge-conf, priorities,: protect-packages, protectbase, refresh-updatesd, security, tmprepo,: tsflags, upgrade-helper, verify, versionlockLoading mirror speeds from cached hostfile* Base: Skipping filters plugin, no data0 packages excluded due to repository protectionsReading version lock configurationSetting up Install ProcessResolving DependenciesSkipping filters plugin, no data--> Running transaction check---> Package puppet.noarch 0:3.1.1-1.el5 set to be updated--> Processing Dependency: ruby(abi) >= 1.8 for package: puppet--> Processing Dependency: ruby >= 1.8.7 for package: puppet--> Processing Dependency: facter >= 1.6.11 for package: puppet--> Processing Dependency: hiera >= 1.0.0 for package: puppet--> Processing Dependency: ruby-augeas for package: puppet--> Processing Dependency: libselinux-ruby for package: puppet--> Processing Dependency: ruby-shadow for package: puppet--> Processing Dependency: /usr/bin/ruby for package: puppet--> Running transaction check---> Package facter.x86_64 1:1.7.0-1.el5 set to be updated---> Package hiera.noarch 0:1.2.1-1.el5 set to be updated--> Processing Dependency: rubygem-json for package: hiera---> Package libselinux-ruby.x86_64 0:1.33.4-5.7.el5 set to be updated---> Package ruby.x86_64 0:1.8.7.370-1.el5 set to be updated---> Package ruby-augeas.x86_64 0:0.4.1-1 set to be updated--> Processing Dependency: augeas-libs >= 0.8.0 for package: ruby-augeas--> Processing Dependency: libaugeas.so.0(AUGEAS_0.8.0)(64bit) for package: ruby-augeas --> Processing Dependency: libaugeas.so.0(AUGEAS_0.11.0)(64bit) for package: ruby-augeas --> Processing Dependency: libaugeas.so.0(AUGEAS_0.10.0)(64bit) for package: ruby-augeas --> Processing Dependency: libaugeas.so.0(AUGEAS_0.1.0)(64bit) for package: ruby-augeas --> Processing Dependency: libaugeas.so.0(AUGEAS_0.12.0)(64bit) for package: ruby-augeas --> Processing Dependency: libaugeas.so.0()(64bit) for package: ruby-augeas---> Package ruby-libs.x86_64 0:1.8.7.370-1.el5 set to be updated---> Package ruby-shadow.x86_64 0:1.4.1-7 set to be updated--> Running transaction check---> Package augeas-libs.x86_64 0:0.10.0-3 set to be updated---> Package rubygem-json.x86_64 0:1.5.5-1.el5 set to be updated--> Processing Dependency: rubygems for package: rubygem-json--> Running transaction check---> Package rubygems.noarch 0:1.3.7-1.el5 set to be updated--> Processing Dependency: ruby-rdoc for package: rubygems--> Running transaction check---> Package ruby-rdoc.x86_64 0:1.8.7.370-1.el5 set to be updated--> Processing Dependency: irb = 1.8.7.370-1.el5 for package: ruby-rdoc--> Running transaction check---> Package ruby-irb.x86_64 0:1.8.7.370-1.el5 set to be updated--> Finished Dependency ResolutionDependencies Resolved=============================================================================== =========Package Arch Version Repository Size=============================================================================== =========Installing:puppet noarch 3.1.1-1.el5 puppetlabs-products 959 kInstalling for dependencies:augeas-libs x86_64 0.10.0-3 puppetlabs-deps 376 kfacter x86_64 1:1.7.0-1.el5 puppetlabs-products 84 khiera noarch 1.2.1-1.el5 puppetlabs-products 20 klibselinux-ruby x86_64 1.33.4-5.7.el5 Base 61 kruby x86_64 1.8.7.370-1.el5 puppetlabs-deps 378 kruby-augeas x86_64 0.4.1-1 puppetlabs-deps 22 kruby-irb x86_64 1.8.7.370-1.el5 puppetlabs-deps 343 kruby-libs x86_64 1.8.7.370-1.el5 puppetlabs-deps 2.2 Mruby-rdoc x86_64 1.8.7.370-1.el5 puppetlabs-deps 410 kruby-shadow x86_64 1.4.1-7 puppetlabs-deps 10 krubygem-json x86_64 1.5.5-1.el5 puppetlabs-depsrubygems noarch 1.3.7-1.el5 puppetlabs-deps 217 kTransaction Summary=============================================================================== =========Install 13 Package(s)Upgrade 0 Package(s)Total download size: 5.7 MIs this ok [y/N]: yDownloading Packages:(1/13): ruby-shadow-1.4.1-7.x86_64.rpm | 10 kB 00:00 (2/13): hiera-1.2.1-1.el5.noarch.rpm | 20 kB 00:00 (3/13): ruby-augeas-0.4.1-1.x86_64.rpm | 22 kB 00:00 (4/13): libselinux-ruby-1.33.4-5.7.el5.x86_64.rpm | 61 kB 00:00(5/13): facter-1.7.0-1.el5.x86_64.rpm | 84 kB 00:00(6/13): rubygems-1.3.7-1.el5.noarch.rpm | 217 kB 00:02 (7/13): ruby-irb-1.8.7.370-1.el5.x86_64.rpm | 343 kB 00:05(8/13): augeas-libs-0.10.0-3.x86_64.rpm | 376 kB 00:10(9/13): ruby-1.8.7.370-1.el5.x86_64.rpm | 378 kB 00:04(10/13): ruby-rdoc-1.8.7.370-1.el5.x86_64.rpm | 410 kB 00:04(11/13): rubygem-json-1.5.5-1.el5.x86_64.rpm | 773 kB 00:13(12/13): puppet-3.1.1-1.el5.noarch.rpm | 959 kB 00:12(13/13): ruby-libs-1.8.7.370-1.el5.x86_64.rpm | 2.2 MB 00:31----------------------------------------------------------------------------------------------------------------------------- Total57 kB/s | 5.7 MB 01:42Running rpm_check_debugRunning Transaction TestFinished Transaction TestTransaction Test SucceededRunning TransactionInstalling : ruby-libs 1/13Installing : rubyInstalling : ruby-shadow 3/13Installing : augeas-libs 4/13Installing : ruby-augeas 5/13Installing : libselinux-ruby 6/13Installing : ruby-irb 7/13Installing : ruby-rdoc 8/13Installing : rubygems 9/13Installing : rubygem-json 10/13Installing : hiera 11/13Installing : facter 12/13Installing : puppet 13/13Installed:puppet.noarch 0:3.1.1-1.el5Dependency Installed:augeas-libs.x86_64 0:0.10.0-3 facter.x86_64 1:1.7.0-1.el5 hiera.noarch 0:1.2.1-1.el5libselinux-ruby.x86_64 0:1.33.4-5.7.el5 ruby.x86_64 0:1.8.7.370-1.el5 ruby-augeas.x86_64 0:0.4.1-1ruby-irb.x86_64 0:1.8.7.370-1.el5 ruby-libs.x86_64 0:1.8.7.370-1.el5 ruby-rdoc.x86_64 0:1.8.7.370-1.el5ruby-shadow.x86_64 0:1.4.1-7 rubygem-json.x86_64 0:1.5.5-1.el5 rubygems.noarch 0:1.3.7-1.el5Complete!#service puppet startStarting puppet agent: [ OK ]#chkconfig puppet on四,Master,Client连接测试,我是一步步测试,根据出现问题再拍错然后解决1,客户端执行puppet agent -t --debug --server 其中-t 是—test 的缩写,--debug可以列出debug信息,--server接Master的FQDN名其他参数都不明白,故没有写上,可以看到在结尾处有错误信息,后面有排错方法# puppet agent -t --debug --server Debug: Using settings: adding file resource 'client_datadir': 'File[/var/lib/puppet/client_data]{:backup=>false, :loglevel=>:debug, :links=>:follow,:mode=>"750", :path=>"/var/lib/puppet/client_data", :ensure=>:directory}'Debug: Puppet::Type::User::ProviderPw: file pw does not existDebug: Failed to load library 'ldap' for feature 'ldap'Debug: Puppet::Type::User::ProviderLdap: feature ldap is missingDebug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dsimport does not existDebug: Puppet::Type::User::ProviderUser_role_add: file rolemod does not existDebug: Using settings: adding file resource 'hostpubkey': 'File[/var/lib/puppet/ssl/public_keys/.pem]{:backup=>false, :loglevel=>:debu g,:owner=>"puppet", :links=>:follow, :mode=>"644", :path=>"/var/lib/puppet/ssl/public_ keys/.pem", :ensure=>:file}'Debug: Using settings: adding file resource 'statedir': 'File[/var/lib/puppet/state]{:backup=>false, :loglevel=>:debug, :links=>:follow, :mode=>"175 5",:path=>"/var/lib/puppet/state", :ensure=>:directory}'Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppet]{:backup=>false, :loglevel=>:debug, :links=>:follow, :path=>"/etc/puppet",:ensure=>:directory}'Debug: Using settings: adding file resource 'publickeydir': 'File[/var/lib/puppet/ssl/public_keys]{:backup=>false, :loglevel=>:debug, :owner=>"puppet",:links=>:follow, :path=>"/var/lib/puppet/ssl/public_keys", :ensure=>:directory}'Debug: Using settings: adding file resource 'privatedir': 'File[/var/lib/puppet/ssl/private]{:backup=>false, :loglevel=>:debug, :owner=>"puppet",:links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/ssl/private", :ensure=>:director y}'Debug: Using settings: adding file resource 'plugindest': 'File[/var/lib/puppet/lib]{:backup=>false, :loglevel=>:debug, :links=>:follow,:path=>"/var/lib/puppet/lib", :ensure=>:directory}'Debug: Using settings: adding file resource 'clientbucketdir': 'File[/var/lib/puppet/clientbucket]{:backup=>false, :loglevel=>:debug, :links=>:follow,:mode=>"750", :path=>"/var/lib/puppet/clientbucket", :ensure=>:directory}'Debug: Using settings: adding file resource 'certdir': 'File[/var/lib/puppet/ssl/certs]{:backup=>false, :loglevel=>:debug, :owner=>"puppet", :links= >:follow,:path=>"/var/lib/puppet/ssl/certs", :ensure=>:directory}'Debug: Using settings: adding file resource 'graphdir': 'File[/var/lib/puppet/state/graphs]{:backup=>false, :loglevel=>:debug, :links=>:follow,:path=>"/var/lib/puppet/state/graphs", :ensure=>:directory}'Debug: Using settings: adding file resource 'vardir': 'File[/var/lib/puppet]{:backup=>false, :loglevel=>:debug, :links=>:follow, :path=>"/var/lib/pu ppet",:ensure=>:directory}'Debug: Using settings: adding file resource 'requestdir': 'File[/var/lib/puppet/ssl/certificate_requests]{:backup=>false, :loglevel=>:debug,:owner=>"puppet", :links=>:follow, :path=>"/var/lib/puppet/ssl/certificate_requests", : ensure=>:directory}'Debug: Using settings: adding file resource 'rundir': 'File[/var/run/puppet]{:backup=>false, :loglevel=>:debug, :links=>:follow, :mode=>"755",:path=>"/var/run/puppet", :ensure=>:directory}'Debug: Using settings: adding file resource 'clientyamldir': 'File[/var/lib/puppet/client_yaml]{:backup=>false, :loglevel=>:debug, :links=>:follow,:mode=>"750", :path=>"/var/lib/puppet/client_yaml", :ensure=>:directory}'Debug: Using settings: adding file resource 'hostprivkey': 'File[/var/lib/puppet/ssl/private_keys/.pem]{:backup=>false, :loglevel=>:deb ug,:owner=>"puppet", :links=>:follow, :mode=>"600", :path=>"/var/lib/puppet/ssl/private _keys/.pem", :ensure=>:file}'Debug: Puppet::Type::Group::ProviderPw: file pw does not existDebug: Failed to load library 'ldap' for feature 'ldap'Debug: Puppet::Type::Group::ProviderLdap: feature ldap is missingDebug: Puppet::Type::Group::ProviderDirectoryservice: file /usr/bin/dscl does not exist Debug: Using settings: adding file resource 'logdir': 'File[/var/log/puppet]{:backup=>false, :group=>"puppet", :loglevel=>:debug, :owner=>"pup pet",:links=>:follow, :mode=>"750", :path=>"/var/log/puppet", :ensure=>:directory}''File[/var/lib/puppet/ssl]{:backup=>false, :loglevel=>:debug, :owner=>"puppet", :links=>:foll ow,:mode=>"771", :path=>"/var/lib/puppet/ssl", :ensure=>:directory}'Debug: Using settings: adding file resource 'privatekeydir': 'File[/var/lib/puppet/ssl/private_keys]{:backup=>false, :loglevel=>:debug, :owner=>"puppet ",:links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/ssl/private_keys", :ensure=>:di rectory}'Debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl] Debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state] Debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring File[/var/lib/puppet/ssl]Debug: /File[/var/lib/puppet/ssl/private_keys/.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys]Debug: /File[/var/lib/puppet/ssl/public_keys/.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys]Debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl] Debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl]Debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/puppet/ssl]Debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/ssl/private_keys/.pem]/mode: mode changed '0640' to '0600'Debug: /File[/var/lib/puppet/ssl/public_keys/.pem]/mode: mode changed '0640' to '0644'Debug: Finishing transaction 23872078632760Debug: Using settings: adding file resource 'hostpubkey': 'File[/var/lib/puppet/ssl/public_keys/.pem]{:backup=>false, :loglevel=>:debu g,:owner=>"puppet", :links=>:follow, :mode=>"644", :path=>"/var/lib/puppet/ssl/public_ keys/.pem", :ensure=>:file}'Debug: Using settings: adding file resource 'statedir': 'File[/var/lib/puppet/state]{:backup=>false, :loglevel=>:debug, :links=>:follow, :mode=>"175 5",:path=>"/var/lib/puppet/state", :ensure=>:directory}''File[/etc/puppet]{:backup=>false, :loglevel=>:debug, :links=>:follow, :path=>"/etc/puppet",:ensure=>:directory}'Debug: Using settings: adding file resource 'publickeydir': 'File[/var/lib/puppet/ssl/public_keys]{:backup=>false, :loglevel=>:debug, :owner=>"puppet",:links=>:follow, :path=>"/var/lib/puppet/ssl/public_keys", :ensure=>:directory}'Debug: Using settings: adding file resource 'privatedir': 'File[/var/lib/puppet/ssl/private]{:backup=>false, :loglevel=>:debug, :owner=>"puppet",:links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/ssl/private", :ensure=>:director y}'Debug: Using settings: adding file resource 'plugindest': 'File[/var/lib/puppet/lib]{:backup=>false, :loglevel=>:debug, :links=>:follow,:path=>"/var/lib/puppet/lib", :ensure=>:directory}'Debug: Using settings: adding file resource 'certdir': 'File[/var/lib/puppet/ssl/certs]{:backup=>false, :loglevel=>:debug, :owner=>"puppet", :links= >:follow,:path=>"/var/lib/puppet/ssl/certs", :ensure=>:directory}'Debug: Using settings: adding file resource 'vardir': 'File[/var/lib/puppet]{:backup=>false, :loglevel=>:debug, :links=>:follow, :path=>"/var/lib/pu ppet",:ensure=>:directory}'Debug: Using settings: adding file resource 'requestdir': 'File[/var/lib/puppet/ssl/certificate_requests]{:backup=>false, :loglevel=>:debug,:owner=>"puppet", :links=>:follow, :path=>"/var/lib/puppet/ssl/certificate_requests", : ensure=>:directory}'Debug: Using settings: adding file resource 'rundir': 'File[/var/run/puppet]{:backup=>false, :loglevel=>:debug, :links=>:follow, :mode=>"755",:path=>"/var/run/puppet", :ensure=>:directory}'Debug: Using settings: adding file resource 'hostprivkey': 'File[/var/lib/puppet/ssl/private_keys/.pem]{:backup=>false, :loglevel=>:deb ug,:owner=>"puppet", :links=>:follow, :mode=>"600", :path=>"/var/lib/puppet/ssl/private _keys/.pem", :ensure=>:file}'Debug: Using settings: adding file resource 'logdir': 'File[/var/log/puppet]{:backup=>false, :group=>"puppet", :loglevel=>:debug, :owner=>"puppet",:links=>:follow, :mode=>"750", :path=>"/var/log/puppet", :ensure=>:directory}'Debug: Using settings: adding file resource 'ssldir': 'File[/var/lib/puppet/ssl]{:backup=>false, :loglevel=>:debug, :owner=>"puppet", :links=>:foll ow,:mode=>"771", :path=>"/var/lib/puppet/ssl", :ensure=>:directory}'Debug: Using settings: adding file resource 'privatekeydir': 'File[/var/lib/puppet/ssl/private_keys]{:backup=>false, :loglevel=>:debug, :owner=>"puppet ",:links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/ssl/private_keys", :ensure=>:di rectory}'Debug: /File[/var/lib/puppet/ssl/public_keys/.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys]Debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/puppet/ssl]Debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl]Debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl] Debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl] Debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring File[/var/lib/puppet/ssl]Debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]Debug: /File[/var/lib/puppet/ssl/private_keys/.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys]Debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]Debug: Finishing transaction 23872076821240Info: Caching certificate for caInfo: Creating a new SSL certificate request for Info: Certificate Request fingerprint (SHA256): 04:48:C2:2C:8D:FC:71:E8:99:EA:50:45:B1:81:A0:68:D0:26:9D:82:58:D7:AC:CB:7B:72:19:EC:A 0:40:F5:7FDebug: Using cached certificate for caDebug: Using cached certificate for caExiting; no certificate found and waitforcert is disabled2,排错方法:从上面提示貌似是Cert问题,后来查了下资料Client在test是就给Master提供有Cert 请求,只要Master sign一下就可,具体方法如下:首先看看帮助,我最先开始的事ca ,后来发现cert这个命令也可以,而且和ca 命令用法与参数差不多#puppet help caUSAGE: puppet ca <action>。
puppet安装
一、安装puppet0.配置环境1) 在master和client端都配置hosts文件2) 时间同步关闭SELINUXvi /etc/selinux/config#SELINUX=enforcing #注释掉#SELINUXTYPE=targeted #注释掉SELINUX=disabled #增加:wq! #保存退出1.先配置本地yum安装源,并安装ruby#yum update#yum install ruby ruby-libs ruby-shadow compat-readline5 -y2.下载puppet yum安装源你可以使用PuppetLabs公司的YUM安装源,也可以使用RedHat EPEL的YUM安装源来安装Puppet,两者软件包没有区别。
使用PuppetLabs公司的YUM安装源的准备方法:# rpm -ivh /el/6/products/i386/puppetlabs-release-6-6.noarch.rpm 使用RedHat EPEL的YUM源的准备方法:# rpm -ivh /fedora/epel/6/i386/epel-release-6-8.noarch.rpm我安装的是第一种[root@ye yum.repos.d]# rpm -ivh puppetlabs-release-6-6.noarch.rpmwarning: puppetlabs-release-6-6.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 4bd6ec30:NOKEYPreparing... ########################################### [100%]1:puppetlabs-release ########################################### [100%]安装后会看到文件:puppetlabs.repoServer端:yum install puppet puppet-server facter -y[root@ye yum.repos.d]# yum install puppet puppet-server facter -ySetting up Install Processextras | 3.4 kB 00:00extras/primary_db | 31 kB 00:00puppetlabs-deps | 2.5 kB 00:00puppetlabs-deps/primary_db | 27 kB 00:00puppetlabs-products | 2.5 kB 00:00puppetlabs-products/primary_db | 156 kB 00:01updates | 3.4 kB 00:00updates/primary_db | 3.9 MB 00:14Resolving Dependencies--> Running transaction check---> Package facter.x86_64 1:2.4.4-1.el6 will be installed---> Package puppet.noarch 0:3.8.1-1.el6 will be installed--> Processing Dependency: hiera >= 1.0.0 for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby-augeas for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby-shadow for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: rubygem-json for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby(selinux) for package: puppet-3.8.1-1.el6.noarch---> Package puppet-server.noarch 0:3.8.1-1.el6 will be installed--> Running transaction check---> Package hiera.noarch 0:1.3.4-1.el6 will be installed---> Package libselinux-ruby.x86_64 0:2.0.94-5.8.el6 will be installed--> Processing Dependency: libselinux = 2.0.94-5.8.el6 for package: libselinux-ruby-2.0.94-5.8.el6.x86_64---> Package ruby-augeas.x86_64 0:0.4.1-3.el6 will be installed--> Processing Dependency: augeas-libs >= 0.8.0 for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.10.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.1.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.11.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.8.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.12.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0()(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64 ---> Package ruby-shadow.x86_64 1:2.2.0-2.el6 will be installed---> Package rubygem-json.x86_64 0:1.5.5-3.el6 will be installed--> Processing Dependency: rubygems >= 1.3.7 for package: rubygem-json-1.5.5-3.el6.x86_64--> Running transaction check---> Package augeas-libs.x86_64 0:1.0.0-7.el6_6.1 will be installed---> Package libselinux.x86_64 0:2.0.94-5.3.el6 will be updated--> Processing Dependency: libselinux = 2.0.94-5.3.el6 for package: libselinux-utils-2.0.94-5.3.el6.x86_64---> Package libselinux.x86_64 0:2.0.94-5.8.el6 will be an update---> Package rubygems.noarch 0:1.3.7-5.el6 will be installed--> Processing Dependency: ruby-rdoc for package: rubygems-1.3.7-5.el6.noarch--> Running transaction check---> Package libselinux-utils.x86_64 0:2.0.94-5.3.el6 will be updated---> Package libselinux-utils.x86_64 0:2.0.94-5.8.el6 will be an update---> Package ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6 will be installed--> Processing Dependency: ruby-irb = 1.8.7.374-4.el6_6 for package: ruby-rdoc-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby-irb.x86_64 0:1.8.7.374-4.el6_6 will be installed--> Processing Dependency: ruby = 1.8.7.374-4.el6_6 for package: ruby-irb-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby.x86_64 0:1.8.7.352-7.el6_2 will be updated---> Package ruby.x86_64 0:1.8.7.374-4.el6_6 will be an update--> Processing Dependency: ruby-libs = 1.8.7.374-4.el6_6 for package: ruby-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby-libs.x86_64 0:1.8.7.352-7.el6_2 will be updated---> Package ruby-libs.x86_64 0:1.8.7.374-4.el6_6 will be an update--> Processing Dependency: libssl.so.10(libssl.so.10)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package openssl.x86_64 0:1.0.0-27.el6 will be updated---> Package openssl.x86_64 0:1.0.1e-30.el6.11 will be an update--> Finished Dependency ResolutionDependencies Resolved===============================================================================================================================================================================================Package Arch Version Repository Size===============================================================================================================================================================================================Installing:facter x86_64 1:2.4.4-1.el6 puppetlabs-products 99 kpuppet noarch 3.8.1-1.el6 puppetlabs-products 1.6 Mpuppet-server noarch 3.8.1-1.el6 puppetlabs-products 24 kInstalling for dependencies:augeas-libs x86_64 1.0.0-7.el6_6.1 updates 313 khiera noarch 1.3.4-1.el6 puppetlabs-products 23 klibselinux-ruby x86_64 2.0.94-5.8.el6 base 100 kruby-augeas x86_64 0.4.1-3.el6 puppetlabs-deps 21 kruby-irb x86_64 1.8.7.374-4.el6_6 updates 317 kruby-rdoc x86_64 1.8.7.374-4.el6_6 updates 381 kruby-shadow x86_64 1:2.2.0-2.el6 puppetlabs-deps 13 krubygem-json x86_64 1.5.5-3.el6 puppetlabs-deps 763 krubygems noarch 1.3.7-5.el6 base 207 kUpdating for dependencies:libselinux x86_64 2.0.94-5.8.el6 base 108 klibselinux-utils x86_64 2.0.94-5.8.el6base 82 kopenssl x86_64 1.0.1e-30.el6.11 updates 1.5 Mruby x86_64 1.8.7.374-4.el6_6 updates 538 kruby-libs x86_64 1.8.7.374-4.el6_6 updates 1.7 MTransaction Summary===============================================================================================================================================================================================Install 12 Package(s)Upgrade 5 Package(s)Total download size: 7.7 MDownloading Packages:(1/17): augeas-libs-1.0.0-7.el6_6.1.x86_64.rpm | 313 kB 00:00(2/17): facter-2.4.4-1.el6.x86_64.rpm | 99 kB 00:00(3/17): hiera-1.3.4-1.el6.noarch.rpm | 23 kB 00:00(4/17): libselinux-2.0.94-5.8.el6.x86_64.rpm | 108 kB 00:00(5/17): libselinux-ruby-2.0.94-5.8.el6.x86_64.rpm | 100 kB 00:00(6/17): libselinux-utils-2.0.94-5.8.el6.x86_64.rpm | 82 kB 00:00(7/17): openssl-1.0.1e-30.el6.11.x86_64.rpm | 1.5 MB 00:06(8/17): puppet-3.8.1-1.el6.noarch.rpm | 1.6 MB 00:22(9/17): puppet-server-3.8.1-1.el6.noarch.rpm | 24 kB 00:00(10/17): ruby-1.8.7.374-4.el6_6.x86_64.rpm | 538 kB 00:02(11/17): ruby-augeas-0.4.1-3.el6.x86_64.rpm | 21 kB 00:00(12/17): ruby-irb-1.8.7.374-4.el6_6.x86_64.rpm | 317 kB 00:00(13/17): ruby-libs-1.8.7.374-4.el6_6.x86_64.rpm | 1.7 MB 00:05(14/17): ruby-rdoc-1.8.7.374-4.el6_6.x86_64.rpm| 381 kB 00:01(15/17): ruby-shadow-2.2.0-2.el6.x86_64.rpm | 13 kB 00:00(16/17): rubygem-json-1.5.5-3.el6.x86_64.rpm | 763 kB 00:59(17/17): rubygems-1.3.7-5.el6.noarch.rpm | 207 kB 00:01-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Total71 kB/s | 7.7 MB 01:50warning: rpmts_HdrFromFdno: Header V4 RSA/SHA512 Signature, key ID 4bd6ec30: NOKEYRetrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsImporting GPG key 0x4BD6EC30:Userid : Puppet Labs Release Key (Puppet Labs Release Key) <info@>Package: puppetlabs-release-6-6.noarch (installed)From : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabswarning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEYRetrieving key from /centos/RPM-GPG-KEY-CentOS-6GPG key retrieval failed: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host''"遇到这个问题,DNS没设置好设置好之后再执行[root@ye yum.repos.d]# yum install puppet puppet-server facter -ySetting up Install ProcessResolving Dependencies--> Running transaction check---> Package facter.x86_64 1:2.4.4-1.el6 will be installed---> Package puppet.noarch 0:3.8.1-1.el6 will be installed--> Processing Dependency: hiera >= 1.0.0 for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby-augeas for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby-shadow for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: rubygem-json for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby(selinux) for package: puppet-3.8.1-1.el6.noarch---> Package puppet-server.noarch 0:3.8.1-1.el6 will be installed--> Running transaction check---> Package hiera.noarch 0:1.3.4-1.el6 will be installed---> Package libselinux-ruby.x86_64 0:2.0.94-5.8.el6 will be installed--> Processing Dependency: libselinux = 2.0.94-5.8.el6 for package: libselinux-ruby-2.0.94-5.8.el6.x86_64---> Package ruby-augeas.x86_64 0:0.4.1-3.el6 will be installed--> Processing Dependency: augeas-libs >= 0.8.0 for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.10.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.1.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.11.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.8.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.12.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0()(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64 ---> Package ruby-shadow.x86_64 1:2.2.0-2.el6 will be installed---> Package rubygem-json.x86_64 0:1.5.5-3.el6 will be installed--> Processing Dependency: rubygems >= 1.3.7 for package: rubygem-json-1.5.5-3.el6.x86_64--> Running transaction check---> Package augeas-libs.x86_64 0:1.0.0-7.el6_6.1 will be installed---> Package libselinux.x86_64 0:2.0.94-5.3.el6 will be updated--> Processing Dependency: libselinux = 2.0.94-5.3.el6 for package: libselinux-utils-2.0.94-5.3.el6.x86_64---> Package libselinux.x86_64 0:2.0.94-5.8.el6 will be an update---> Package rubygems.noarch 0:1.3.7-5.el6 will be installed--> Processing Dependency: ruby-rdoc for package: rubygems-1.3.7-5.el6.noarch--> Running transaction check---> Package libselinux-utils.x86_64 0:2.0.94-5.3.el6 will be updated---> Package libselinux-utils.x86_64 0:2.0.94-5.8.el6 will be an update---> Package ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6 will be installed--> Processing Dependency: ruby-irb = 1.8.7.374-4.el6_6 for package: ruby-rdoc-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby-irb.x86_64 0:1.8.7.374-4.el6_6 will be installed--> Processing Dependency: ruby = 1.8.7.374-4.el6_6 for package: ruby-irb-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby.x86_64 0:1.8.7.352-7.el6_2 will be updated---> Package ruby.x86_64 0:1.8.7.374-4.el6_6 will be an update--> Processing Dependency: ruby-libs = 1.8.7.374-4.el6_6 for package: ruby-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby-libs.x86_64 0:1.8.7.352-7.el6_2 will be updated---> Package ruby-libs.x86_64 0:1.8.7.374-4.el6_6 will be an update--> Processing Dependency: libssl.so.10(libssl.so.10)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package openssl.x86_64 0:1.0.0-27.el6 will be updated---> Package openssl.x86_64 0:1.0.1e-30.el6.11 will be an update--> Finished Dependency ResolutionDependencies Resolved===============================================================================================================================================================================================Package Arch Version Repository Size===============================================================================================================================================================================================Installing:facter x86_64 1:2.4.4-1.el6 puppetlabs-products 99 kpuppet noarch 3.8.1-1.el6 puppetlabs-products 1.6 Mpuppet-server noarch 3.8.1-1.el6 puppetlabs-products 24 kInstalling for dependencies:augeas-libs x86_64 1.0.0-7.el6_6.1 updates 313 khiera noarch 1.3.4-1.el6 puppetlabs-products 23 klibselinux-ruby x86_64 2.0.94-5.8.el6 base 100 kruby-augeas x86_64 0.4.1-3.el6 puppetlabs-deps 21 kruby-irb x86_64 1.8.7.374-4.el6_6 updates 317 kruby-rdoc x86_64 1.8.7.374-4.el6_6 updates 381 kruby-shadow x86_64 1:2.2.0-2.el6 puppetlabs-deps 13 krubygem-json x86_64 1.5.5-3.el6 puppetlabs-deps 763 krubygems noarch 1.3.7-5.el6 base 207 kUpdating for dependencies:libselinux x86_64 2.0.94-5.8.el6 base 108 klibselinux-utils x86_64 2.0.94-5.8.el6 base 82 kopenssl x86_64 1.0.1e-30.el6.11 updates 1.5 Mruby x86_64 1.8.7.374-4.el6_6 updates 538 kruby-libs x86_64 1.8.7.374-4.el6_6 updates 1.7 MTransaction Summary===============================================================================================================================================================================================Install 12 Package(s)Upgrade 5 Package(s)Total size: 7.7 MDownloading Packages:warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEYRetrieving key from /centos/RPM-GPG-KEY-CentOS-6Importing GPG key 0xC105B9DE:Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@>"From : /centos/RPM-GPG-KEY-CentOS-6Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionWarning: RPMDB altered outside of yum.** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:rhn-check-1.0.0.1-4.el6.noarch has missing requires of yum-rhn-plugin >= ('0', '0.9.1', '35')Updating : libselinux-2.0.94-5.8.el6.x86_64 1/22Updating : libselinux-utils-2.0.94-5.8.el6.x86_64 2/22Installing : augeas-libs-1.0.0-7.el6_6.1.x86_64 3/22Installing : libselinux-ruby-2.0.94-5.8.el6.x86_64 4/22Updating : openssl-1.0.1e-30.el6.11.x86_64 5/22Updating : ruby-libs-1.8.7.374-4.el6_6.x86_646/22Updating : ruby-1.8.7.374-4.el6_6.x86_64 7/22Installing : 1:facter-2.4.4-1.el6.x86_64 8/22Installing : 1:ruby-shadow-2.2.0-2.el6.x86_64 9/22Installing : ruby-irb-1.8.7.374-4.el6_6.x86_64 10/22Installing : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 11/22Installing : rubygems-1.3.7-5.el6.noarch 12/22Installing : rubygem-json-1.5.5-3.el6.x86_64 13/22Installing : hiera-1.3.4-1.el6.noarch 14/22Installing : ruby-augeas-0.4.1-3.el6.x86_64 15/22Installing : puppet-3.8.1-1.el6.noarch 16/22Installing : puppet-server-3.8.1-1.el6.noarch 17/22Cleanup : ruby-1.8.7.352-7.el6_2.x86_64 18/22Cleanup : ruby-libs-1.8.7.352-7.el6_2.x86_64 19/22Cleanup : libselinux-utils-2.0.94-5.3.el6.x86_64 20/22Cleanup : libselinux-2.0.94-5.3.el6.x86_64 21/22Cleanup : openssl-1.0.0-27.el6.x86_64 22/22Verifying : 1:facter-2.4.4-1.el6.x86_64 1/22Verifying : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 2/22Verifying : 1:ruby-shadow-2.2.0-2.el6.x86_64 3/22Verifying : ruby-augeas-0.4.1-3.el6.x86_64 4/22Verifying : puppet-server-3.8.1-1.el6.noarch 5/22Verifying : libselinux-utils-2.0.94-5.8.el6.x86_646/22Verifying : rubygems-1.3.7-5.el6.noarch 7/22Verifying : puppet-3.8.1-1.el6.noarch 8/22Verifying : openssl-1.0.1e-30.el6.11.x86_64 9/22Verifying : ruby-libs-1.8.7.374-4.el6_6.x86_64 10/22Verifying : ruby-irb-1.8.7.374-4.el6_6.x86_64 11/22Verifying : libselinux-2.0.94-5.8.el6.x86_64 12/22Verifying : augeas-libs-1.0.0-7.el6_6.1.x86_64 13/22Verifying : ruby-1.8.7.374-4.el6_6.x86_64 14/22Verifying : rubygem-json-1.5.5-3.el6.x86_64 15/22Verifying : hiera-1.3.4-1.el6.noarch 16/22Verifying : libselinux-ruby-2.0.94-5.8.el6.x86_64 17/22Verifying : libselinux-2.0.94-5.3.el6.x86_64 18/22Verifying : ruby-1.8.7.352-7.el6_2.x86_64 19/22Verifying : libselinux-utils-2.0.94-5.3.el6.x86_64 20/22Verifying : openssl-1.0.0-27.el6.x86_64 21/22Verifying : ruby-libs-1.8.7.352-7.el6_2.x86_64 22/22Installed:facter.x86_64 1:2.4.4-1.el6 puppet.noarch 0:3.8.1-1.el6 puppet-server.noarch 0:3.8.1-1.el6Dependency Installed:augeas-libs.x86_64 0:1.0.0-7.el6_6.1 hiera.noarch 0:1.3.4-1.el6 libselinux-ruby.x86_640:2.0.94-5.8.el6 ruby-augeas.x86_64 0:0.4.1-3.el6 ruby-irb.x86_64 0:1.8.7.374-4.el6_6ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6 ruby-shadow.x86_64 1:2.2.0-2.el6 rubygem-json.x86_64 0:1.5.5-3.el6 rubygems.noarch 0:1.3.7-5.el6Dependency Updated:libselinux.x86_64 0:2.0.94-5.8.el6 libselinux-utils.x86_64 0:2.0.94-5.8.el6 openssl.x86_640:1.0.1e-30.el6.11 ruby.x86_64 0:1.8.7.374-4.el6_6 ruby-libs.x86_64 0:1.8.7.374-4.el6_6Complete!Client端:yum install puppet facter -y[root@ye local]# yum install puppet facter -yLoaded plugins: product-id, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.Setting up Install Processpuppetlabs-deps| 2.5 kB 00:00puppetlabs-deps/primary_db | 27 kB 00:00puppetlabs-products| 2.5 kB 00:00puppetlabs-products/primary_db | 156 kB 00:03Resolving Dependencies--> Running transaction check---> Package facter.x86_64 1:2.4.4-1.el6 will be installed---> Package puppet.noarch 0:3.8.1-1.el6 will be installed--> Processing Dependency: hiera >= 1.0.0 for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby-augeas for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby-shadow for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: rubygem-json for package: puppet-3.8.1-1.el6.noarch--> Processing Dependency: ruby(selinux) for package: puppet-3.8.1-1.el6.noarch--> Running transaction check---> Package hiera.noarch 0:1.3.4-1.el6 will be installed---> Package libselinux-ruby.x86_64 0:2.0.94-5.8.el6 will be installed--> Processing Dependency: libselinux = 2.0.94-5.8.el6 for package: libselinux-ruby-2.0.94-5.8.el6.x86_64---> Package ruby-augeas.x86_64 0:0.4.1-3.el6 will be installed--> Processing Dependency: augeas-libs >= 0.8.0 for package: ruby-augeas-0.4.1-3.el6.x86_640.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.1.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.11.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.8.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0(AUGEAS_0.12.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64--> Processing Dependency: libaugeas.so.0()(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64 ---> Package ruby-shadow.x86_64 1:2.2.0-2.el6 will be installed---> Package rubygem-json.x86_64 0:1.5.5-3.el6 will be installed--> Processing Dependency: rubygems >= 1.3.7 for package: rubygem-json-1.5.5-3.el6.x86_64--> Running transaction check---> Package augeas-libs.x86_64 0:1.0.0-7.el6_6.1 will be installed---> Package libselinux.x86_64 0:2.0.94-5.3.el6 will be updated--> Processing Dependency: libselinux = 2.0.94-5.3.el6 for package: libselinux-utils-2.0.94-5.3.el6.x86_64---> Package libselinux.x86_64 0:2.0.94-5.8.el6 will be an update---> Package rubygems.noarch 0:1.3.7-5.el6 will be installed--> Processing Dependency: ruby-rdoc for package: rubygems-1.3.7-5.el6.noarch--> Running transaction check---> Package libselinux-utils.x86_64 0:2.0.94-5.3.el6 will be updated---> Package libselinux-utils.x86_64 0:2.0.94-5.8.el6 will be an update---> Package ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6 will be installed--> Processing Dependency: ruby-irb = 1.8.7.374-4.el6_6 for package: ruby-rdoc-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby-irb.x86_64 0:1.8.7.374-4.el6_6 will be installed--> Processing Dependency: ruby = 1.8.7.374-4.el6_6 for package: ruby-irb-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby.x86_64 0:1.8.7.352-7.el6_2 will be updated---> Package ruby.x86_64 0:1.8.7.374-4.el6_6 will be an update--> Processing Dependency: ruby-libs = 1.8.7.374-4.el6_6 for package: ruby-1.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package ruby-libs.x86_64 0:1.8.7.352-7.el6_2 will be updated---> Package ruby-libs.x86_64 0:1.8.7.374-4.el6_6 will be an update--> Processing Dependency: libssl.so.10(libssl.so.10)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_641.8.7.374-4.el6_6.x86_64--> Running transaction check---> Package openssl.x86_64 0:1.0.0-27.el6 will be updated---> Package openssl.x86_64 0:1.0.1e-30.el6.11 will be an update--> Finished Dependency ResolutionDependencies Resolved===============================================================================================================================================================================================Package Arch Version Repository Size===============================================================================================================================================================================================Installing:facter x86_64 1:2.4.4-1.el6 puppetlabs-products 99 kpuppet noarch 3.8.1-1.el6 puppetlabs-products 1.6 MInstalling for dependencies:augeas-libs x86_64 1.0.0-7.el6_6.1 updates 313 khiera noarch 1.3.4-1.el6 puppetlabs-products 23 klibselinux-ruby x86_64 2.0.94-5.8.el6 base 100 kruby-augeas x86_64 0.4.1-3.el6 puppetlabs-deps 21 kruby-irb x86_64 1.8.7.374-4.el6_6 updates 317 kruby-rdoc x86_64 1.8.7.374-4.el6_6 updates 381 kruby-shadow x86_64 1:2.2.0-2.el6 puppetlabs-deps 13 krubygem-json x86_64 1.5.5-3.el6 puppetlabs-deps 763 krubygems noarch 1.3.7-5.el6 base 207 kUpdating for dependencies:libselinux x86_64 2.0.94-5.8.el6 base 108 klibselinux-utils x86_64 2.0.94-5.8.el6 base 82 kopenssl x86_64 1.0.1e-30.el6.11 updates 1.5 Mruby x86_64 1.8.7.374-4.el6_6 updates 538 kruby-libs x86_64 1.8.7.374-4.el6_6 updates 1.7 MTransaction Summary===============================================================================================================================================================================================Install 11 Package(s)Upgrade 5 Package(s)Total size: 7.6 MTotal download size: 3.8 MDownloading Packages:(1/11): augeas-libs-1.0.0-7.el6_6.1.x86_64.rpm | 313 kB 00:00(2/11): facter-2.4.4-1.el6.x86_64.rpm | 99 kB 00:03(3/11): hiera-1.3.4-1.el6.noarch.rpm | 23 kB 00:00(4/11): libselinux-ruby-2.0.94-5.8.el6.x86_64.rpm | 100 kB 00:00(5/11): puppet-3.8.1-1.el6.noarch.rpm | 1.6 MB 00:25(6/11): ruby-augeas-0.4.1-3.el6.x86_64.rpm | 21 kB 00:00(7/11): ruby-irb-1.8.7.374-4.el6_6.x86_64.rpm | 317 kB 00:00(8/11): ruby-rdoc-1.8.7.374-4.el6_6.x86_64.rpm | 381 kB 00:00(9/11): ruby-shadow-2.2.0-2.el6.x86_64.rpm | 13 kB 00:00(10/11): rubygem-json-1.5.5-3.el6.x86_64.rpm | 763 kB 00:04(11/11): rubygems-1.3.7-5.el6.noarch.rpm | 207 kB 00:00-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Total94 kB/s | 3.8 MB 00:40warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEYRetrieving key from /centos/RPM-GPG-KEY-CentOS-6Importing GPG key 0xC105B9DE:Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@>"From : /centos/RPM-GPG-KEY-CentOS-6warning: rpmts_HdrFromFdno: Header V4 RSA/SHA512 Signature, key ID 4bd6ec30: NOKEYRetrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsImporting GPG key 0x4BD6EC30:Userid : Puppet Labs Release Key (Puppet Labs Release Key) <info@>Package: puppetlabs-release-6-6.noarch (installed)From : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabsRunning rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionWarning: RPMDB altered outside of yum.** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:rhn-check-1.0.0.1-4.el6.noarch has missing requires of yum-rhn-plugin >= ('0', '0.9.1', '35')Updating : libselinux-2.0.94-5.8.el6.x86_64 1/21Installing : augeas-libs-1.0.0-7.el6_6.1.x86_64 2/21Updating : libselinux-utils-2.0.94-5.8.el6.x86_64 3/21Installing : libselinux-ruby-2.0.94-5.8.el6.x86_64 4/21Updating : openssl-1.0.1e-30.el6.11.x86_64 5/21Updating : ruby-libs-1.8.7.374-4.el6_6.x86_64 6/21Updating : ruby-1.8.7.374-4.el6_6.x86_64 7/21Installing : 1:facter-2.4.4-1.el6.x86_64 8/21Installing : ruby-irb-1.8.7.374-4.el6_6.x86_64 9/21Installing : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 10/21Installing : rubygems-1.3.7-5.el6.noarch 11/21Installing : rubygem-json-1.5.5-3.el6.x86_64 12/21Installing : hiera-1.3.4-1.el6.noarchInstalling : 1:ruby-shadow-2.2.0-2.el6.x86_64 14/21Installing : ruby-augeas-0.4.1-3.el6.x86_64 15/21Installing : puppet-3.8.1-1.el6.noarch 16/21Cleanup : ruby-1.8.7.352-7.el6_2.x86_64 17/21Cleanup : ruby-libs-1.8.7.352-7.el6_2.x86_64 18/21Cleanup : libselinux-utils-2.0.94-5.3.el6.x86_64 19/21Cleanup : libselinux-2.0.94-5.3.el6.x86_64 20/21Cleanup : openssl-1.0.0-27.el6.x86_64 21/21Verifying : openssl-1.0.1e-30.el6.11.x86_64 1/21Verifying : libselinux-2.0.94-5.8.el6.x86_64 2/21Verifying : augeas-libs-1.0.0-7.el6_6.1.x86_64 3/21Verifying : 1:facter-2.4.4-1.el6.x86_64 4/21Verifying : ruby-libs-1.8.7.374-4.el6_6.x86_64 5/21Verifying : ruby-irb-1.8.7.374-4.el6_6.x86_64 6/21Verifying : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 7/21Verifying : libselinux-utils-2.0.94-5.8.el6.x86_64 8/21Verifying : ruby-1.8.7.374-4.el6_6.x86_64 9/21Verifying : rubygem-json-1.5.5-3.el6.x86_64 10/21Verifying : hiera-1.3.4-1.el6.noarch 11/21Verifying : rubygems-1.3.7-5.el6.noarch 12/21Verifying : libselinux-ruby-2.0.94-5.8.el6.x86_64 13/21Verifying : puppet-3.8.1-1.el6.noarch。
Puppet使用方法总结
Puppet使用方法总结1. 概述puppet是一个开源的软件自动化配置和部署工具,它使用简单且功能强大,正得到了越来越多地关注,现在很多大型IT公司均在使用puppet 对集群中的软件进行管理和部署,如google利用puppet管理超过6000台地mac桌面电脑。
本文主要介绍puppet安装方法,设计架构及使用方法。
2. 设计架构puppet是基于c/s架构的。
服务器端保存着所有对客户端服务器的配置代码,在puppet里面叫做manifest. 客户端下载manifest之后,可以根据manifest对服务器进行配置,例如软件包管理,用户管理和文件管理等等。
如上图所示,puppet的工作流程如下:(1)客户端puppetd调用facter,facter探测出主机的一些变量,例如主机名,内存大小,ip地址等。
pupppetd 把这些信息通过ssl连接发送到服务器端;(2)服务器端的puppetmaster 检测客户端的主机名,然后找到manifest里面对应的node 配置,并对该部分内容进行解析,facter送过来的信息可以作为变量处理,node牵涉到的代码才解析,其他没牵涉的代码不解析。
解析分为几个阶段,语法检查,如果语法错误就报错。
如果语法没错,就继续解析,解析的结果生成一个中间的“伪代码”,然后把伪代码发给客户端;(3)客户端接收到“伪代码”,并且执行,客户端把执行结果发送给服务器;(4)服务器端把客户端的执行结果写入日志。
puppet工作过程中有两点值得注意,第一,为了保证安全,client和master之间是基于ssl和证书的,只有经master证书认证的client可以与master通信;第二,puppet会让系统保持在你所期望的某种状态并一直维持下去,如检测某个文件并保证其一直存在,保证ssh服务始终开启,如果文件被删除了或者ssh服务被关闭了,puppet下次执行时(默认30分钟),会重新创建该文件或者启动ssh服务。
Puppet自动化部署工具在软件开发中的应用
Puppet自动化部署工具在软件开发中的应用自动化部署是现代软件开发中的一个重要环节。
它不仅可以减少手动操作的时间和出错的概率,还可以提高开发团队的效率和软件的稳定性。
针对这个需求,市面上出现了很多自动化部署工具。
本文将重点介绍一种开源的自动化部署工具—— Puppet,探讨它在软件开发中的应用。
一、Puppet的概述Puppet是一款开源的自动化部署工具,它可以自动化地配置和管理多个服务器或设备。
使用Puppet可以做到快速、安全地部署软件,管理设备配置,确保服务器的一致性,提高开发效率。
Puppet的特点是基于资源编排,以声明式语言为切入点,让用户通过业务需求描述所需状态,系统负责实现状态。
Puppet的核心思想是“Infrastructure as Code”,即将基础设施视为代码,用代码进行管理。
Puppet的工作方式是基于客户端-服务器体系结构。
在这种体系结构中,我们有一个中央控制节点,称为 Puppet Master,和多个节点,称为 Puppet Agent。
Puppet Master 负责收集、编译和分发Puppet Agent 的配置信息,而 Puppet Agent 负责应用配置信息,实现所需状态。
二、Puppet在软件开发中的应用1.自动化部署Puppet最主要的应用场景是自动化部署。
在软件开发中,我们需要频繁地部署应用程序,以及安装、配置和管理soft/hard 成分。
使用Puppet,我们可以快速而准确地将所需状态部署到服务器上,避免了手动部署的繁琐、缺省、容错率低的问题。
2.配置管理另一个常见的场景是配置管理。
在软件开发中,我们需要管理各种配置文件,比如 nginx、mysql、redis 等。
使用 Puppet,我们可以将这些配置文件打包到一个 module 中,然后分发到各个服务节点上。
这样,当配置文件需要更改时,我们只需要更改module,然后重新应用到所有节点上,就可以实现统一管理。
自动化运维工具——puppet详解(一)
⾃动化运维⼯具——puppet详解(⼀)作者:⽬录⼀、puppet 介绍1、puppet是什么2、puppet的⼯作机制1)⼯作模型2)⼯作流程3)使⽤模型3、puppet 名词解释⼆、puppet 资源详解1、程序安装及环境2、puppet 资源简介1)资源抽象2)资源定义3)资源属性中的三个特殊属性:3、常⽤资源总结4、资源的特殊属性tag 标签5、puppet 变量1)puppet的变量种类2)变量的作⽤域6、puppet 流程控制语句1)if 语句2)case 语句3)selector 语句写在后⾯正⽂⼀、puppet 介绍1、puppet是什么 puppet是⼀个IT基础设施⾃动化管理⼯具,它能够帮助系统管理员管理基础设施的整个⽣命周期:供应(provisioning)、配置(configuration)、联动(orchestration)及报告(reporting)。
基于puppet ,可实现⾃动化重复任务、快速部署关键性应⽤以及在本地或云端完成主动管理变更和快速扩展架构规模等。
遵循GPL 协议(2.7.0-), 基于ruby语⾔开发。
2.7.0 以后使⽤(Apache 2.0 license) 对于系统管理员是抽象的,只依赖于ruby与facter。
能管理多达40 多种资源,例如:file、user、group、host、package、service、cron、exec、yum repo等。
2、puppet的⼯作机制1)⼯作模型 puppet 通过声明性、基于模型的⽅法进⾏IT⾃动化管理。
定义:通过puppet 的声明性配置语⾔定义基础设置配置的⽬标状态; 模拟:强制应⽤改变的配置之前先进⾏模拟性应⽤; 强制:⾃动、强制部署达成⽬标状态,纠正任何偏离的配置; 报告:报告当下状态及⽬标状态的不同,以及达成⽬标状态所进⾏的任何强制性改变;puppet三层模型 puppet三层模型如下:puppet三层模型2)⼯作流程⼯作流程3)使⽤模型 puppet的使⽤模型分为单机使⽤模型和master/agent模型,下⾯我们来看看这两个模型的原理图。
使用Puppet或Ansible进行自动化配置管理
使用Puppet或Ansible进行自动化配置管理自动化配置管理是现代IT运维管理中的重要一环,它可以帮助组织实现高效、可靠的系统配置管理和快速部署。
目前市场上有很多自动化配置管理工具可供选择,其中最为知名和常用的包括Puppet和Ansible。
本文将针对这两个工具进行介绍和比较,并分点列出其特点和使用方法,帮助读者理解和选择适合自己的工具。
1. Puppet简介及特点:- Puppet是一个开源的自动化配置管理工具,由Puppet Labs开发。
- Puppet使用基于声明式语言的模型来描述系统的配置,通过事先定义所需的状态,然后自动完成配置的实施和持续监控。
- Puppet支持跨平台,可以用于管理不同类型的系统,包括Linux、Windows 等。
- Puppet具有良好的扩展性,可以根据实际需求编写自定义模块和插件。
- Puppet提供了丰富的资源类型和模块,可以快速实现常见的配置管理需求。
2. Puppet的使用方法:- 安装和配置Puppet服务器和客户端。
- 编写Puppet配置文件,定义主机的目标状态。
- 创建Puppet模块,包含定义主机配置的类和资源。
- 部署和运行Puppet agent,使主机自动应用配置。
3. Ansible简介及特点:- Ansible是一个开源的自动化配置管理和部署工具,由Ansible Inc.开发。
- Ansible使用基于YAML的剧本语言来描述系统的配置和部署流程,通过SSH协议远程执行任务和配置。
- Ansible采用无代理的工作方式,不需要在被管理主机上安装额外的组件,对资源消耗较小。
- Ansible支持多种操作系统和云平台,可以方便地实现跨平台、跨云的管理和部署。
- Ansible的剧本和模块库非常丰富,涵盖了各种常见的系统配置和部署需求。
4. Ansible的使用方法:- 安装和配置Ansible控制机和被管理主机。
- 编写Ansible剧本,描述系统的配置和部署流程。
用 Puppet 搭建易管理的服务器基础架构
用Puppet 搭建易管理的服务器基础架构关于PuppetPuppet 是一种Linux、Unix、Windows 平台的集中配置管理系统,使用自有的Puppet 描述语言,可管理配置文件、用户、cron任务、软件包、系统服务等。
Puppet把这些系统实体称之为资源,其设计目标是简化对这些资源的管理以及妥善处理资源之间的依赖关系。
在这一系列中,作者提供了一个可操作的全面教程,来逐步解释如何使用Puppet 搭建一个集中式管理的Linux 服务器基础结构。
目标读者我相信有一类Linux系统管理员会从这个系列教程中收获最多,他们已经在管理一个小规模的服务器系统网络,想知道如何扩大现有的基础结构,并且为管理新增系统付出的的时间和精力,不会和新增系统的数目成正比。
或许你目前在管理5个服务器系统,你可以问一下自己有没有更好的方法,可以在不增加人手的情况下,来管理50个服务器系统。
或者你已经听说过集中式配置管理和Puppet,并且渴望尝试一下。
先决条件如果你的电脑安装了Linux、Windows 或者Mac OS X 桌面操作系统,拥有至少4G内存,16G可用磁盘空间,并且CPU可以运行虚拟机,那就足够了。
所有你要做的事情和需要的信息,我会在这个系列课程中为你说明。
开始我无需说服你使用Puppet实现基于工具的配置管理,既然你能读到这里,你可能已经想要使用它了,所以让我们马上开始吧。
我承诺这是一个易上手的全面的教程,为此,我们需要准备一个环境,这样我们可以不仅可以讨论如何使用Puppet,而且能够创建一个虽然很小但是真实的服务器基础结构,在这个基础结构中,我们会运行一个Puppet服务器,它会管理一个Puppet客户端。
换句话说,我们需要两个Linux虚拟机。
在这个教程中,我愿意使用两个 Ubuntu 12.04 LTS Precise Pangolin 系统,这只是因为我对这个Linux发行版本最有经验。
puppet安装配置手册
puppet安装配置⼿册系统管理安装配置说明Puppet的安装配置以及集成说明⽬录系统管理安装配置说明 (1)Puppet的安装配置以及集成说明 (1)0 ⽂档说明 (3)0.1 ⽂档版本 (3)0.2 ⽂档⽬的 (3)0.3 ⽂档内容 (3)0.4 读者对象 (3)0.5 引⽤标准 (3)0.6 缩写与术语对照表 (4)1 安装环境说明 (4)2 Puppet安装、配置、运⾏说明 (6)2.1 Puppet及依赖的软件包的安装。
(6)2.1.1 操作系统⾃带的的RPM包 (6)2.1.2 第三⽅软件包的安装 (7)2.1.3 Puppet的配置(master,client) (10)2.1.4 设置puppet⽤户权限 (12)2.2 Puppet核⼼功能运⾏说明 (13)2.2.1 设置时间服务器 (13)2.2.2 Puppet Master(dn4.cloud)运⾏步骤 (13)2.2.3 Puppet Client(dn0.cloud)运⾏步骤 (17)3 Puppet的扩展以及跟第三⽅Report集成 (22)3.1 Puppet扩展Passenger (22)3.1.1 安装操作系统⾃带的的RPM包 (23)3.1.2 安装第三⽅软件包的安装 (23)3.1.3 集成Passenger跟Apache (25)3.1.4 在apache中配置puppet应⽤ (27)3.1.5 重新启动apache (29)3.2 Puppet集成Puppet Dashboard (30)3.2.1 安装ruby相关的gem包 (30)3.2.2 安装Puppet Dashboard相关的rpm包 (31)3.2.3 关联Puppet Dashboard跟MYSQL (32)3.2.4 关联Puppet Dashboard和apache (35)3.2.5 关联Puppet Dashboard和Puppet (36)0⽂档说明0.1 ⽂档版本0.2 ⽂档⽬的本⽂档旨在对系统管理⼯具puppet软件的安装、扩展以及具体应⽤提供详细、准确的说明。
pyppeteer使用时常见的bug及解决办法【转载】
pyppeteer使⽤时常见的bug及解决办法【转载】背景最近时不时的会⽤到pyppeteer,⼀会⼉是本地环境利⽤pyppeteer写个模拟浏览器的⼩脚本,⼀会⼉是线上阿⾥云服务器上需要部署pyppeteer所写的脚本。
中途遇到⼀些问题,最后都是通过goolge解决了。
为了以后不再到处google,故写下此博客。
问题⼀workError: Protocol error Network.getCookies: Target close 或者workError: Protocol Error (Runtime.evaluate): Session closed. Most likely the page has been closed.后来有⼈说可以把python第三⽅库websockets版本7.0改为6.0(反正在7.0版本以下就)就可以了,亲测可⽤。
pip3.6 uninstall websockets #卸载websocketspip3.6 install websockets==6.0 #指定安装6.0版本```问题⼆chromium浏览器多开页⾯卡死问题在浏览器初始化的时候launch⾥添加 ‘dumpio’:True。
跟浏览器进程有关,⾄于为什么要这样我也不太清楚。
问题三浏览器窗⼝很⼤,但是内容很⼩上⾯的问题是需要设置浏览器显⽰⼤⼩,默认就是⽆法正常显⽰。
可以看到gmail页⾯只在左侧显⽰,右侧都是空⽩,⽹站内容并没有完整铺满chromium,底部横向滚动条拖拽还很不⽅便。
browser = await launch({'headless': False,'dumpio':True, 'autoClose':False,'args': ['--no-sandbox', '--window-size=1366,850']})await page.setViewport({'width':1366,'height':768})通过上⾯设置Windows-size和Viewport⼤⼩来实现⽹页完整显⽰。
puppet的安装和配置
Puppet学习之puppet的安装和配置一、Puppet简介Puppet基于ruby语言开发的自动化系统配置工具,可以C/S模式或独立运行,支持对所有UNIX及类UNIX系统的配置管理,最新版本也开始支持对Windows 操作系统有限的一些管理。
Puppet适用于服务器管的整个过程,比如初始安装、配置更新以及系统下线。
二、Puppet的安装Puppet的安装方式支持源码安装、yum安装以及ruby的gem安装。
官网推荐使用yum来安装puppet,方面以后的升级、管理、维护。
Centos可以采用yum 来安装,但是Centos的默认源中没有puppet包,因此需要先安装epel包。
Epel 是企业版Linux附加软件包(Extra Packages for Enterprise Linux)的缩写,是一个由特别兴趣小组创建、维护并管理的,针对红帽企业版Linux(RHEL)及其衍生发行版(比如CentOS、Scientific Linux)的一个高质量附加软件包项目。
1. Master的安装yum -y install ruby ruby-libs ruby-shadowwget ftp://ftp.sunet.se/pub/Linux/distributions/yellowdog/yum/6.2/extras/RPMS/epel-release-5-3.noarch.rpmrpm -Uvh epel-release-5-3.noarch.rpmyum -y install puppet puppet-server facter2. Agent的安装yum install ruby ruby-libs ruby-shadowwget ftp://ftp.sunet.se/pub/Linux/distributions/yellowdog/yum/6.2/extras/RPMS/epel-release-5-3.noarch.rpmrpm -Uvh epel-release-5-3.noarch.rpmyum -y install puppet facter至此如果安装过程不报错的话,puppet已经安装成功了。
PUPPET环境搭建手册精
自动化运维工具Puppet +MCollective环境搭建手册V1.0IT管理服务部2014.10.10编号日期描述版本作者审核12014.10.10创建文档1.0鞠向明目录一、Puppet 介绍 (6)1.为什么要开发puppet (6)2.作为工具的puppet (7)3.稳定性 (7)4.puppet的细节和原理 (8)5.底层支撑工具Providers (8)系96.修改系统配置 (9)7.资源之间的关218.exec 资9.puppet 语言........................................................................................................................................................... 9 1语言的其他特性. (14)11. puppet语言高级特性.................................................................................................................................. 16 1语言教程......................................................................................................................................................... 18 1典. 型的puppet使用方法.. (18)14.总结 (18)二、安装puppet (19)1.更新yum 源 (19)2.配置主机名 (19)3.安装puppet服务端...................................................................................................................................... 20安装软件包. (20)213修改主机配置文件.................................................................................................................................204配置文件服务 (21)5 启动puppet-server服务........................................................................................................................21 4.安装Puppet客户端 (21)1安装软件包 .............................................................................................................................................212配置主机名 .............................................................................................................................................213配己置puppet客户端..........................................................................................................................224启动客户端后台进程 (22)5.测试连接 (22)6.节点管理 (23)三、Puppet参考文档 (23)四、MCollective 介绍 (24)1.简点2五、安装介 (24)2.MCollective 特点2五、安装29MCollective 25 1.server 端安 2525 1安装软件包 2配置 activemq 263配置 mcollective 2627 2.client 安装配置: 2727 28 2配置客户端 3启动客户端3.查看连接情284.其他使用命六、Rsync 安 装………1. Rsy nc 介292.安装rsync (29)3.配置rsync (29)1设定/etc/rsyncd.conf (30)2 设定 /etc/rs yn cd.secretS 密 码文件 (31)3 设定 rsyn cd.motd 文件 (32)1全局定 (33)2模块定义 (34)5.启动rsync 服务器 (36)6.防火墙设置 (37)4. rsyn cd.co nf 配置文件详解 (32)7.通过rsync客户端来同步数据 (37)8.一些实例 (39)9.FAQ .......................................................................................................................................................................................................... 43七、一键安装client脚本. (47)一、Puppet介绍以下介绍来自/关于puppet各资源及其用法,请参考上述网址。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Puppet安装以及遇到的问题主机名需要能够解析,相互之间能够解析。
1、puppet master的安装puppet1)通过源代码安装2)通过二进制的安装(yum apt-get...)# wget -r ftp://192.168.0.254/notes/softwares/puppet# tar xf puppet-2.7.23.tar.bz2# cd puppet-2.7.23# yum -y localinstall puppet-server-2.7.23-1.el6.noarch.rpmpuppet-2.7.23-1.el6.noarch.rpm facter-1.6.18-3.el6.x86_64.rpmruby-augeas-0.4.1-1.el6.x86_64.rpm ruby-shadow-1.4.1-13.el6.x86_64.rpm2、在两个agnet上安装agent# cd /root/puppet-2.7.23/# yum -y localinstall puppet-2.7.23-1.el6.noarch.rpm facter-1.6.18-3.el6.x86_64.rpm ruby-augeas-0.4.1-1.el6.x86_64.rpm ruby-shadow-1.4.1-13.el6.x86_64.rpm3、配置puppet master端# rpm -ql puppet-server/etc/puppet/fileserver.conf --puppet内置的文件服务器/etc/puppet/manifests --全局的资源清单所在的目录/etc/puppet/puppetmasterd.conf --主配置文件/etc/rc.d/init.d/puppetmaster --启动脚本/etc/sysconfig/puppetmaster/usr/sbin/puppetmasterd/usr/sbin/puppetqd/usr/sbin/puppetrun/usr/share/man/man8/filebucket.8.gz/usr/share/man/man8/puppet-master.8.gz/usr/share/man/man8/puppetmasterd.8.gz/usr/share/man/man8/puppetqd.8.gz/usr/share/man/man8/puppetrun.8.gz获取帮助# puppet help# puppet xxx --help获取master的配置文件列表# puppet master --genconfig |grep -vE '(#)|^$' [master]fileserverconfig = /etc/puppet/fileserver.conf manifest = /etc/puppet/manifests/site.ppconfig = /etc/puppet/puppet.confrest_authconfig = /etc/puppet/auth.confyamldir = /var/lib/puppet/yamlreportdir = /var/lib/puppet/reportsmasterlog = /var/log/puppet/puppetmaster.logmodulepath = /etc/puppet/modules:/usr/share/puppet/modules server_datadir = /var/lib/puppet/server_datapidfile = /var/run/puppet/master.pidmanifestdir = /etc/puppet/manifestsmasterhttplog = /var/log/puppet/masterhttp.logbucketdir = /var/lib/puppet/buckethostpubkey = /var/lib/puppet/ssl/public_keys/.pem inventory_terminus = yamlpublickeydir = /var/lib/puppet/ssl/public_keysprivatedir = /var/lib/puppet/ssl/privatestatedir = /var/lib/puppet/statefactdest = /var/lib/puppet/facts/hostcert = /var/lib/puppet/ssl/certs/.pemroute_file = /etc/puppet/routes.yamllocalcacert = /var/lib/puppet/ssl/certs/ca.pemhttplog = /var/log/puppet/http.logcertdir = /var/lib/puppet/ssl/certsplugindest = /var/lib/puppet/librequestdir = /var/lib/puppet/ssl/certificate_requestsrundir = /var/run/puppetpassfile = /var/lib/puppet/ssl/private/passwordfactsource = puppet://puppet/facts/hostprivkey = /var/lib/puppet/ssl/private_keys/.pem authconfig = /etc/puppet/namespaceauth.confhostcrl = /var/lib/puppet/ssl/crl.pemssldir = /var/lib/puppet/sslpluginsource = puppet://puppet/pluginslogdir = /var/log/puppetprivatekeydir = /var/lib/puppet/ssl/private_keysfactpath = /var/lib/puppet/lib/facter:/var/lib/puppet/factslibdir = /var/lib/puppet/libhostcsr = /var/lib/puppet/ssl/csr_.pem resourcefile = /var/lib/puppet/state/resources.txtreport_port = 8140lastrunfile = /var/lib/puppet/state/last_run_summary.yamlgraphdir = /var/lib/puppet/state/graphslocalconfig = /var/lib/puppet/state/localconfigclient_datadir = /var/lib/puppet/client_datareportserver = puppetinventory_server = puppetca_server = puppetlastrunreport = /var/lib/puppet/state/last_run_report.yaml node_name_value = statefile = /var/lib/puppet/state/state.yaml puppetdlog = /var/log/puppet/puppetd.log clientbucketdir = /var/lib/puppet/clientbucketclassfile = /var/lib/puppet/state/classes.txtreport_server = puppetinventory_port = 8140ca_port = 8140puppetdlockfile = /var/lib/puppet/state/puppetdlock splaylimit = 1800clientyamldir = /var/lib/puppet/client_yamlcacert = /var/lib/puppet/ssl/ca/ca_crt.pemcacrl = /var/lib/puppet/ssl/ca/ca_crl.pemserial = /var/lib/puppet/ssl/ca/serialsigneddir = /var/lib/puppet/ssl/ca/signedcert_inventory = /var/lib/puppet/ssl/ca/inventory.txtca_name = Puppet CA: cakey = /var/lib/puppet/ssl/ca/ca_key.pem caprivatedir = /var/lib/puppet/ssl/ca/privatecapass = /var/lib/puppet/ssl/ca/private/ca.passcadir = /var/lib/puppet/ssl/cacapub = /var/lib/puppet/ssl/ca/ca_pub.pemcsrdir = /var/lib/puppet/ssl/ca/requestsautosign = /etc/puppet/autosign.conftemplatedir = /var/lib/puppet/templatestagmap = /etc/puppet/tagmail.confrrdinterval = 1800rrddir = /var/lib/puppet/rrdrailslog = /var/log/puppet/rails.logdblocation = /var/lib/puppet/state/clientconfigs.sqlite3archive_file_server = puppetdeviceconfig = /etc/puppet/device.confdevicedir = /var/lib/puppet/devicesmodule_working_dir = /var/lib/puppet/puppet-module4、一个简单的文件应用做好域名的解析工作,保证master和agent之间的域名解析是正常的,所以保证你3台机器的hosts文件都是以下的状态:# vim /etc/hosts127.0.0.1 localhost.localdomainlocalhost.localdomain localhost4localhost4.localdomain4 localhost::1localhost.localdomainlocalhost.localdomain localhost6 localhost6.localdomain6 localhost192.168.5.245 master192.168.5.225 agent1192.168.5.226 agent2服务端的配置:# vim /etc/puppet/manifests/site.pp --创建一个全局的资源清单file { "/var/tmp/abc.txt":ensure => present,owner =>youboy,group =>youboy,mode => 0600,content => "hello puppet agent";}有两种启动方式# /etc/init.d/puppetmasterd start --正常模式# puppet master --verbose --debug --no-daemonize& --调试模式两个客户端的配置:1)指定master是谁# vim /etc/puppet/puppet.conf[main]logdir = /var/log/puppetrundir = /var/run/puppetssldir = $vardir/sslserver = master --修改此行[agent]classfile = $vardir/classes.txtlocalconfig = $vardir/localconfig2)以调试模式启动agnet# /etc/init.d/puppet start --正常模式# puppet agent --server=master --verbose --no-daemonize --onetime --调试模式(此时agent会向master申请证书)3)在master上颁发证书给两个agnet# puppet cert --list --查看当前master是否已经接受到两个agent的证书请求"agent1" (2B:C3:05:08:39:C7:7F:2D:68:9E:4F:73:D6:86:27:97)"agent2" (86:26:3B:93:EC:F9:DD:ED:31:A0:76:F1:27:F6:81:99)颁发证书# puppet cert --sign agent1notice: Signed certificate request for agent1notice: Removing file Puppet::SSL::CertificateRequest agent1 at'/var/lib/puppet/ssl/ca/requests/agent1.pem'# puppet cert --sign agent2notice: Signed certificate request for agent2notice: Removing file Puppet::SSL::CertificateRequest agent2 at'/var/lib/puppet/ssl/ca/requests/agent2.pem'4)以调试模式在agent上执行puppet agent的服务# puppet agent --server=master --verbose --no-daemonize --onetime info: Caching certificate for agent2info: Caching certificate_revocation_list for cainfo: Caching catalog for agent2info: Applying configuration version '1387097919'notice: /Stage[main]//File[/var/tmp/abc.txt]/ensure: createdinfo: Creating state file /var/lib/puppet/state/state.yamlnotice: Finished catalog run in 0.04 seconds5)查看结果是否是你定义的结果# ll /var/tmp/总用量4-rw------- 1 u01 group 19 12月15 16:58 abc.txt# cat /var/tmp/abc.txthello puppet agent6)测试agent和master之间的同步(默认是30分钟)为了测试把间隔改成5秒(在两个agenet上改,不需要到master上改)# vim /etc/puppet/puppet.conf[main]logdir = /var/log/puppetrundir = /var/run/puppetssldir = $vardir/sslserver = runinterval = 5[agent]classfile = $vardir/classes.txtlocalconfig = $vardir/localconfig7)在master上配置文件服务器# vim /etc/puppet/fileserver.conf[share]path /var/tmp/fileserverallow 192.168.5.0/24# mkdir /var/tmp/fileserver# touch /var/tmp/fileserver/abc.txt8)使用共享服务器发布配置文件# vim /etc/puppet/manifests/site.pp file {"/var/tmp/abc.txt":ensure => present,owner =>youboy,group =>youboy,mode => 0600,source => "puppet:///share/abc.txt";}9)如何让不同的客户加载不同资源(在服务的资源清单上写如下内容:)# vim /etc/puppet/manifests/site.ppnode 'agent1' {file { "/var/tmp/abc.txt":ensure => present,owner =>youboy,group =>youboy,mode => 0600,content => "hello puppet agent1\nhaha\nhehe\n";}}node 'agent2' {file { "/var/tmp/bcd.txt":ensure => present,owner =>youboy,group =>youboy,mode => 0600,content => "hello puppet agent2\n";}}1、客户端想服务端发出证书申请无效,报错:# puppet agent --server=master --verbose --no-daemonize --onetime Exiting; no certificate found and waitforcert is disabled处理方法:在agent端:mv /var/lib/puppet /tmp/2、自己指定的hosts是无效的,解析不了err: Could not retrieve catalog from remote server: Server hostname 'master' did not match server certificate; expected one of 132.bogon, DNS:132.bogon, DNS:puppet, DNS:puppet.bogonnotice: Using cached catalogerr: Could not retrieve catalog; skipping runerr: Could not send report: Server hostname 'master' did not match server certificate; expected one of 132.bogon, DNS:132.bogon, DNS:puppet,DNS:puppet.bogon处理方法:删掉/var/lib/puppet/重新来过。