Puppet基础篇6-Puppet更新方式的选型
一、主动更新
节点定期主动更新,无论是谁将节点被puppet管理的配置更改了,都会在规定的时间内自动修复,无须管理员登录查看。
环境搭建简单,不需要很复杂的架构,puppet本身C/S架构便可以完成。
节点数量过大的情况下同时会向puppetmaster端发起更新请求,会造成puppetmaster性能瓶颈。当然,也有一些解决方案比如设置任务计划,节点分批进行更新。
由于节点会定期向puppetmaster端提取配置进行更新,这要求puppetmaster端的环境要足够的安全。否则,任何人上去修改puppet模板都会造成节点同步更新,如果有人写了可执行资源“rm -rf /”,那损失就大了。
不能手动控制那些服务器需要更新,那些不需要更新。
1234567891011 | [root@agent1 [main] logdir = / var /log/puppet rundir = / var /run/puppet ssldir = $ var dir/ssl [agent] classfile = $ var dir/classes.txt localconfig = $ var dir/localconfig server = puppetmaster.kisspuppet.com certname = agent1_cert.kisspuppet.com runinterval = 10 #设置同步的间隔时间,单位为秒 |
12 | [root@agent1 Starting |
12345678910111213141516 | [root@agent1 var /log/messages Mar 11 23 : 39 : 42 agent1 kernel: ide: failed opcode was: 0xec Mar 11 23 : 39 : 42 agent1 smartd[ 3110 ]: Device: /dev/hdc, not ATA, no IDENTIFY DEVICE Structure Mar 11 23 : 39 : 42 agent1 smartd[ 3110 ]: Device: /dev/sda, opened Mar 11 23 : 39 : 42 agent1 smartd[ 3110 ]: Device: /dev/sda, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sda' to turn on SMART features Mar 11 23 : 39 : 42 agent1 smartd[ 3110 ]: Monitoring 0 ATA and 0 SCSI devices Mar 11 23 : 39 : 42 agent1 smartd[ 3112 ]: smartd has fork()ed into background mode. New PID= 3112 . Mar 11 23 : 39 : 42 agent1 avahi-daemon[ 3076 ]: Server startup complete. Host name is agent1.local. Local service cookie is 773321440 . Mar 11 23 : 44 : 11 agent1 puppet-agent[ 3210 ]: Reopening log files Mar 11 23 : 44 : 12 agent1 puppet-agent[ 3210 ]: Starting Puppet client version 2.7 . 25 Mar 11 23 : 44 : 16 agent1 puppet-agent[ 3210 ]: Finished catalog run in 1.53 seconds Mar 11 23 : 44 : 29 agent1 puppet-agent[ 3210 ]: Finished catalog run in 0.96 seconds Mar 11 23 : 44 : 40 agent1 puppet-agent[ 3210 ]: Finished catalog run in 0.20 seconds Mar 11 23 : 44 : 51 agent1 puppet-agent[ 3210 ]: Finished catalog run in 0.24 seconds Mar 11 23 : 45 : 02 agent1 puppet-agent[ 3210 ]: Finished catalog run in 0.21 seconds Mar 11 23 : 45 : 13 agent1 puppet-agent[ 3210 ]: Finished catalog run in 0.22 seconds |
12345678910111213141516171819 | [root@agent1 Stopping [root@agent1 notice: 2.7 . 25 info: for agent1_cert.kisspuppet.com info: '1394359075' notice: in 0.21 seconds info: for agent1_cert.kisspuppet.com info: '1394359075' notice: in 0.20 seconds info: for agent1_cert.kisspuppet.com info: '1394359075' notice: in 0.20 seconds info: for agent1_cert.kisspuppet.com info: '1394359075' notice: in 0.21 seconds info: for agent1_cert.kisspuppet.com info: '1394359075' notice: in 0.21 seconds |
二、推送更新
非常容易控制节点的更新周期
安全性比较高,每次更新之前可先检查好代码后再更新
可以针对某一个cluster(一组服务器)进行推送更新,灵活性很强。
扩展性很强,可整合各种其他平台
环境搭建比较复杂,需要部署N多东西
agent端配置被篡改后,需要手动触发才能够恢复,不能够及时恢复
12345678910111213141516 | [root@webui Discovering for 2 second(s) .... 3 * [ ============================================================> ] 3 / 3 node3.rsyslog.org {:summary=> "Started a background Puppet run using the 'puppet agent --onetime --daemonize --color=false --splay --splaylimit 30' command" } node2.rsyslog.org {:summary=> "Started a background Puppet run using the 'puppet agent --onetime --daemonize --color=false --splay --splaylimit 30' command" } node1.rsyslog.org {:summary=> "Started a background Puppet run using the 'puppet agent --onetime --daemonize --color=false --splay --splaylimit 30' command" } ---- Nodes: 3 / 3 Pass / Fail: 3 / 0 Start Time: Tue Mar 11 17 : 40 : 56 + 0800 2014 Discovery Time: 2003 .85ms Agent Time: 1132 .44ms Total Time: 3136 .29ms |
显示结果
转自:http://dreamfire.blog.51cto.com/418026/1374395