puppet的安装

简介:

安装配置:

1. Puppet在RedHat/CentOS系 统上安装

Puppet是基于Ruby写成的,所以安装前要准备好Ruby环境。在中心的Server上安装puppet-server包,并运行 puppetmasterd进程;在被管理机上安装puppet包,并运行puppetd进程。另外,在每台主机上配置好自己的hostname,之后每 台机器要以hostname区分。

1). 安装ruby环境:

yum install ruby ruby-rdoc

2). 安装puppet

Server端安装:

 wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

rpm -Uvh epel-release-5-4.noarch.rpm

yum install puppet-server

chkconfig --level 2345 puppetmaster on

修改hosts,添加下面行:

Vi /etc/hosts

192.168.189.134  puppet

192.168.189.133  web1

客户端安装:

 wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

rpm -Uvh epel-release-5-4.noarch.rpm

yum install puppet

chkconfig --level 2345 puppet on

修改hosts,添加下面行:

Vi /etc/hosts

192.168.189.134   puppet

192.168.189.133   web1

3). 启动puppet

Server端首次运行前,编辑/etc/puppet/manifests/site.pp文件,内容可以用最基本的:

# Create “/tmp/testfile” if it doesn’t exist.

class test_class {

file { “/tmp/testfile”:

ensure => present,

mode => 644,

owner => root,

group => root

}

}

# tell puppet on which client to run the class

node web1 {

include test_class

}

启动Server端:

service puppetmaster start

启动客户端:

/etc/init.d/puppet start


最好重启下服务器 
init 6


puppet的客户端和服务器是通过ssl链接的,在服务器有一个自签名的根证书,在安
装软件的时候自动生成。注意:要在安装软件以前先设置主机名,因为生成证书的时候
要把主机名写入证书,如果证书生成好了再改主机名,就连不上,这是很多初学者遇到
的问题。每个客户端的证书要经过根证书签名才能和服务器连接。所以首先要在客户端
执行下面的命令来请求服务器签名证书。
puppetd --test --server puppet
产生的信息:
info: Caching catalog for web1.localdomain
info: Applying configuration version '1297250911'
notice: Finished catalog run in 0.04 seconds
执行上面的命令,客户端将生成证书,并且把证书签名请求发到服务器端。登录到服务
器端,执行下面的命令查看是否有客户端的证书请求:
puppetca --list
如果看到了客户端的证书请求,用下面的命令对所有证书请求签名:
puppetca -s -a

 

防火墙和端口设定。puppet服务器端默认使用8140端口监听服务,需要在iptables上开启该端口。                                                 
     iptables  -A INPUT  -p tcp --dport 8140 -j ACCEPT                                                
     请在/etc/sysconfig/iptables 中加入上文的规则,并重启iptables。 

4). 测试:

也可以将日志直接打印到终端上进行测试:

Server端:puppetmasterd -d --no-daemonize -v --trace

客户端:puppetd --test --trace --debug



本文转自 holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/489728

相关文章
|
关系型数据库 网络安全 PostgreSQL
puppet连载14:安装puppetdb
yum install puppetdb puppetdb-terminus -y service puppetdb start vi /etc/puppet/puppet.
1221 1
|
网络协议 应用服务中间件 Shell
puppet连载12:linux安装nginx、openresty
服务端在/puppet/soft 里建nginx1102setup.sh,内容: !/bin/bash yum -y install wget libtool expat-devel gcc gcc-c++ glibc automake autocon...
1100 1
|
Java 应用服务中间件 Linux
puppet连载九:linux安装jdk、tomcat模块
安装jdk1.8.0_91和tomcat8.0.36 mkdir -p /etc/puppet/modules/linuxjdktomcat/{manifests,templates,files} vi /etc/puppet/modules/linuxjdktomcat/manifests/init.
1186 0
|
MySQL 关系型数据库 Linux
puppet连载10:linux安装percona57/56/55、sysbench、tpcc模块
在服务端/puppet/soft下建my.cnf,内容为https://www.jianshu.com/p/c63fc6c71279 在服务端/puppet/soft下建changemysql57pass.
1202 0
|
关系型数据库 MySQL Linux
puppet连载四:服务端安装dashboard
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - curl -L get.rvm.io | bash -s stable source /etc/profile.
1402 0
|
Linux 开发工具 git
puppet连载七:linux基础组件安装模块
linux基础组件安装模块linuxbaseinstall 更换源,安装gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf git mkdir -p /etc/puppet...
1186 0
|
网络安全 Apache Ruby
puppet连载三:服务端安装http、passenger
服务端安装插件: yum install -y ruby-devel ruby-libs rubygems libcurl-devel httpd httpd-devel apr-util-devel apr-devel mod_ssl gcc-c++...
1204 0
|
消息中间件
puppet 连载二:服务端和客户端安装(ActiveMQ、MCollective)
-------------------------------------服务端----------------------------------- 1、jdk安装 vi /etc/profile export JAVA_HOME=/usr/loca...
1331 0
|
网络协议 Apache
puppet 连载一:服务端和客户端安装(puppet、svn)
1、mkdir /puppet mkdir /puppet/soft 2、服务端安装dnsmasq:yum install -y dnsmasq cp /etc/dnsmasq.
1562 0
|
Linux Windows Ruby
puppet 服务端 客户端安装
转载:http://blog.51cto.com/ywzhou/1576141一、安装说明 官方安装向导https://docs.puppetlabs.com/guides/install_puppet/install_el.
1192 0

热门文章

最新文章

推荐镜像

更多