日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

puppet安装

發(fā)布時間:2023/12/9 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 puppet安装 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一.? 服務(wù)器端和客戶端都需要做的操作。
1.?下載軟件
wget http://puppetlabs.com/downloads/facter/facter-1.6.4.tar.gz
?? wget http://downloads.puppetlabs.com/puppet/puppet-2.7.9.tar.gz
2.?安裝ruby? puppet是ruby開發(fā)的,所以需要安裝。
Yum?? -y install ruby
3.?安裝facter?
Ruby? install.rb
4.?安裝puppet?? 安裝都非常快。不到1分鐘。
Ruby? install.rb
5.?同步時間
?cp /usr/share/zoneinfo/Asia/Shanghai? /etc/localtime
/usr/sbin/ntpdate time.nist.gov
二.?服務(wù)器端的操作。
1.?創(chuàng)建目錄,拷貝文件等。
mkdir /etc/puppet
cp conf/auth.conf /etc/puppet/
cp conf/redhat/fileserver.conf /etc/puppet/
cp conf/redhat/puppet.conf /etc/puppet/
cp conf/redhat/server.init /etc/init.d/puppetmaster
chmod 755 /etc/init.d/puppetmaster
chkconfig --add puppetmaster
chkconfig puppetmaster on
mkdir -p /etc/puppet/manifests
2.?創(chuàng)建puppet帳戶
puppetmasterd --mkusers
3.?建立相應(yīng)的目錄
mkdir /var/lib/puppet/rrd/
chown puppet.puppet /var/lib/puppet/rrd/
4.?啟動服務(wù) /etc/init.d/puppetmaster start
三.?客戶端端的操作
1.?創(chuàng)建目錄,拷貝文件等
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/client.init /etc/init.d/puppet
chmod 755 /etc/init.d/puppet
chkconfig --add puppet
chkconfig puppet on
2.?創(chuàng)建puppet用戶和組
puppetd –mkusers ;如果報錯,則手工建立puppet用戶和組(puppet放到puppet組)
3.?創(chuàng)建目錄
mkdir /var/lib/puppet/rrd
??? chown puppet.puppet /var/lib/puppet/rrd
四. 測試
1. 客戶端執(zhí)行puppetd --test --server server.puppet.com發(fā)送認(rèn)證請求
[root@localhost puppet-2.7.9]# puppetd --test --server server.puppet.com
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for ca
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
info: Creating a new SSL certificate request for localhost.localdomain
info: Certificate Request fingerprint (md5): C5:76:BF:68:12:82:BD:42:86:0F:28:16:1B:6A:75:DD
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
Exiting; no certificate found and waitforcert is disabled
2. 服務(wù)器端執(zhí)行puppetca -s -a
[root@biansongshan-d1 soft]# puppetca -s –a發(fā)送接受請求。
notice: Signed certificate request for localhost.localdomain
notice: Removing file Puppet::SSL::CertificateRequest localhost.localdomain at '/var/lib/puppet/ssl/ca/requests/localhost.localdomain.pem'
3.?客戶端再次發(fā)送請求puppetd --test --server server.puppet.com
[root@localhost puppet-2.7.9]# puppetd --test --server server.puppet.com
info: Caching certificate_revocation_list for ca
info: Caching catalog for localhost.localdomain
info: Applying configuration version '1325218033'
info: Creating state file /var/lib/puppet/state/state.yaml
notice: Finished catalog run in 0.04 seconds
出現(xiàn)上面信息表示server端已接受請求,連接成功。如果報下面錯誤
[root@localhost puppet-2.7.9]# puppetd --test --server server.puppet.com
err: Could not retrieve catalog from remote server: hostname not match with the server certificate
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
err: Could not send report: hostname not match with the server certificate
則需要修改服務(wù)器的主機(jī)名和本機(jī)的hosts解析。
五. 實際舉例子
到這里證明puppet的基本設(shè)置已經(jīng)沒有問題了;下面舉一個例子:
1.?現(xiàn)在在服務(wù)器的/etc/puppet/manifests/建立site.pp里面放置如下內(nèi)容
node default {
file{"/tmp/a.txt":
content => "helo,I am abc.bbb!abc.aaa \n bbbbbb \n cccc \n dddd \n",
ensure? => present,
mode => 644,
owner => root,
group => root,
}
}
2.?在客戶端上執(zhí)行puppetd --test --server server.puppet.com可以發(fā)現(xiàn)/tmp/會生成a.txt文件,內(nèi)容是content里面的內(nèi)容。
?[root@localhost ~]# cat /tmp/a.txt
helo,I am abc.bbb!abc.aaa
?bbbbbb
?cccc
?dddd
到這里就已經(jīng)完全ok了。
?

總結(jié)

以上是生活随笔為你收集整理的puppet安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。