<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 理解 Puppet 的錯誤信息 停一停!下面是解決錯誤的時間。Puppet 的錯誤消息會令人困惑, 有時不會包含關于如何解決問題的實質信息。 #### 操作步驟 往往第一步是根據錯誤消息的文本搜索網頁,看看你能找到的關于此錯誤的解釋, 并根據這些有益的建議來修復錯誤。 下面是一些常見的令人費解的錯誤以及盡可能明確的解釋: * Could not evaluate: Could not retrieve information from source(s) 這意味著你為 source 參數指定的一個文件沒有被 Puppet 發現。 請檢查該文件是否存在,同時檢查資源路徑是否正確。 * change from absent to file failed: Could not set file on ensure: No such file or directory 經常導致這一錯誤的原因是,Puppet 試圖在某目錄中寫文件,而此目錄不存在。 檢查該目錄是否存在或者已經在 Puppet 中被定義, 以及該目錄是否為文件資源所要求的目錄(這樣的目錄總是要首先創建的)。 * undefined method ‘closed?’ for nil:NilClass 這種無用的錯誤消息相當于“出錯了”。 這種錯誤往往可以由許多不同的原因引起, 但你可以進一步檢查哪個資源、哪個類或哪個模塊所引起的。 一個訣竅是添加 --debug 開關運行 puppet 從而獲得更多有用的信息: ``` # puppet agent --test --debug ``` 你也可以檢查 Git 的歷史日志看看最近配置清單是否有改動, 這可能是另一種方式來確定是什么擾亂了 Puppet 的正常工作。 * Could not parse for environment --- "--- production": Syntax error at end of file at line 1 這可能是由于命令行選項輸入錯誤引起的:例如,你輸入了 puppet -verbose 而不是 puppet --verbose 。這種錯誤一般是很難被發現的。 * Could not request certificate: Retrieved certificate does not match private key; please remove certificate from server and regenerate it with the current key 可能是節點的 SSL 主機密鑰已經改變,或 Puppet 的 SSL 目錄已被刪除, 又或者你試圖用與已存在的節點主機名請求新證書。 一般而言,最簡單的解決方法是先從客戶端刪除 Puppet 的 SSL 目錄(通常是 /etc/puppet/ssl) 之后在 Puppetmaster 上運行 puppet cert --clean &lt;nodename&gt; 。 然后再次運行 Puppet,生成正確的證書請求。 * Could not retrieve catalog from remote server: wrong header line format 通常這種錯誤是在編譯模板時出現的。如果在你的 ERB 上有語法錯誤,就會看到類似的信息, 如下面的代碼片段: ``` rails_env &lt;%!= app_env %&gt; ``` * Duplicate definition: X is already defined in [file] at line Y; cannot redefine at [file] line Y 這曾經引起我的困惑。Puppet 抱怨有重復的資源定義,通常如果你有兩個同名的資源, Puppet 將會幫忙告訴你兩者都定義了。 但在這種情況下,它指出了相同的文件和行號。 一個資源怎么可能是其自身的副本呢? 答案是:若它是 define,就會出現這種情況的錯誤。如果你對一個 define 創建了兩個實例, 并且兩個實例的所有資源都包含在這個 define 中,他們需要有不同的名字。例如: ``` define check_process() { exec { "is-process-running?": command =&gt; "/bin/ps ax |/bin/grep ${name} &gt;/tmp/ pslist.${name}.txt", } } check_process { "exim": } check_process { "nagios": } ``` ``` # puppet agent --test info: Retrieving plugin err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate definition: Exec[is-process-running?] is already defined in file /etc/puppet/manifests/nodes.pp at line 22; cannot redefine at /etc/puppet/manifests/nodes.pp:22 on node cookbook. bitfieldconsulting.com warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run ``` 因為 exec 資源被命名為 is-process-running。 不管你傳遞什么參數到 define,都會保持這個相同的名字, Puppet 會拒絕創建它的兩個實例。 解決方法是在每個資源的標題部分包含實例的名字,如下所示: ``` exec { "is-process-${name}-running?": command =&gt; "/bin/ps ax |/bin/grep ${name} &gt; /tmp/pslist.${name}.txt", } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看