在安装之前,先简单说一下Puppet的构成。Puppet分为两部分,一部分叫Puppet Server 也叫 Puppet Master, 新版本好像开始叫Server了。另一部分,叫Agent。为什么叫做一部分,而不叫一个,道理很简单,就是可以有多台。好了费话不多说正式开始
先确定一下自己的系统版本,可以通过执行下面的命令查看:
如果是Enterprise Linux 7就执行这句
sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
Enterprise Linux 6
sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm
Ubuntu 16.04 Xenial Xerus
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
sudo dpkg -i puppetlabs-release-pc1-xenial.deb
sudo apt update
Ubuntu 15.10 Wily Werewolf
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-wily.deb
sudo dpkg -i puppetlabs-release-pc1-wily.deb
sudo apt update
Ubuntu 14.04 Trusty Tahr
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
sudo dpkg -i puppetlabs-release-pc1-trusty.deb
sudo apt-get update
Ubuntu 12.04 Precise Pangolin
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-precise.deb
sudo dpkg -i puppetlabs-release-pc1-precise.deb
sudo apt-get update
Debian 8 Jessie
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb
sudo dpkg -i puppetlabs-release-pc1-jessie.deb
sudo apt-get update
Debian 7 Wheezy
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb
sudo dpkg -i puppetlabs-release-pc1-wheezy.deb
sudo apt-get update
如果遇到这个错误,应该是你的rpm没有设置代理,请看文章结尾错误汇总
curl: (7) couldn't connect to host接下来用YUM安装
sudo yum install puppetserver
或
apt-get install puppetserver
遇到这个错误是YUM没有设置代理,文章结尾问题汇总
28, 'connect() timed out!'接下来就可以正常启动了
sudo service puppetserver start
可以通过如下命令查看是否启动成功
sudo service puppetserver status
默认它会分配2G内存,需要调整的话,可以在这里
/etc/sysconfig/puppetserver -- RedHeat
/etc/default/puppetserver -- Debian
接下来在另外一台器上安装agent
用相同的方法先下载资源包,sudo rpm xxxx,等 。
然后,安装agent
sudo yum install puppet
通过如下命令启动agent
sudo service puppet start
通过如下命令查看是否启动成功
service puppet status
https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm
Retrieving https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm
curl: (7) couldn't connect to host
error: skipping https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm - transfer failed
在安装过程中,如果Yum不能下载的话,可能没有设置代理,
执行 sudo vi /etc/yum.conf 然后加上代理
proxy=http://xxxxxxxxxx:80
puppet 默认使用8140,查看产端口占用情况
sudo netstat -nlatp | grep 8140
眼镜蛇