标签:自动化运维 注意 关闭 serve 客户端 管理员 tin 时间 erb
Puppet原理Puppet的目录是让管理员只集中于要管理的目标,而忽略实现的细节。Puppet即可以运行在单机上,也可以以C/S结构使用。在大规模使用puppet的情况下,通常使用C/S结构,在这种结构中puppet客户端只运行puppeclient,puppet服务端只运行puppemaster。
使用四台服务器模拟搭建Puppet环境
NTPserver:192.168.1.25
puppetmaster:192.168.1.26
puppetclient1:192.168.1.27
puppetclient2:192.168.1.28
vim /etc/hostname
NTPserver(puppetmaster,puppetclient1,puppetclient2)
init 6
systemctl stop firewalld.service
setenforce 0
vim /etc/hosts
192.168.1.26 puppetmaster
192.168.1.27 puppetclient1
192.168.1.28 puppetclient2
yum install ntp -y //安装NTP
vim /etc/ntp.conf //编辑配置文件
server 127.127.1.0
fudge 127.127.1.0 stratum 8
systemctl enable ntpd.service
systemctl start ntpd.service //开启ntpd服务
ntpstat //查看时间同步状态
yum install ntpdate -y //安装ntp客户端
ntpdate 192.168.1.25 //进行时间同步
yum install puppet-server -y //安装puppet服务端
systemctl enable puppetmaster.service
systemctl start puppetmaster.service //启动puppet主程序
yum install ntpdate -y //安装ntp客户端
ntpdate 192.168.1.25 //进行时间同步
yum -y install puppet //安装puppet客户端
vim /etc/puppet/puppet.conf //修改配置文件
[main]
server = puppetmaster //指明puppetmaster
......
puppet agent --server=puppetmaster --no-daemonize --verbose //申请注册
Info: Creating a new SSL key for puppetclient1
Info: Caching certificate for ca
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for puppetclient1
Info: Certificate Request fingerprint (SHA256): 24:94:14:43:80:93:D4:A1:71:5E:3F:2D:0B:5A:3E:69:44:02:03:0F:0D:FC:09:C8:9A:65:6E:F8:21:CC:50:50
Info: Caching certificate for ca
#出现以上信息,等待一会即可使用Ctrl+c组合键结束
puppet cert --list //查看申请
"puppetclient1" (SHA256) 24:94:14:43:80:93:D4:A1:71:5E:3F:2D:0B:5A:3E:69:44:02:03:0F:0D:FC:09:C8:9A:65:6E:F8:21:CC:50:50
"puppetclient2" (SHA256) 6B:22:44:3B:13:51:56:A7:80:59:46:74:B5:01:99:AC:27:5F:75:B1:46:0D:2F:7A:72:62:0D:C9:34:22:DE:47
puppet cert sign --all //对未注册的进行注册
Notice: Signed certificate request for puppetclient1
Notice: Removing file Puppet::SSL::CertificateRequest puppetclient1 at ‘/var/lib/puppet/ssl/ca/requests/puppetclient1.pem‘
Notice: Signed certificate request for puppetclient2
Notice: Removing file Puppet::SSL::CertificateRequest puppetclient2 at ‘/var/lib/puppet/ssl/ca/requests/puppetclient2.pem‘
ll /var/lib/puppet/ssl/ca/signed/ //通过目录查看已经注册的客户端
-rw-r--r--. 1 puppet puppet 1948 8月 5 19:20 puppetclient1.pem
-rw-r--r--. 1 puppet puppet 1948 8月 5 19:20 puppetclient2.pem
-rw-r--r--. 1 puppet puppet 1944 8月 5 19:01 puppetmaster.pem
此时客户端已经完成证书的请求与签名。
标签:自动化运维 注意 关闭 serve 客户端 管理员 tin 时间 erb
原文地址:http://blog.51cto.com/13641879/2154991