ITPub博客

首页 > Linux操作系统 > Linux操作系统 > puppet之安装配置

puppet之安装配置

原创 Linux操作系统 作者:wang_0720 时间:2013-11-11 15:35:24 0 删除 编辑
      当对大量机器进行安装部署时,重复,繁琐的动作靠人工手动操作的话,效率实在太低。为了提高批量部署的效率我们采用puppet这种开源工具。puppet可管理配置文件,用户,cron任务,软件包,系统服务等。本文将介绍puppet的安装。
一 环境规划
所需软件
ruby,ruby-libs,ruby-devel
facter-1.6.5.tar.gz
puppet-2.6.13.tar.gz
OS: Red Hat Enterprise Linux Server release 5.7
host
ip
software
master.andy.com
192.168.151.90
ruby,ruby-libs,ruby-devel,facter,puppet
agent1.andy.com
192.168.151.70
ruby,ruby-libs,ruby-devel,facter,puppet
二 安装配置
1 服务端安装
安装facter用来获取客户端系统信息
cd /usr/local/src
wget http://puppetlabs.com/downloads/facter/facter-1.6.5.tar.gz
tar zxf facter-1.6.5.tar.gz
cd facter-1.6.5
ruby install.rb
cd /usr/local/src
wget http://puppetlabs.com/downloads/puppet/puppet-2.6.13.tar.gz
tar zxf puppet-2.6.13.tar.gz
cd puppet-2.6.13
ruby install.rb
mkdir /etc/puppet
cp conf/auth.conf conf/namespaceauth.conf conf/redhat/puppet.conf /etc/puppet
cp conf/redhat/server.init /etc/init.d/puppetmaster
chmod +x /etc/init.d/puppetmaster
修改hosts文件
cat /etc/hosts
192.168.151.90 master.andy.com
192.168.151.70 agent1.andy.com
修改hostname
cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=master.andy.com
2 客户端安装
和服务端一样,客户端也要安装ruby,ruby-libs,ruby-devel,facter,puppet
cd /usr/local/src
wget http://puppetlabs.com/downloads/facter/facter-1.6.5.tar.gz
cd facter-1.6.5
ruby install.rb
cd /usr/local/src
wget http://puppetlabs.com/downloads/puppet/puppet-2.6.13
cd puppet-2.6.13
ruby install.rb
mkdir /etc/puppet
cp conf/auth.conf conf/namespaceauth.conf conf/redhat/puppet.conf /etc/puppet
cp conf/redhat/client.init /etc/init.d/puppet
chmod +x /etc/init.d/puppet
添加puppet用户
useradd puppet
和服务端一样修改hosts,hostname
3 启动服务端服务
/etc/init.d/puppetmaster start
puppet master --mkusers
三 认证
在客户端请求认证
puppet agent --server master.andy.com --test
在服务端查看请求
puppet cert --list
agent1.andy.com (65:C2:19:5A:7F:C1:83:4C:09:CB:15:9C:ED:41:5F:25)
给agent1.andy.com签发证书
puppet cert --sign agent1.andy.com
客户端开启服务
/etc/init.d/puppet start
签发证书成功会在客户端生成如下文件
tree /var/lib/puppet/ssl
/var/lib/puppet/ssl
|-- ca
|   |-- ca_key.pem
|   |-- ca_pub.pem
|   |-- private
|   |-- requests
|   `-- signed
|-- certificate_requests
|   `-- agent1.andy.com.pem
|-- certs
|   |-- agent1.andy.com.pem
|   `-- ca.pem
|-- crl.pem
|-- private
|-- private_keys
|   `-- agent1.andy.com.pem
`-- public_keys
    `-- agent1.andy.com.pem

9 directories, 8 files
服务端会生成如下文件
[root@master puppet]# tree /etc/puppet/ssl/
/etc/puppet/ssl/
|-- ca
|   |-- ca_crl.pem
|   |-- ca_crt.pem
|   |-- ca_key.pem
|   |-- inventory.txt
|   |-- private
|   |   `-- ca.pass
|   |-- requests
|   |-- serial
|   `-- signed
|       |-- agent1.andy.com.pem
|       `-- master.andy.com.pem
|-- certificate_requests
|-- certs
|   |-- ca.pem
|   `-- master.andy.com.pem
|-- private
|-- private_keys
|   `-- master.andy.com.pem
`-- public_keys
    `-- master.andy.com.pem

9 directories, 13 files

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27181165/viewspace-776318/,如需转载,请注明出处,否则将追究法律责任。

上一篇: mfs安装配置
请登录后发表评论 登录
全部评论

注册时间:2013-11-05

  • 博文量
    111
  • 访问量
    913632