u老九 - 系统光盘下载网站!

当前位置:u老九 > 系统教程 > CentOS 5.5安装和设置Puppet

CentOS 5.5如何安装和设置Puppet(2)

时间:2015-04-14 13:33:36 作者:qipeng 来源:u老九 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: http://m.xitongzhijia.net/article/45115.html 手机查看 评论

  c.建立puppet目录

  mkdir -p /var/lib/puppet/rrd

  chown puppet.puppet /var/lib/puppet/rrd

  d.启动服务

  /etc/init.d/puppet restart

  e.向server端发送请求命令

  puppetd --test --server server.tech10.com

  到这一步时,总是提示err: Could not retrieve catalog from remote server: certificate verify failed,后来在谷歌上找到解决方法。删除客户端/var/lib/puppet/ssl目录下的文件,再次执行正常

  f.server端用如下命令接受请求

  puppetca -s -a

  g.slave端再次发认证请求

  puppetd -test -server server.tech10.com

  四.puppet的简单应用

  在服务器端的/etc/puppet/manifests下建立site.pp文件,在文件/tmp/andrew.txt内容及权限推送过去

  node default {

  file {“/tmp/andrew.txt”:

  content =》 “hello,My Name is Jone!\n”,

  ensure =》 present,

  mode =》 644,

  owner =》 root,

  group =》 root,

  }

  }

  present,意思是会检查该文件是否存在,如果不存在,就新建该文件

  客户及执行如下

  puppetd --test --server server.tech10.com

  info: Caching catalog for tech1

  info: Applying configuration version ‘1348711982’

  --- /tmp/andrew.txt 2012-09-27 10:11:18.000000000 +0800

  +++ /tmp/puppet-file.10084.0 2012-09-27 10:13:03.000000000 +0800

  @@ -1 +1,2 @@

  -hello,My Name is Jone!\n

  \ No newline at end of file

  +hello,My Name is Jone!

  +hello

  \ No newline at end of file

  info: FileBucket adding /tmp/andrew.txt as {md5}0578dc72120af9d1ff2ccc6261516d6e

  info: /Stage[main]//Node[default]/File[/tmp/andrew.txt]: Filebucketed /tmp/andrew.txt to puppet with sum 0578dc72120af9d1ff2ccc6261516d6e

  notice: /Stage[main]//Node[default]/File[/tmp/andrew.txt]/content: content changed ‘{md5}0578dc72120af9d1ff2ccc6261516d6e’ to ‘{md5}23d258c42f96b5af34aae4c959995798’

  notice: Finished catalog run in 0.09 seconds

  这是已存在的,在原有基础上发生了改动。

  修改完site.pp文件,要执行/etc/init.d/puppetmaster重启服务。

  上面就是CentOS 5.5安装配置Puppet的方法介绍了,本文详细介绍了Puppet的配置,Puppet在安装完后记得进行相关配置,避免不需要的麻烦。

分享到:

发表评论

0

没有更多评论了

评论就这些咯,让大家也知道你的独特见解

立即评论

以上留言仅代表用户个人观点,不代表u老九立场

其他版本软件

人气教程排行

Linux系统推荐

官方交流群 软件收录