2015-06-04 154 views
1

我在兩個虛擬機(一個主站和一個節點)安裝木偶企業。當我嘗試用木偶代理手動運行我的經紀人-ti得到錯誤木偶:服務器主機名不匹配服務器證書

Server hostname '192.168....' did not match server certificate; expected one of host-192-168-.....localdomain. 

如果我加入--server host-192-168.....localdomain它的工作原理運行它,但這種方式我可以手動和自身runInterval後,做到這一點並不在我的傀儡控制檯上工作,它表示它沒有反應。我想這是因爲它自己得到了我之前提到的錯誤,所以我的主人無法從此節點接收任何報告。

有人可以幫助我嗎?我怎樣才能讓我的節點的代理與正確的服務器證書名稱的主人聯繫?從節點

puppet.conf:

[main] 

vardir = ... 
logdir = ... 
rundir = ... 
basemodulepath = ... 
user = ... 
group = ... 
archive_files = ... 

[agent] 

report = ... 
classfile = ... 
localconfig = ... 
graph = ... 
pluginsync = ... 
environment = ... 
server = 192.168.10.39 
certname = 192.168.10.40 
noop = true 
runinterval = 1800 

如果我把服務器=主機-...(主)沒有什麼變化。我想,我不能改變從[代理]部分,因爲應該有主IP(我相信)......

我想那是什麼鏈接,現在我的傀儡代理-t不在服務器在我的節點上做任何事情。爲了更好的understandig,我是從主張貼我puppet.conf:

[main] 

certname = host-192-168-10-39.localdomain 
vardir = /var/opt/lib/pe-puppet 
logdir = /var/log/pe-puppet 
rundir = /var/run/pe-puppet 
basemodulepath = /opt/alu/deploy/puppet/modules:/etc/puppetlabs/puppet.... 
environmentpath = /opt/alu/deploy/puppet/environments 
server = 192.168.10.39 
user = pe-puppet 
group = pe-puppet 
archive_files = true 
archive_files_server = 192.168.10.39 
module_groups = base+pe_only 
dns_alt_names = puppet 

[agent] 

report = true 
classfile = $vardir/classes.txt 
localconfig = $vardir/localconfig 
graph = true 
pluginsync = true 
environment = production 
noop = true 
runinterval = 1800 

[master] 

node_terminus = classfier 
ca_server = host-192-168-10-39.localdomain 
reports = console,puppetdb 
storeconfigs = true 
storeconfigs_backend = puppetdb 
certname = 192-168-10-39.localdomain 
server = 192.168.10.39 
always_cache_features = true 
default_manifest = /opt/alu/deploy/puppet/manifests/default.pp 

從木偶代理錯誤-t:http://i62.tinypic.com/34ijlmu.png

回答

1

有多種原因針對此問題,請列出您的puppet.conf。

但是從頂端看,它看起來像是由主服務器生成的證書中的名稱與服務器的主機名稱之間的一些不匹配。也許在生成證書並重新啓動時,主機名已被更改,因爲主機名更改有時在重新啓動後纔會生效。

puppetlabs官方文件建立有助於解決這個問題,請點擊此鏈接:https://docs.puppetlabs.com/guides/troubleshooting.html?_ga=1.110966791.343491524.1432986084#agents-are-failing-with-a-hostname-was-not-match-with-the-server-certificate-error-whats-wrong。這可能與在/ etc/puppet/conf中設置certname值並重新啓動主服務器一樣簡單。

+0

我試着你說的話和我的傀儡代理-t停止工作....所以我扭轉了一切。我使用master和node中的兩個puppet.conf編輯了我的問題,以便更好地觀察。請幫忙:) – Robert

+0

嘿@Robert在鏈接指導中,可以請保留certname和hostname(我看着你的puppet.conf文件)相同的192-168-10-39.localdomain。我建議再次執行這些步驟,我相信你可以解決它,因爲你的puppet.conf與puppetlabs文檔鏈接中提到的完全相反。 – user3278897

+0

@Robert,只是一個補充,如果您從代理中刪除/ssl public_keys並在服務器上執行「puppet cert clean #against clients」,那就太好了。並開始讓這個工作。羅伯特請隨時添加一個便條,我可以理解這些都是可悲的問題。 – user3278897

1

而是在命令行上發出--server的,只是添加添加server=...在代理的puppet.conf文件的[main]部分。

+0

@Robert請不要在評論中分享它。如有需要,請將其添加到您的問題中。 –

+0

謝謝。我會記住這個;) – Robert

相關問題