Puppet基础篇6-Puppet更新方式的选型
来源:互联网 发布:软件变脸下载 编辑:程序博客网 时间:2024/05/09 05:46
Puppet基础篇6-Puppet更新方式的选型
一、主动更新
节点定期主动更新,无论是谁将节点被puppet管理的配置更改了,都会在规定的时间内自动修复,无须管理员登录查看。
环境搭建简单,不需要很复杂的架构,puppet本身C/S架构便可以完成。
节点数量过大的情况下同时会向puppetmaster端发起更新请求,会造成puppetmaster性能瓶颈。当然,也有一些解决方案比如设置任务计划,节点分批进行更新。
由于节点会定期向puppetmaster端提取配置进行更新,这要求puppetmaster端的环境要足够的安全。否则,任何人上去修改puppet模板都会造成节点同步更新,如果有人写了可执行资源“rm -rf /”,那损失就大了。
不能手动控制那些服务器需要更新,那些不需要更新。
1
2
3
4
5
6
7
8
9
10
11
[root@agent1 ~]# vim /etc/puppet/puppet.conf
[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
#设置同步的间隔时间,单位为秒
1
2
[root@agent1 ~]# /etc/init.d/puppet start
Starting puppet: [ OK ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@agent1 ~]# tailf /
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@agent1 ~]# /etc/init.d/puppet stop
Stopping puppet: [ OK ]
[root@agent1 ~]# puppet agent --verbose --no-daemonize
notice: Starting Puppet client version
2.7
.
25
info: Caching catalog
for
agent1_cert.kisspuppet.com
info: Applying configuration version
'1394359075'
notice: Finished catalog run
in
0.21
seconds
info: Caching catalog
for
agent1_cert.kisspuppet.com
info: Applying configuration version
'1394359075'
notice: Finished catalog run
in
0.20
seconds
info: Caching catalog
for
agent1_cert.kisspuppet.com
info: Applying configuration version
'1394359075'
notice: Finished catalog run
in
0.20
seconds
info: Caching catalog
for
agent1_cert.kisspuppet.com
info: Applying configuration version
'1394359075'
notice: Finished catalog run
in
0.21
seconds
info: Caching catalog
for
agent1_cert.kisspuppet.com
info: Applying configuration version
'1394359075'
notice: Finished catalog run
in
0.21
seconds
二、推送更新
非常容易控制节点的更新周期
安全性比较高,每次更新之前可先检查好代码后再更新
可以针对某一个cluster(一组服务器)进行推送更新,灵活性很强。
扩展性很强,可整合各种其他平台
环境搭建比较复杂,需要部署N多东西
agent端配置被篡改后,需要手动触发才能够恢复,不能够及时恢复
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@webui ~]# mco puppet -v runonce
Discovering hosts using the mc method
for
2
second(s) ....
3
* [ ============================================================> ]
3
/
3
node3.rsyslog.org : OK
{:summary=>
"Started a background Puppet run using the 'puppet agent --onetime --daemonize --color=false --splay --splaylimit 30' command"
}
node2.rsyslog.org : OK
{:summary=>
"Started a background Puppet run using the 'puppet agent --onetime --daemonize --color=false --splay --splaylimit 30' command"
}
node1.rsyslog.org : OK
{:summary=>
"Started a background Puppet run using the 'puppet agent --onetime --daemonize --color=false --splay --splaylimit 30' command"
}
---- rpc stats ----
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
0 0
- Puppet基础篇6-Puppet更新方式的选型
- Puppet更新方式的选型
- puppet
- Puppet
- puppet
- puppet
- Puppet
- puppet
- puppet
- Puppet
- puppet
- puppet
- puppet
- puppet
- puppet基础学习(一)
- puppet基础学习(二)
- puppet-template, Boxen的Puppet 模块示例
- 第二篇,puppet的初步配置
- free是查看机器内存使用情况的命令
- C语言之字符串,数组
- Paraview与VTK学习笔记(七)sources篇
- 编译没有问题,连接的时候出错了,找不到导入的目标文件
- Android应用开发中的风格和主题(style,themes)
- Puppet基础篇6-Puppet更新方式的选型
- make 学习笔记
- DIJKSTRA算法-java实现
- 图像处理与计算机视觉基础,经典以及最近发展
- 微信视频直播的实现
- 贝塞尔曲线
- linux下查看磁盘挂载的3种方法
- VS2010中删除消息响应
- QT用户交互(1——基本)