puppet练习记录一

安装puppet前准备内容

规范ip,主机名,防火墙,双机互信,域名解析

1、修改ip

master
[[email protected] etc]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:0c:29:53:d8:5c
IPADDR=192.168.1.10
NETWARK=255.255.255
GATWAY=192.168.1.1
DNS=202.96.128.86
agent01
[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:0c:29:20:ea:2d
IPADDR=192.168.1.11
NETWORK=255.255.255.255
GATWAY=192.168.1.1
DNS=202.96.128.86
agnet02
[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:0c:29:9e:d5:92
IPADDR=192.168.1.12
NETWORK=255.255.255.0
GATWAY=192.168.1.1
DNS=202.96.128.86

2、修改主机名

master
[[email protected] etc]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
#HOSTNAME=localhost.localdomain
HOSTNAME=master.puppet
GATEWAY=192.168.1.1
agent01
[[email protected] ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
#HOSTNAME=localhost.localdomain
HOSTNAME=agent01.puppet
GATEWAY=192.168.1.1
agnet02
[[email protected] ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
#HOSTNAME=localhost.localdomain
HOSTNAME=agent02.puppet
GATEWAY=192.168.1.1
修改主机名,需重启后生效。

3、为了减少测试环境的复杂程度,直接关闭防火墙

[[email protected] /]# service iptables stop
清除防火墙规则:                                           [确定]
把 chains 设置为 ACCEPT 策略:filter                       [确定]
正在卸载 Iiptables 模块:                                  [确定]
设置防火墙开机为关闭
[[email protected] /]# chkconfig iptables off

4、配置agent机器和master机器互信

在master生成公钥
[[email protected] ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory ‘/root/.ssh‘.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
17:61:db:30:21:ce:a2:95:8b:64:ff:65:b3:08:d0:c0 [email protected]
复制公钥到agnet机器上
[[email protected] .ssh]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.1.11
[[email protected] .ssh]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.1.12

5、配置域名相互解析

使用host文件直接进行解析配置

[[email protected] /]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
::1     localhost6.localdomain6 localhost6
192.168.1.10 master.puppet
192.168.1.11 agent01.puppet
192.168.1.12 agent02.puppet

将此文件拷贝到其他两台agent机器上

[[email protected] etc]# for i in {1..2};do scp hosts 192.168.1.1$i:/etc/;done
hosts                                                                                                              100%  271     0.3KB/s   00:00
hosts                                                                                                              100%  271     0.3KB/s   00:00

域名解析测试

[[email protected] etc]# ping master.puppet
PING master.puppet (192.168.1.10) 56(84) bytes of data.
64 bytes from master.puppet (192.168.1.10): icmp_seq=1 ttl=64 time=1.35 ms
64 bytes from master.puppet (192.168.1.10): icmp_seq=2 ttl=64 time=0.083 ms
64 bytes from master.puppet (192.168.1.10): icmp_seq=3 ttl=64 time=0.030 ms
--- master.puppet ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2029ms
rtt min/avg/max/mdev = 0.030/0.488/1.351/0.610 ms
[[email protected] etc]# ping agent01.puppet
PING agent01.puppet (192.168.1.11) 56(84) bytes of data.
64 bytes from agent01.puppet (192.168.1.11): icmp_seq=1 ttl=64 time=1.81 ms
64 bytes from agent01.puppet (192.168.1.11): icmp_seq=2 ttl=64 time=0.213 ms
64 bytes from agent01.puppet (192.168.1.11): icmp_seq=3 ttl=64 time=0.245 ms
64 bytes from agent01.puppet (192.168.1.11): icmp_seq=4 ttl=64 time=0.196 ms
--- agent01.puppet ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3060ms
rtt min/avg/max/mdev = 0.196/0.616/1.813/0.691 ms
[[email protected] etc]# ping agent02.puppet
PING agent02.puppet (192.168.1.12) 56(84) bytes of data.
64 bytes from agent02.puppet (192.168.1.12): icmp_seq=1 ttl=64 time=1.97 ms
64 bytes from agent02.puppet (192.168.1.12): icmp_seq=2 ttl=64 time=0.313 ms
64 bytes from agent02.puppet (192.168.1.12): icmp_seq=3 ttl=64 time=0.302 ms

暂时前期工作。

puppet练习记录一,布布扣,bubuko.com

时间: 2024-12-28 11:42:25

puppet练习记录一的相关文章

puppet 学习记录

1. puppet之主动推送功能 使用puppet kick进行推送,但kick功能无法支撑大规模puppet agent同时并发请求,所以当agent规模较大时,请使用MCollective 1.1设置puppet agent所有节点的pupet.conf在[agent]增加"listen=true" 1.2开启防火墙8139端口 1.3在puppet agent的auth.conf的path /前加入如下配置 path /run method save auth any allow

puppet 错误记录

Warning: Unable to fetch my node definition, but the agent run will continue: Warning: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [self signed certificate in certificate chain for /CN=Puppet CA: master.puppetcao.com] Info:

puppet部署与与应用

一.puppet工作原理         Puppetclient运行时,客户端主动拉取服务器配置:         Puppetclient不运行时,客户端被动接受服务器推送. 1.工作流程 1)客户端puppet调用facter(facter是通过ssl加密收集及检测分析客户端配置信息的一个工具),facter探测出主机的一些变量,如主机名,内存大小,ip地址等.Puppet把这些信息通过ssl连接发送到服务器器端 2)服务器端的puppetmaster通过facter工具分析检测客户端的主

puppet (一)

Puppet sever:172.25.23.1 server1.example.com puppet master client:172.25.23.2 server2.example.com puppet agent client:172.25.23.3 server3.example.com puppet agent server 与所有 client 之间需要解析,以及时间同步,iptables selinux disabled 一.基础配置 1.安装软件 (1) server [[em

在CentOS 6.4上安装Puppet配置管理工具

在CentOS 6.4上安装Puppet配置管理工具 linux, puppetAdd comments 五052013 上篇说了下在ubuntu12.04上安装puppet,安装的版本为puppet2.7.11版本,今天尝试了下在CentOS6.4系统上安装puppet 3.1.1版本,本文参考chenshake的文章 ? 1 2 3 4 OS:centso 6.4 X64 Puppet 3.1.1 Puppet master: master.canghai.com Puppet client

saltstack学习记录

安装 pip 安装 注意  依赖到zeromq3 minion过一段时间去请求master salt-api  可以访问salt去远程执行 ruby puppet   DSL配置   erb文件  模块  加载  模板支持最差 chef     定义直接是ruby代码   erb模板系统   原生支持 python saltstack   yaml配置文件    python程序模板   模板支持很好 python写模块 ipc 进程间通信 都使用key认证    安全 salt-key  -L

xen 记录

几个月没有用 xen  很多东西都忘记了 之前有使用xen 安装上两个db2 server (centos系统) 一个db2 client (ubuntu server) 玩转了好一会儿, 之后机器卡就没有怎么使用, 把相关的服务给停了, 今天突然想用来做puppet 配置: 找到了之前的镜像目录, 节点配置 想启动服务 service xen start 发现没有在xen模式下用 下面是我自己的肤浅的理解 1 要启动xen 的内核扩展的内核 系统在 Domain-0 上运行, Domain-0

10分钟带你光速入门运维工具之-Puppet

一.简介 当服务器数量达到一定的规模时,仅依靠人为完成批量部署服务器个资源的配置,运维工作将变得繁琐且容易出错,为了解决这一问题,我们应该怎么办呢?我们可以引入一批工具,这批工具可编写相应的manifests代码,运行它便可以自动完成所有的工作,目前比较流行的运维工具主要有:puppet,ansible, slackstack等,在这我们主要以puppet来展开话题. 在一些大型互联网企业中,运维自动化管理着几百甚至上千台服务器,它可以针对多台服务器进行统一操作,例如部署统一软件.进行统一上线维

Puppet之DRBD初体验

首先,写这篇文章的目的是为了记录我的学习历程,可以与更多的人分享,希望给出更好的建议,帮助我来改进. 1.因为管理puppet需要dns的配置,在这里我不做过多的介绍. 2.关于puppetmaster与puppetclient之间的证书认证,在这里我不做过多的介绍了,接下来进入主题. DRBD的配置(debian) 首先需要更改一些puppetmaster里面的配置文件. 首先我们进入到puppet的目录下: /etc/puppet/fileserver.conf [files]    pat