puppet 安装文档—Ubuntu
来源:互联网 发布:知乎凹凸世界为什么火 编辑:程序博客网 时间:2024/06/03 13:18
1)安装环境:
2)安装前的准备:
- 请务必先给各自的主机的/etc/hosts 添加上hostname和ip,在服务节点,添加自己的hostname和所有client节点的host和ip;在client节点,只需添加server和自己的hostname和ip;这是因为在server的日志记录里都是以hostname来区别不同的节点。
- server是通过端口8140(由ruby占有)与client通信的,所以请确认设置防火墙,开放此端口。
- 为了各个节点能协同的运行服务,必须统一各个节点的时间,请给各个节点装ntp。以server节点的时间为标准。
3)安装:
[agent]
certname=vm235.com
server=vm234.com
report=true
#pluginsync=true
#service puppet restart
4)服务连接:
首先在路径 /etc/puppet/manifests/ 下创建 site.pp
然后是client端向server发起认证的请求:
#puppet agent --server=vm234.com --no-daemonize --verbose
然后在server节点列出当前请求认证者的hostname
#puppet cert --list
结果是:
"vm235.com" (一长串密钥的指纹)
然后server接受特定client的请求:
#puppet cert --sign vm235.com
或者是接受所有client的请求:
#puppet cert --sign --all
notice: Signed certificate request for vm235.com
notice: Removing file Puppet::SSL::CertificateRequest vm235.com at '/var/lib/puppet/ssl/ca/requests/vm235.com.pem'
认证后,client的公钥放在文件夹 /var/lib/puppet/ssl/ca/signed/
然后在client端显示:
info: Caching certificate for vm235.com
notice: Starting Puppet client version 2.7.11
至此认证请求完毕,可暂停client的agent ,即按 ctrl + c;也可等它自行结束,就是时间可能会久点。但是一定要出现 notice: Starting Puppet client version 2.7.11 的信息确认认证成功后才可暂停。
可用下面小段代码测试是puppet是否配置成功:
在 /etc/puppet/manifests/site.pp 输入
node 'vm235.com'{ file{ "/root/helloWorld": content=>"hello world\n" , mode => 0644; }}
将在后台运行的 agent 放到终端显示,显示的信息如下:
info: Caching catalog for vm235.com
info: Applying configuration version '1374052357'
notice: /Stage[main]//Node[vm235.com]/File[/root/helloWorld]/ensure: defined content as '{md5}6f5902ac237024bdd0c176cb93063dc4'
notice: Finished catalog run in 0.03 seconds
这时,在如在client生成文件 /root/helloWorld,文件的内容是hello world,则证明puppet已经能正常工作了。
5)常用小技巧:
在server节点的路径 /var/lib/puppet/ssl/ca/signed 可查看server目前已经接受的client的公钥
6)常见bug:
命令 service puppet status 可查看当前服务的状态,如果遇到错误:could not access PID file for agent 。这是因为服务发生异常而关闭了,
请重启服务 service puppet restart。
输入指令puppet agent --server=vm234.com --no-daemonize --verbose,遇到错误 Could not run: Could not create PID file: /var/run/puppet/agent.pid。这是因为已有puppet agent 启动了,请删除之前的进程(可用 pgrep和pkill),再重新启动服务puppet agent --server=……
更详细的信息请参阅puppet的官方文档 http://docs.puppetlabs.com/
- puppet 安装文档—Ubuntu
- puppet安装配置文档for ubuntu
- puppet 安装文档—RedHat
- Puppet安装文档
- PUPPET安装配置MCollective+ActiveMQ——文档附录
- ubuntu下 puppet安装配置
- puppet Dashboard安装指南for Ubuntu
- ubuntu Puppet
- puppet 安装
- 安装Puppet
- 安装Puppet
- Puppet以及Dashboard安装使用(含文档)
- puppet安装puppet server、client
- 搭建ubuntu puppet master & windows puppet client
- Puppet部署:安装puppet server、client
- PUPPET安装及PUPPET KICK 配置
- puppet安装要点
- puppet安装和使用
- Oracle Stream Replication技术
- Oracle Job 语法和时间间隔的设定
- 【Matrix (2D)】 —— 极限研究
- Oracle trunc()函数的用法
- 调整paraview的lengen模式为常见的Tecplot的Legend模式
- puppet 安装文档—Ubuntu
- my.cnf
- Oracle sql 优化
- SU2 在linux操作系统上的安装过程
- 2014迅雷校园招聘笔试题答案
- php的教程指导!
- 一份CSS文件和样式命名规范
- poj 1247
- ads1.2 编译ucosii下出现了Undefined symbol _rt_udiv的解决方式