puppet 服务端 客户端安装

转载:http://blog.51cto.com/ywzhou/1576141
一、安装说明

官方安装向导https://docs.puppetlabs.com/guides/install_puppet/install_el.html

puppet服务端:10.188.1.73 puppet.ewin.com 操作系统centos6.5 x86_64

puppet客户端1:10.188.1.103 zabbix.ewin.com 操作系统centos6.5 x86_64

puppet客户端2:10.188.1.172 ywzhou-pc.ewin.com 操作系统win7x64

二、安装服务端

1、设置主机名

[root@puppet ~]# hostname puppet.ewin.com
重启后会失效,必须修改下面的network:
[root@puppet ~]# vi /etc/sysconfig/network
HOSTNAME=puppet.ewin.com
[root@puppet ~]# echo "10.188.1.73 puppet.ewin.com" >> /etc/hosts
[root@puppet ~]# echo "10.188.1.103 zabbix.ewin.com" >> /etc/hosts
[root@puppet ~]# echo "10.188.1.172 ywzhou-pc.ewin.com" >> /etc/hosts

服务器本身和每个客户端的解析记录都要写入hosts,否则报以下错误:

Error: Could not resolve 10.188.1.103: no name for 10.188.1.103 Info: Not Found: Could not find certificate zabbix.ewin.com

完成这一步最好reboot重启下使用hostname生效。

2、下载官方YUM源

官方下载页面http://puppetlabs.com/misc/download-options#puppet

[root@puppet ~]# rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm

3、安装puppet server

新安装的centos建议yum clean all清空下缓存。

[root@puppet ~]# yum install -y puppet-server-3.7.1

可以指定版本,也可以不指定从而安装最新版本,目前是3.7.3了。

安装会提示你需要rubygems,发现官方YUM源中没有这个包,用以下163的包安装:

[root@puppet ~]# yum install -y http://mirrors.163.com/centos/6/os/x86_64/Packages/rubygems-1.3.7-5.el6.noarch.rpm

163的源不再更新6.1~6.5的包了,统一使用6目录。

4、启动服务

[root@puppet ~]# service puppetmaster start
[root@puppet ~]# chkconfig puppetmaster on

查看进程和端口:

[root@puppet ~]# ps -ef | grep puppet
puppet   13015     1  4 05:41 ?        00:12:02 Passenger RackApp: /usr/share/puppet/rack/puppetmasterd                                    
puppet   17999     1  7 07:50 ?        00:09:48 Passenger RackApp: /usr/share/puppet/rack/puppetmasterd                                    
root     23102 20595  0 09:56 pts/0    00:00:00 grep puppet
496      49259     1  0 Nov09 ?        00:23:59 Passenger ClassicRailsApp: /usr/share/puppet-dashboard                                              
root     54786     1  0 Nov10 ?        00:00:12 /usr/bin/ruby /usr/bin/puppet agent /home/test.pp
[root@puppet ~]# netstat -lnpt|grep 8140
tcp        0      0 :::8140                     :::*                        LISTEN      2798/httpd      #我这里与apache整合了,所以显示的是httpd

5、附上依赖软件包截图

wKiom1RkZv_gUIa0AAHuwIdASqA519.jpg

三、安装客户端

1、linux系统

[root@zabbix ~]# vi /etc/sysconfig/network
HOSTNAME=centostest.ewin.com
[root@zabbix ~]# echo "10.188.1.103 centostest.ewin.com" >> /etc/hosts  #建议将自身也写入
[root@zabbix ~]# echo "10.188.1.73 puppet.ewin.com" >> /etc/hosts
[root@zabbix ~]# rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
[root@zabbix ~]# yum install puppet-3.7.1
[root@zabbix ~]# service puppet start
[root@zabbix ~]# chkconfig puppet on       #这步可以不做,后面puppet模块会讲

建议reboot下。

2、windows系统

http://downloads.puppetlabs.com/windows/puppet-3.7.1.msi

http://downloads.puppetlabs.com/windows/puppet-3.7.1-x64.msi

在C:\Windows\System32\drivers\hosts文件中写入:

 10.188.1.73 puppet.ewin.com

你可能感兴趣的:(puppet 服务端 客户端安装)