Puppet 部署安装puppet server,client
2012-08-28 13:03
387 查看
Puppet是一个配置管理工具, 典型的, puppet是一个C/S结构, 当然,这里的C可以有很多,因此,也可以说是一个星型结构. 所有的puppet客户端同一个服务器端的puppet通讯. 每个puppet客户端每半小时(可以设置)连接一次服务器端, 下载最新的配置文件,并且严格按照配置文件来配置服务器. 配置完成以后,puppet客户端可以反馈给服务器端一个消息. 如果出错,也会给服务器端反馈一个消息. 下图展示了一个典型的puppet配置的数据流动情况.
puppet与其他手工操作工具有一个最大的区别就是 puppet的配置具有稳定性,因此你可以多次执行puppet, 一旦你更新了你的配置文件,puppet就会根据配置文件来更改你的机器配置,通常每30分钟检查一次. puppet会让你的系统状态同配置文件所要求的状态保持一致. 比如你配置文件里面要求ssh服务必须开启. 假如不小心ssh服务被关闭了,那么下一次执行puppet的时候,puppet会发现这个异常,然后会开启 ssh 服务. 以使系统状态和配置文件保持一致.puppet就象一个魔术师,会让你的混乱的系统收敛到puppet配置文件所想要的状态.
可以使用puppet管理服务器的整个生命周期,从初始化到退役.不同于传统的例如sun的Jumpstart或者redhat的Kickstart, puppet可以长年让服务器保持最新状态.只要一开始就正确的配置他们,然后再也不用去管他们.通常puppet用户只需要给机器安装好puppet并让他们运行,然后剩余的工作都由puppet来完成.
这个是puppet的官方主页:http://reductivelabs.com/projects/puppet
软件: 安装Centos 5X64(server),Ubuntu 12.04(client) 系统
网络: 两台机器互相能访问
在server端配置:
1.设置主机名,hosts:
2.配置server端的yum源(因为centos默认没有puppet 源,因此先配置puppet的源,下面链接失效可以参考:https://fedoraproject.org/wiki/EPEL/zh-cn.)
3.开始安装puppet server
4.yum安装puppet成功,先启动服务,查看安装成功否
个人喜欢先用
因为这个可以看到输出.跟后面的测试有关系,调试完毕.建议用守护进程方式启动
现在看到server启动没有问题.现在可以出安装 ubuntu client
Client 安装
1.设置client的hostname
2.设置server hosts(添加如下)
3.设置ubuntu apt源
4.安装puppet 客户端
5.测试
6.服务器端查看等待请求证书连接的客户端
现在server和client 端都没问题.若想吧client 换成Centos Or RHEL 重复server 2.配置puppet的yum源.直接yum install puppet 即可!
出现的问题:
这个是因为server端的时间跟client 不一致导致的,修改server 端时间
本文出自 “奋斗的小子” 博客,请务必保留此出处http://crazyming.blog.51cto.com/1048571/975208
puppet与其他手工操作工具有一个最大的区别就是 puppet的配置具有稳定性,因此你可以多次执行puppet, 一旦你更新了你的配置文件,puppet就会根据配置文件来更改你的机器配置,通常每30分钟检查一次. puppet会让你的系统状态同配置文件所要求的状态保持一致. 比如你配置文件里面要求ssh服务必须开启. 假如不小心ssh服务被关闭了,那么下一次执行puppet的时候,puppet会发现这个异常,然后会开启 ssh 服务. 以使系统状态和配置文件保持一致.puppet就象一个魔术师,会让你的混乱的系统收敛到puppet配置文件所想要的状态.
可以使用puppet管理服务器的整个生命周期,从初始化到退役.不同于传统的例如sun的Jumpstart或者redhat的Kickstart, puppet可以长年让服务器保持最新状态.只要一开始就正确的配置他们,然后再也不用去管他们.通常puppet用户只需要给机器安装好puppet并让他们运行,然后剩余的工作都由puppet来完成.
这个是puppet的官方主页:http://reductivelabs.com/projects/puppet
试验环境
硬件: 两台服务器,虚拟服务器或者物理机器都行,ip地址分别是 192.168.10.133 (server)和 192.168.10.207(client) ;下文分别用server和client代替两个服务器.软件: 安装Centos 5X64(server),Ubuntu 12.04(client) 系统
网络: 两台机器互相能访问
在server端配置:
1.设置主机名,hosts:
[root@server ~]# uname -a Linux server.puppet.com 2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64 x86_64 x86_64 GNU/Linux [root@server ~]# hostname server.puppet.com [root@server ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 redmine localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.10.133 server.puppet.com server
2.配置server端的yum源(因为centos默认没有puppet 源,因此先配置puppet的源,下面链接失效可以参考:https://fedoraproject.org/wiki/EPEL/zh-cn.)
[root@server ~]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
3.开始安装puppet server
[root@server ~]# yum -y install puppet-server facter ruby ruby-libs ruby-shadow
4.yum安装puppet成功,先启动服务,查看安装成功否
[root@server ~]# service puppetmaster start Starting puppetmaster: [ OK ] [root@server ~]# ps -ef | grep puppet puppet 2937 1 0 11:47 ? 00:00:00 /usr/bin/ruby /usr/sbin/puppetmasterd root 2943 2751 0 11:47 pts/1 00:00:00 grep puppet
个人喜欢先用
[root@server ~]# puppet master --verbose --no-daemonize notice: Starting Puppet master version 2.6.17
因为这个可以看到输出.跟后面的测试有关系,调试完毕.建议用守护进程方式启动
现在看到server启动没有问题.现在可以出安装 ubuntu client
Client 安装
1.设置client的hostname
liming@client:~$ hostname client.puppet.com
2.设置server hosts(添加如下)
liming@client:~$ sudo vim /etc/hosts 192.168.10.133 server.puppet.com
3.设置ubuntu apt源
liming@client:~$ sudo su - liming@client:~$ echo -e "deb http://apt.puppetlabs.com/ lucid main\ndeb-src http://apt.puppetlabs.com/ lucid main" >> /etc/apt/sources.list.d/puppet.list liming@client:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 4BD6EC30 liming@client:~$ sudo apt-get update
4.安装puppet 客户端
sudo apt-get install puppet facter
5.测试
liming@client:~$ sudo puppet agent --server=server.puppet.com --no-daemonize --verbose --onetime info: Creating a new SSL key for client.puppet.com warning: peer certificate won't be verified in this SSL session info: Caching certificate for ca warning: peer certificate won't be verified in this SSL session warning: peer certificate won't be verified in this SSL session info: Creating a new SSL certificate request for client.puppet.com info: Certificate Request fingerprint (md5): 54:CC:33:85:ED:4E:97:05:5F:6D:CE:D9:1F:1F:E9:BC warning: peer certificate won't be verified in this SSL session warning: peer certificate won't be verified in this SSL session warning: peer certificate won't be verified in this SSL session
6.服务器端查看等待请求证书连接的客户端
[root@server ~]# puppet cert --list "client.puppet.com" (54:CC:33:85:ED:4E:97:05:5F:6D:CE:D9:1F:1F:E9:BC)
现在server和client 端都没问题.若想吧client 换成Centos Or RHEL 重复server 2.配置puppet的yum源.直接yum install puppet 即可!
出现的问题:
liming@client:~$ puppetd --server server.puppet.com --test err: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed. This is often because the time is out of sync on the server or client warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run err: Could not send report: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed. This is often because the time is out of sync on the server or client
这个是因为server端的时间跟client 不一致导致的,修改server 端时间
ntpdate 210.72.145.44
本文出自 “奋斗的小子” 博客,请务必保留此出处http://crazyming.blog.51cto.com/1048571/975208
相关文章推荐
- Puppet部署:安装puppet server、client
- Puppet Server和client的安装
- Zabbix监控系列之-Zabbix-Server安装部署
- (运维)VMware-vCenter-Server-Appliance-5.0安装与部署
- 部署Lync Server 2013时系统提示Prerequisite installation failed安装必备组件失败SqlInstanceRtcLocal 2067922934
- Puppet安装部署篇(二)
- 规划安装部署SharePoint Server 2007精解(上)
- zabbix server 3.0.3安装部署
- SharePoint Server 2010架构与安装部署webcast--笔记
- Skype For Business 2015综合部署系列五:安装 Skype Server系统 2
- CentOS 6.5 安装部署zabbix(Server端篇)
- 自动化运维工具 puppet安装部署
- IBM DB2 Alphablox 8.3 build 149 安装过程 部署 WebSphere Application Server 6.0.1上
- 在电脑上安装了百度一键root工具后,启动adb提示:adb server version (31) doesn't match this client (36); killing...
- Hive Server 2 调研,安装和部署
- Puppet 实现 LNMT(session_server) 自动化部署的实例
- Ubuntu Server 安装部署 Cacti 服务器监控
- wsus(Windows Server Update Services)安装部署手册(一)
- Oracle WebLogic Server 12.2.1.2 eclipse插件安装与项目部署