<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Puppet的server端與agent端的通信建立

    puppet 的安裝與配置,請看上一篇文章。
    這里默認你已經把它安裝好了。

    想讓兩臺(或N臺)機器相互通信,先要設置它們之間的Host文件。
    每一臺機器分別執行如下命令
    sudo vi /etc/hosts
    把要相互通信的所有機器的IP 和 別名添加進來。比如先以server端為例
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    10.23.10.237 puppet-server.noah.blogjava.net
    #上面可能是打開這個文件里默認的,不用管,直接在下面加agent的ip就可以了,有多少加多少。
    10.52.27.71 agent001.noah-test.net
    10.52.27.72 agent002.noah-test.net
    10.52.27.73 agent003.noah-test.net
    接下來把上面的都復制,然后,分別考到其它的機器里面。

    接下來回到agent端,配置puppet 的配置文件,執行如下命令
    sudo vi /etc/puppetlabs/puppet/puppet.conf
    在打開的文件里面填寫如下信息
    [main]
    #這個certname就是上面host里面的名字
    certname = agent001.noah-test.net
    #server 就是puppet的server的地址
    server = puppet-server.noah.blogjava.net
    environment 
    = production
    runinterval 
    = 1h


    然后在agent端,執行如下命令,向server端申請證書
    sudo /opt/puppetlabs/bin/puppet agent --test
    然后,會出現這樣的信息
    Info: Creating a new SSL key for agent01.noah-test
    Info: Caching certificate for ca
    Info: csr_attributes file loading from /etc/puppetlabs/puppet/csr_attributes.yaml
    Exiting; no certificate found and waitforcert is disabled

    證明,申請成功,等待server端同意。這時可以轉到server端,執行如下命令查看如些機器要申請證書
    sudo /opt/puppetlabs/bin/puppet cert list --all
    這里會顯示出所有申請過的和正在等待審批的agent的certname 的名字。審批通過的前面有個“+”。
    接下來執行如下命令進行單獨審批
     
    sudo /opt/puppetlabs/bin/puppet cert sign agent001.noah-test.net

    也可以直接在sgin 后面加 "--all",進行全部審批。

    審批完成后,再回到agent端,執行同樣的命令
    sudo /opt/puppetlabs/bin/puppet agent --test

    如下顯示的全是類似如下綠色的信息,證明它們之間的通信已經建立成功
    Info: Using configured environment 'production'
    Info: Retrieving pluginfacts
    Info: Retrieving plugin
    Info: Caching catalog for agent001.noah-test.net
    Info: Applying configuration version '1481877703'







    問題匯總:
    cloud@cdt-dev-cafews-yabinx:/etc/puppetlabs/puppet> sudo puppet agent -t
    Warning: Setting 'pluginsync' is deprecated.
    (at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1713:in `block in <module:Puppet>')
    Warning: Unable to fetch my node definition, but the agent run will continue:
    Warning: getaddrinfo: Name or service not known
    Info: Retrieving pluginfacts
    Error: /File[/var/lib/puppet/facts.d]: Failed to generate additional resources using 'eval_generate': getaddrinfo: Name or service not known
    Error: /File[/var/lib/puppet/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: getaddrinfo: Name or service not known
    Info: Retrieving plugin
    Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': getaddrinfo: Name or service not known
    Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: getaddrinfo: Name or service not known
    Info: Loading facts
    Error: Could not retrieve catalog from remote server: getaddrinfo: Name or service not known
    Warning: Not using cache on failed catalog
    Error: Could not retrieve catalog; skipping run
    Error: Could not send report: getaddrinfo: Name or service not known
    用的命令不對,改用這個
    sudo /opt/puppetlabs/bin/puppet agent --test



    sudo/opt/puppetlabs/bin/puppet agent --test
    Warning: Unable to fetch my node definition, but the agent run will continue:
    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
    Info: Retrieving pluginfacts
    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
    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
    Info: Retrieving plugin
    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
    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
    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
    Warning: Not using cache on failed catalog
    Error: Could not retrieve catalog; skipping run
    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
    其實它已經告訴你了,改一下/etc/hosts就可以了,改成下面的其中一個
    expected one of cdt-dev-cafews-yabinx.emea1.cis.trcloud, DNS:puppet, DNS:cdt-dev-cafews-yabinx.emea1.cis.trcloud




    sudo /opt/puppetlabs/bin/puppet agent --test
    Warning: Unable to fetch my node definition, but the agent run will continue:
    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]
    Info: Retrieving pluginfacts
    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]
    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]
    Info: Retrieving plugin
    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]
    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]
    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]
    Warning: Not using cache on failed catalog
    Error: Could not retrieve catalog; skipping run
    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]
    一般這種情況就是由于某種原因沒有認證沒有成功,但它又不會重新認證了,所以就報這個錯誤,解決辦法是到這個目錄下/etc/puppetlabs/puppet,把生成的ssl文件夾給刪除,讓它重新生成一次key。如果生成一次還沒有成功的話,你要看一下是不是其它地方的問題,然后,要重新重復上面的步驟,重新生成密鑰。



    眼鏡蛇

    posted on 2016-12-16 17:09 眼鏡蛇 閱讀(1868) 評論(0)  編輯  收藏 所屬分類: JavaPuppet

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導航

    統計

    常用鏈接

    留言簿(6)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 久久亚洲2019中文字幕| 亚洲熟女www一区二区三区| 老司机午夜免费视频| 免费A级毛片av无码| 亚洲精品国产综合久久一线| 亚洲三级在线观看| 无码人妻久久一区二区三区免费 | 亚洲影院天堂中文av色| 午夜无码A级毛片免费视频| 亚洲国产主播精品极品网红| 中文字幕亚洲精品无码| 免费无码又爽又刺激高潮视频| 久99精品视频在线观看婷亚洲片国产一区一级在线 | 毛片免费全部播放一级| 亚洲国产美国国产综合一区二区| 一级**爱片免费视频| 在线a毛片免费视频观看| 亚洲一级毛片免费看| 青青草无码免费一二三区| 亚洲人成人无码网www电影首页| 精品成人一区二区三区免费视频| 免费精品人在线二线三线区别| 亚洲男人的天堂在线播放| 国产日韩AV免费无码一区二区| 亚洲国产成人久久一区久久| 亚洲.国产.欧美一区二区三区| 成人免费AA片在线观看| 亚洲成人黄色在线观看| 久久中文字幕免费视频| 亚洲精品自在在线观看| 一级成人a免费视频| 亚洲AV无码一区二区三区国产| 亚洲av成人中文无码专区| 三年片在线观看免费观看高清电影| 亚洲高清美女一区二区三区| 今天免费中文字幕视频| 亚洲欧洲无码AV电影在线观看| 国产福利电影一区二区三区,免费久久久久久久精 | 亚洲乱亚洲乱妇无码麻豆| 皇色在线免费视频| 相泽亚洲一区中文字幕|