puppet安装配置


puppet是一款开源自动化部署工具,下面介绍puppet安装和配置。
1、操作系统:redhat5.3 (64位系统)
2、系统架构:
   192.168.0.200  服务器
   192.168.0.201  客户端
   192.168.0.202  客户端

3、安装ruby.(安装puppet先决条件服务端和客户端都要安装)
   #rpm –Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
   #yum -y install mysql* ruby-mysql ruby ruby-devel ruby-irb ruby-rdoc ruby-ri

安装ruby 1.8.2以上版本,但不要安装1.87以上版本。还不支持。
4、服务端安装
   (1)安装Facter  用来获取客户端系统信息(如hostname,ip,OS-version,fqdn等)采用源码安装
   #cd /usr/local/src
   #wget http://puppetlabs.com/downloads/facter/facter-latest.tgz下载最新稳定版facter
   #tar -xvzf facter-latest.tgz
   #cd facter-latest
   #ruby install.rb   安装
   #cd ../
  
   (2)安装puppet
   #wget http://puppetlabs.com/downloads/puppet/puppet-latest.tgz 下载最新稳定版puppet。
   #cd puppet-*
   #ruby install.rb安装
   #mkdir /etc/puppet
   #cp conf/auth.conf /etc/puppet/
   #cp conf/namespaceauth.conf /etc/puppet/
   #cp conf/redhat/puppet.conf /etc/puppet/
   #cp conf/redhat/server.init /etc/init.d/puppetmaster
   #chmod +x /etc/init.d/puppetmaster
 
  
5、客户端安装
   和服务端安装方法一样。
   #mkdir /etc/puppet
   #cp conf/auth.conf /etc/puppet/
   #cp conf/namespaceauth.conf /etc/puppet/
   #cp conf/redhat/puppet.conf /etc/puppet/
   #cp conf/redhat/client.init /etc/init.d/puppet
   #chmod +x /etc/init.d/puppet

6、服务端配置
   (1)、修改/etc/vhosts
 
   #vim /etc/hosts
   # Do not remove the following line, or various programs
   # that require network functionality will fail.
   127.0.0.1               puppet localhost.localdomain localhost puppet
   ::1             localhost6.localdomain6 localhost6
  (2)、修改hostname
   #vim /etc/sysconfig/network
   NETWORKING=yes
   NETWORKING_IPV6=no
   HOSTNAME=master.gangpao.com
   GATEWAY=192.168.0.1
7、客户端配置192.168.0.201
   (1)、修改/etc/vhosts
   # Do not remove the following line, or various programs
   # that require network functionality will fail.
   127.0.0.1       localhost.localdomain   localhost
   ::1     localhost6.localdomain6 localhost6
   192.168.0.200   master.gangpao.com      puppet
   192.168.0.202   agent02.gangpao.com     agent02
 (2)、修改hostname
   #vim /etc/sysconfig/network
   NETWORKING=yes
   NETWORKING_IPV6=no
   HOSTNAME=agent02.gangpao.com
   GATEWAY=192.168.0.1
   #/etc/init.d/network restart
8、启动服务端服务
   (1)、生成config文件
   #puppet --genconfig > /etc/puppet/puppet.conf
   (2)、启动服务
   #puppet master --mkusers
9、客户端请求服务端认证
   在客户端执行
   #puppet agent --server master.gangpao..com --waitforcert 60 --test
   在服务端执行
   #puppet cert --list   查看客端请求
   agent02.gangpao.com
   #puppet cert --sign agent02.gangpao.com 签发证书
10、启动客户端服务
   #/etc/init.d/puppet start

相关内容

    暂无相关文章