Puppet Server和client的安装


 

 

 

1 puppet介绍:

 

 

  • puppet基于ruby语言开发
  • 支持已C/S模式或独立模式运行
  • 支持所有的UNIX和LINUX系统配置
  • 适用业务系统的整个生命周期
  • 支持节点方式管理若干服务器群组
  • 支持对windows操作系统管理(功能有限)

 

 

2 puppet工作架构

 

puppet framework

 

 

 3 更新server和client的配置文件

 

  
  
  
  
  1. 192.168.10.180 master.notry.com  #个人虚拟机环境 
  2. 192.168.10.122 client1.notry.com 
  3. 192.168.10.157 clinet2.notry.com 

 

4 puppet server的安装:

 

安装EPEL

 

  
  
  
  
  1.  
  1. sudo rpm –Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm 

  
  
  
  
  1.  
 

 

安装puppet服务端

  
  
  
  
  1.  

  
  
  
  
  1. sudo yum –y install puppet-server 

 

 

启动puppet服务

  
  
  
  
  1.  

  
  
  
  
  1. sudo /etc/init.d/puppetmaster start 

 

 

5 Puppet client的安装

 

安装EPEL

  
  
  
  
  1.  

  
  
  
  
  1.  

  
  
  
  
  1. sudo rpm –Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm 
   
   
   
   
  1.  

 

 

安装puppet客户端

 

 

 

  
  
  
  
  1.  
  1. sudo yum -y install puppet 
  1.  

提交证书申请

  
  
  
  
  1.  

  
  
  
  
  1. sudo puppet --server master.notry.com --test 

 

 

 

6 Puppet证书管理

 

 

服务器端可用的puppetca 管理证书

 

   
   
   
   
  1. puppetca –list #查看到申请证书的客户端主机名  
  2. puppetca –s #主机名,为特定的主机颁发证书  
  3. puppetca –s and –a #为所有的主机颁发证书  
  4. puppetca –l and –a #列出所有主机,+号代表已经领证的机器 

 

7 认证client1

   
   
   
   
  1. [notry@master opt]$puppetca --list
  2. client1.notry.com
  3. [notry@master opt]$puppetca --list -a
  4.  
    
    
    
    
  1.  
 
Puppet Server端目录结构

 

   
   
   
   
  1. [notry@master puppet]$ pwd 
  2. /etc/puppet 
  3. auth.conf client访问puppet server的ACL配置文件  
  4. fileserver.conf puppet server作为文件服务器的ACL配 置文件  
  5. manifests Puppet脚本主文件目录,至少需要包含  
  6. site.pp入口脚本文件 
  7. modules Puppet模块目录,存放Puppet脚本的功 能模块  
  8. namespaceauth.conf 命名空间ACL配置文件  
  9.  
    
    
    
    
  1. puppet.conf Puppet服务器端配置文件 

 

 

8 简单的测试

server端操作:

   
   
   
   
  1. vim /etc/puppet/manifests/site.pp 
  2. class text {
  3. file {"/opt/a.txt":
  4. ensure=>"present",
  5. content=>"Hello Puppet!\n",
  6. owner=>"root",
  7. group=>"root",
  8. mode=>644
  9. }
  10.  
  11. }
  12. node client1 {
  13. include text
  14.  
    
    
    
    
  1. }
client1端操作:
   
   
   
   
  1.  
    
    
    
    
  1. puppetd --server master.notry.com --test 

 

 

 

观察是否在client1的/opt/下生成内容为Hello Puppet!的a.txt文件。

    

 

 

 

 

  

你可能感兴趣的:(安装,server,职场,client,puppet,puppet,休闲,setup,notry)