﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Noah-文章分类-Puppet</title><link>http://www.blogjava.net/noah/category/55143.html</link><description>&lt;span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri" lang="ZH-CN"&gt;不是经典我不发&lt;/span&gt;</description><language>zh-cn</language><lastBuildDate>Thu, 19 Jan 2017 14:15:44 GMT</lastBuildDate><pubDate>Thu, 19 Jan 2017 14:15:44 GMT</pubDate><ttl>60</ttl><item><title>编写第一个Puppet Module(puppet code)</title><link>http://www.blogjava.net/Noah/articles/432264.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Mon, 16 Jan 2017 08:25:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/432264.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/432264.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/432264.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/432264.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/432264.html</trackback:ping><description><![CDATA[<div>当你试着写这个小例子的时候，那你肯定已经把Puppet Server 和 Agent的环境都搭建好了。<br /><br />所以这里我们直接进入主题<br />Puppet 默认写Module的路径是这里，所以请直接进入这个目录下
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">cd&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">etc</span><span style="color: #000000">/</span><span style="color: #000000">puppetlabs</span><span style="color: #000000">/</span><span style="color: #000000">code</span><span style="color: #000000">/</span><span style="color: #000000">environments</span><span style="color: #000000">/</span><span style="color: #000000">production</span><span style="color: #000000">/</span><span style="color: #000000">modules</span></div>接下来建立以下目录结构<br /><br />&#9492;&#9472;&#9472; helloworld<br />&nbsp;&nbsp;&nbsp; &#9492;&#9472;&#9472; manifests<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#9500;&#9472;&#9472; init.pp<br /><br />然后，用vi 命令，打开init.pp文件，写入如下内容
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;helloworld&nbsp;{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;notify&nbsp;{&nbsp;</span><span style="color: #800000">'</span><span style="color: #800000">hello,&nbsp;world!&nbsp;installed&nbsp;by&nbsp;puppet</span><span style="color: #800000">'</span><span style="color: #000000">:&nbsp;}<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;}</span></div>按ESC，再按":wq",退出编辑器。<br /><br />然后，后退。或直接进入到下面的目录
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">cd&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">etc</span><span style="color: #000000">/</span><span style="color: #000000">puppetlabs</span><span style="color: #000000">/</span><span style="color: #000000">code</span><span style="color: #000000">/</span><span style="color: #000000">environments</span><span style="color: #000000">/</span><span style="color: #000000">production/manifests</span></div><br />新建或打开site.pp文件，写入如下内容。
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">node&nbsp;default{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;{&nbsp;</span><span style="color: #800000">'</span><span style="color: #800000">helloworld</span><span style="color: #800000">'</span><span style="color: #000000">:&nbsp;}<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #008000">#</span><span style="color: #008000">class&nbsp;{&nbsp;'helloworld::motd':&nbsp;}</span><span style="color: #008000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;</span><span style="color: #008000">#</span><span style="color: #008000">class&nbsp;{&nbsp;'tomcat8':&nbsp;}</span><span style="color: #008000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;</span><span style="color: #008000">#</span><span style="color: #008000">class&nbsp;{&nbsp;'puppetlabs-apache':&nbsp;&nbsp;}</span><span style="color: #008000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">}<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div><br />其实，就是前两行启作用，后面的可以忽略。这也意味着，以后会写一下怎么写安装tomcat 和 部署应用的例子。<br />写完这些后，到Agent端执行 sudo puppet agent -t. 如果没有错误的话，屏幕上会出现，之前写的那句话。<br /><br /></div><img src ="http://www.blogjava.net/Noah/aggbug/432264.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2017-01-16 16:25 <a href="http://www.blogjava.net/Noah/articles/432264.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Puppet的server端与agent端的通信建立</title><link>http://www.blogjava.net/Noah/articles/432131.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Fri, 16 Dec 2016 09:09:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/432131.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/432131.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/432131.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/432131.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/432131.html</trackback:ping><description><![CDATA[puppet 的安装与配置，请看上一篇文章。<br />这里默认你已经把它安装好了。<br /><br />想让两台(或N台)机器相互通信，先要设置它们之间的Host文件。<br />每一台机器分别执行如下命令 
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">sudo&nbsp;vi&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">etc</span><span style="color: #000000">/</span><span style="color: #000000">hosts</span></div>把要相互通信的所有机器的IP 和 别名添加进来。比如先以server端为例 
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #800000">127.0</span><span style="color: #000000">.</span><span style="color: #800000">0.1</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;localhost&nbsp;localhost</span><span style="color: #000000">.</span><span style="color: #000000">localdomain&nbsp;localhost4&nbsp;localhost4</span><span style="color: #000000">.</span><span style="color: #000000">localdomain4<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">::</span><span style="color: #800000">1</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;localhost&nbsp;localhost</span><span style="color: #000000">.</span><span style="color: #000000">localdomain&nbsp;localhost6&nbsp;localhost6</span><span style="color: #000000">.</span><span style="color: #000000">localdomain6<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #800000">10.23</span><span style="color: #000000">.</span><span style="color: #800000">10.237</span><span style="color: #000000">&nbsp;puppet</span><span style="color: #000000">-</span><span style="color: #000000">server</span><span style="color: #000000">.</span><span style="color: #000000">noah</span><span style="color: #000000">.</span><span style="color: #000000">blogjava</span><span style="color: #000000">.</span><span style="color: #000000">net<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">#</span><span style="color: #008000">上面可能是打开这个文件里默认的，不用管，直接在下面加agent的ip就可以了,有多少加多少。</span><span style="color: #008000"><br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #800000">10.52</span><span style="color: #000000">.</span><span style="color: #800000">27.71</span><span style="color: #000000">&nbsp;agent001</span><span style="color: #000000">.</span><span style="color: #000000">noah</span><span style="color: #000000">-</span><span style="color: #000000">test</span><span style="color: #000000">.</span><span style="color: #000000">net<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #800000">10.52</span><span style="color: #000000">.</span><span style="color: #800000">27.72</span><span style="color: #000000">&nbsp;agent002</span><span style="color: #000000">.</span><span style="color: #000000">noah</span><span style="color: #000000">-</span><span style="color: #000000">test</span><span style="color: #000000">.</span><span style="color: #000000">net<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #800000">10.52</span><span style="color: #000000">.</span><span style="color: #800000">27.73</span><span style="color: #000000">&nbsp;agent003</span><span style="color: #000000">.</span><span style="color: #000000">noah</span><span style="color: #000000">-</span><span style="color: #000000">test</span><span style="color: #000000">.</span><span style="color: #000000">net<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span></div>接下来把上面的都复制，然后，分别考到其它的机器里面。<br /><br />接下来回到agent端，配置puppet 的配置文件，执行如下命令<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />sudo <span style="color: #000000">vi&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">etc</span><span style="color: #000000">/</span><span style="color: #000000">puppetlabs</span><span style="color: #000000">/</span><span style="color: #000000">puppet</span><span style="color: #000000">/</span><span style="color: #000000">puppet</span><span style="color: #000000">.</span><span style="color: #000000">conf</span></div>在打开的文件里面填写如下信息<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> 
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000">[main]<br /><img alt="" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">#</span><span style="color: #008000">这个certname就是上面host里面的名字</span><span style="color: #008000"><br /><img alt="" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">certname&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;agent001</span><span style="color: #000000">.</span><span style="color: #000000">noah</span><span style="color: #000000">-</span><span style="color: #000000">test</span><span style="color: #000000">.</span><span style="color: #000000">net<br /><img alt="" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">#</span><span style="color: #008000">server&nbsp;就是puppet的server的地址</span><span style="color: #008000"><br /><img alt="" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">server&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;puppet</span><span style="color: #000000">-</span><span style="color: #000000">server</span><span style="color: #000000">.</span><span style="color: #000000">noah</span><span style="color: #000000">.</span><span style="color: #000000">blogjava</span><span style="color: #000000">.</span><span style="color: #000000">net<br /><img alt="" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" align="top" />environment&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;production<br /><img alt="" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" align="top" />runinterval&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;1h</span></div><br /><br />然后在agent端，执行如下命令，向server端申请证书<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">sudo&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">opt</span><span style="color: #000000">/</span><span style="color: #000000">puppetlabs</span><span style="color: #000000">/</span><span style="color: #000000">bin</span><span style="color: #000000">/</span><span style="color: #000000">puppet&nbsp;agent&nbsp;</span><span style="color: #000000">--</span>test</div><span style="color: #33cccc">然后，会出现这样的信息</span><br /><span style="color: #33cccc">Info: Creating a new SSL key for agent01.noah-test</span><br /><span style="color: #33cccc">Info: Caching certificate for ca</span><br /><span style="color: #33cccc">Info: csr_attributes file loading from /etc/puppetlabs/pu</span><span style="color: #33cccc">ppet/csr_</span><span style="color: #33cccc">att</span>ributes.yaml<br />Exiting; no certificate found and waitforcert is disabled<br /><br />证明，申请成功，等待server端同意。这时可以转到server端，执行如下命令查看如些机器要申请证书 
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">sudo&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">opt</span><span style="color: #000000">/</span><span style="color: #000000">puppetlabs</span><span style="color: #000000">/</span><span style="color: #000000">bin</span><span style="color: #000000">/</span><span style="color: #000000">puppet&nbsp;cert&nbsp;list&nbsp;</span><span style="color: #000000">--</span><span style="color: #000000">all</span></div>这里会显示出所有申请过的和正在等待审批的agent的certname 的名字。审批通过的前面有个&#8220;+&#8221;。<br />接下来执行如下命令进行单独审批<br />&nbsp; 
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">sudo&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">opt</span><span style="color: #000000">/</span><span style="color: #000000">puppetlabs</span><span style="color: #000000">/</span><span style="color: #000000">bin</span><span style="color: #000000">/</span><span style="color: #000000">puppet&nbsp;cert&nbsp;sign&nbsp;agent001</span><span style="color: #000000">.</span><span style="color: #000000">noah</span><span style="color: #000000">-</span><span style="color: #000000">test</span><span style="color: #000000">.</span><span style="color: #000000">net<br /><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span></div><br />也可以直接在sgin 后面加 "--all",进行全部审批。<br /><br />审批完成后，再回到agent端，执行同样的命令<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">sudo&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">opt</span><span style="color: #000000">/</span><span style="color: #000000">puppetlabs</span><span style="color: #000000">/</span><span style="color: #000000">bin</span><span style="color: #000000">/</span><span style="color: #000000">puppet&nbsp;agent&nbsp;</span><span style="color: #000000">--</span><span style="color: #000000">test</span></div><br />如下显示的全是类似如下绿色的信息，证明它们之间的通信已经建立成功<br />
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #00b050">Info: Using configured environment 'production'</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #00b050">Info: Retrieving pluginfacts</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #00b050">Info: Retrieving plugin</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #00b050">Info: Caching catalog for agent001<span style="color: #33cccc">.</span><span style="color: #33cccc">noah</span><span style="color: #33cccc">-</span><span style="color: #33cccc">test</span><span style="color: #33cccc">.</span><span style="color: #33cccc">net</span></span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #00b050">Info: Applying configuration version '1481877703'</span></div><br /><br /><br /><br /><br /><br /><br />问题汇总：<br /> 
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">cloud@cdt-dev-cafews-yabinx:/etc/puppetlabs/puppet&gt; sudo puppet agent -t</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Setting 'pluginsync' is deprecated.</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">(at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1713:in `block in &lt;module:Puppet&gt;')</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Unable to fetch my node definition, but the agent run will continue:</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: getaddrinfo: Name or service not known</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Info: Retrieving pluginfacts</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/var/lib/puppet/facts.d]: Failed to generate additional resources using 'eval_generate': getaddrinfo: Name or service not known</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/var/lib/puppet/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: getaddrinfo: Name or service not known</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Info: Retrieving plugin</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': getaddrinfo: Name or service not known</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: getaddrinfo: Name or service not known</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Info: Loading facts</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not retrieve catalog from remote server: getaddrinfo: Name or service not known</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Not using cache on failed catalog</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not retrieve catalog; skipping run</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not send report: getaddrinfo: Name or service not known</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="font-weight: bold">用的命令不对，改用这个</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph">sudo /opt/puppetlabs/bin/puppet agent --test</div><br /><br /><br /> 
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">sudo/opt/puppetlabs/bin/puppet agent --test</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Unable to fetch my node definition, but the agent run will continue:</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Server hostname 'cdt-dev-cafews-yabinx' did not match server certificate; expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Info: Retrieving pluginfacts</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': Server hostname 'cdt-dev-cafews-yabinx' did not match server certificate; expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Server hostname 'cdt-dev-cafews-yabinx' did not match server certificate; expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Info: Retrieving plugin</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': Server hostname 'cdt-dev-cafews-yabinx' did not match server certificate; expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Server hostname 'cdt-dev-cafews-yabinx' did not match server certificate; expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not retrieve catalog from remote server: Server hostname 'cdt-dev-cafews-yabinx' did not match server certificate; expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Not using cache on failed catalog</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not retrieve catalog; skipping run</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not send report: Server hostname 'cdt-dev-cafews-yabinx' did not match server certificate; expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="font-weight: bold">其实它已经告诉你了，改一下/etc/hosts就可以了，改成下面的其中一个</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000"></span>expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud</div><br /><br /><br /><br /> 
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">sudo /opt/puppetlabs/bin/puppet agent --test</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Unable to fetch my node definition, but the agent run will continue:</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=cdt-dev-cafews-yabinx2.emea1.cis.trcloud]</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Info: Retrieving pluginfacts</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=cdt-dev-cafews-yabinx2.emea1.cis.trcloud]</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=cdt-dev-cafews-yabinx2.emea1.cis.trcloud]</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Info: Retrieving plugin</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=cdt-dev-cafews-yabinx2.emea1.cis.trcloud]</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=cdt-dev-cafews-yabinx2.emea1.cis.trcloud]</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=cdt-dev-cafews-yabinx2.emea1.cis.trcloud]</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Warning: Not using cache on failed catalog</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not retrieve catalog; skipping run</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Error: Could not send report: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate for /CN=cdt-dev-cafews-yabinx2.emea1.cis.trcloud]</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="font-weight: bold">一般这种情况就是由于某种原因没有认证没有成功，但它又不会重新认证了，所以就报这个错误，解决办法是到这个目录下/etc/puppetlabs/puppet，把生成的ssl文件夹给删除，让它重新生成一次key。如果生成一次还没有成功的话，你要看一下是不是其它地方的问题，然后，要重新重复上面的步骤，重新生成密钥。</span></div><br /><img src ="http://www.blogjava.net/Noah/aggbug/432131.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2016-12-16 17:09 <a href="http://www.blogjava.net/Noah/articles/432131.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Puppet的安装与配置</title><link>http://www.blogjava.net/Noah/articles/432127.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 15 Dec 2016 09:04:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/432127.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/432127.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/432127.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/432127.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/432127.html</trackback:ping><description><![CDATA[在安装之前，先简单说一下Puppet的构成。Puppet分为两部分，一部分叫Puppet Server 也叫 Puppet Master， 新版本好像开始叫Server了。另一部分，叫Agent。为什么叫做一部分，而不叫一个，道理很简单，就是可以有多台。好了费话不多说正式开始<br />先确定一下自己的系统版本，可以通过执行下面的命令查看：<br />
<div>
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->cat&nbsp;/etc/redhat-release</div></div>如果是Enterprise Linux 7就执行这句<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->sudo&nbsp;rpm&nbsp;-Uvh&nbsp;https://yum.puppetlabs.com/puppetlabs-release-pc1-el-<span style="color: #800000">7</span>.noarch.rpm</div>Enterprise Linux 6<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->sudo&nbsp;rpm&nbsp;-Uvh&nbsp;https://yum.puppetlabs.com/puppetlabs-release-pc1-el-<span style="color: #800000">6</span>.noarch.rpm</div>Ubuntu 16.04 Xenial Xerus<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->wget&nbsp;https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb<br />sudo&nbsp;dpkg&nbsp;-i&nbsp;puppetlabs-release-pc1-xenial.deb<br />sudo&nbsp;apt&nbsp;update</div>
<div>Ubuntu 15.10 Wily Werewolf</div>
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->wget&nbsp;https://apt.puppetlabs.com/puppetlabs-release-pc1-wily.deb<br />sudo&nbsp;dpkg&nbsp;-i&nbsp;puppetlabs-release-pc1-wily.deb<br />sudo&nbsp;apt&nbsp;update</div>
<div>Ubuntu 14.04 Trusty Tahr</div>
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->wget&nbsp;https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb<br />sudo&nbsp;dpkg&nbsp;-i&nbsp;puppetlabs-release-pc1-trusty.deb<br />sudo&nbsp;apt-get&nbsp;update</div>
<div>Ubuntu 12.04 Precise Pangolin</div>
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->wget&nbsp;https://apt.puppetlabs.com/puppetlabs-release-pc1-precise.deb<br />sudo&nbsp;dpkg&nbsp;-i&nbsp;puppetlabs-release-pc1-precise.deb<br />sudo&nbsp;apt-get&nbsp;update</div>
<div>Debian 8 Jessie</div>
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->wget&nbsp;https://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb<br />sudo&nbsp;dpkg&nbsp;-i&nbsp;puppetlabs-release-pc1-jessie.deb<br />sudo&nbsp;apt-get&nbsp;update</div>
<div>Debian 7 Wheezy</div>
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->wget&nbsp;https://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb<br />sudo&nbsp;dpkg&nbsp;-i&nbsp;puppetlabs-release-pc1-wheezy.deb<br />sudo&nbsp;apt-get&nbsp;update</div><br />如果遇到这个错误，应该是你的rpm没有设置代理，请看文章结尾错误汇总<br /><span style="color: #ff0000">curl: (7) couldn't connect to host</span><br /><br />接下来用YUM安装<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->sudo yum&nbsp;install&nbsp;puppetserver</div>或<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->apt-get&nbsp;install&nbsp;puppetserver</div><br />遇到这个错误是YUM没有设置代理，文章结尾问题汇总 
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">28, 'connect() timed out!'</span><br /><br />接下来就可以正常启动了<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->sudo service&nbsp;puppetserver&nbsp;start</div><br />可以通过如下命令查看是否启动成功<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->sudo service&nbsp;puppetserver&nbsp;status</div><br />默认它会分配2G内存，需要调整的话，可以在这里<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->/etc/sysconfig/puppetserver -- RedHeat<br />
<div>/etc/default/puppetserver &nbsp;-- Debian</div></div><br /><br />接下来在另外一台器上安装agent<br />用相同的方法先下载资源包，sudo rpm xxxx,等 。<br />然后，安装agent<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->sudo&nbsp;yum&nbsp;install&nbsp;puppet</div>通过如下命令启动agent<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->sudo&nbsp;service&nbsp;puppet start</div>通过如下命令查看是否启动成功<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->service&nbsp;puppet&nbsp;status</div><br /><br /><br /><br /></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">Retrieving https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">curl: (7) couldn't connect to host</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="color: #ff0000">error: skipping https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm - transfer failed</span></div>
<div style="font-size: 14px; white-space: pre-wrap; text-align: left; line-height: 1.875" yne-bulb-block="paragraph"><span style="font-weight: bold">sudo rpm -Uvh --httpproxy http://webproxy.lon.corp.services --httpport 80 </span><a href="https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm"><span style="text-decoration: underline; font-weight: bold; color: #0000ff">https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm</span></a></div><br /><br />在安装过程中，如果Yum不能下载的话，可能没有设置代理， 
<div>执行 sudo vi /etc/yum.conf 然后加上代理</div>
<div>proxy=http://xxxxxxxxxx:80<br /><br />
<div style="white-space: pre-wrap; line-height: 1.875" yne-bulb-block="paragraph">puppet 默认使用8140，查看产端口占用情况<br />
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->sudo&nbsp;netstat&nbsp;-nlatp&nbsp;|&nbsp;<span style="color: #0000ff">grep</span>&nbsp;<span style="color: #800000">8140</span></div><br /><br /><br /></div></div><img src ="http://www.blogjava.net/Noah/aggbug/432127.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2016-12-15 17:04 <a href="http://www.blogjava.net/Noah/articles/432127.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>