puppet-master搭建
puppet 搭建
Table of Contents
配置yum源
备份系统自带yum源
[root@master ~]# cd /etc/yum.repos.d/
[root@master yum.repos.d]# mkdir bak
[root@master yum.repos.d]# mv *.repo bak
配置官网yum源(这个不太好用,建议不使用)
rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
配置hosts
更改/etc/hosts文件和/etc/hostname
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#yum的仓库域名解析
10.0.10.108 mirrors.polex.io
#设置fqdn(格式为:ip fqdn hostname)
127.0.0.1 master.puppet.io master
#设置agent域名解析
10.211.55.3 agent.puppet.io
[root@master yum.repos.d]# cat /etc/hostname
master
验证fqdn是否设置正确
[root@master ~]# hostname -f
master.puppet.io
安装puppet-server
- yum安装软件包
yum install puppetserver
更改配置文件/etc/sysconfig/puppetserver(如果需要)
JAVA_ARGS="-Xms2g -Xmx2g -XX:MaxPermSize=256m”
替换为
JAVA_ARGS="-Xms512m -Xmx512m -XX:MaxPermSize=256m”更改配置文件puppet.conf(默认不需要更改)
[root@master ~]# cat backup/puppetlabs/puppet/puppet.conf
# This file can be used to override the default puppet settings.
# See the following links for more details on what settings are available:
# - https://docs.puppetlabs.com/puppet/latest/reference/config_important_settings.html
# - https://docs.puppetlabs.com/puppet/latest/reference/config_about_settings.html
# - https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html
# - https://docs.puppetlabs.com/puppet/latest/reference/configuration.html
[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
- 启动服务
[root@master ~]# systemctl start puppetserver
- 验证
参考第4步的验证
部署puppet-agent
- yum安装软件包(如果部署过puppetserver就不用再次安装,puppetserver依赖于puppet-agent)
yum install puppet
- 更改配置文件puppet.conf
[root@master ~]# cat /etc/puppetlabs/puppet/puppet.conf
# This file can be used to override the default puppet settings.
# See the following links for more details on what settings are available:
# - https://docs.puppetlabs.com/puppet/latest/reference/config_important_settings.html
# - https://docs.puppetlabs.com/puppet/latest/reference/config_about_settings.html
# - https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html
# - https://docs.puppetlabs.com/puppet/latest/reference/configuration.html
[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
[agent]
#客户端传给master的验证名称
certname = agent.puppet.io
pluginsync = true
#puppetserver的服务端口
masterport = 8140
#agent使用master的环境指定
environment = production
#master的地址
server = master.puppet.io
listen = false
splay = false
splaylimit = 1800
#agent的运行周期
runinterval = 1800
noop = false
usecacheonfailure = true
- 启动服务
[root@master ~]# systemctl start puppet
- 验证
[root@master puppet]# puppet agent -vt
Info: Creating a new SSL key for agent.puppet.io
Info: csr_attributes file loading from /etc/puppetlabs/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for agent.puppet.io
Info: Certificate Request fingerprint (SHA256): CE:92:AF:5F:62:12:F6:F4:DB:59:41:7D:16:5B:19:3D:EC:7E:BB:B1:60:D6:DE:5D:2A:14:1A:23:60:8A:E6:B2
Exiting; no certificate found and waitforcert is disabled
查看证书
[root@master puppet]# puppet cert list
"agent.puppet.io" (SHA256) CE:92:AF:5F:62:12:F6:F4:DB:59:41:7D:16:5B:19:3D:EC:7E:BB:B1:60:D6:DE:5D:2A:14:1A:23:60:8A:E6:B2
trouble-shoting
- 报错信息如下:
[root@master ~]# puppet agent -vt
Exiting; no certificate found and waitforcert is disabled
解决办法:
尝试清理证书:
[root@master ~]# puppet cert clean agent.puppet.io
Error: Could not find a serial number for agent.puppet.io
找到证书的文件,并删除,问题即可解决。
[root@master ~]# cd /etc/puppetlabs/puppet
puppet/ puppetserver/
[root@master ~]# cd /etc/puppetlabs/puppet
[root@master puppet]# find . -name "agent.puppet.io*"
./ssl/public_keys/agent.puppet.io.pem
./ssl/certificate_requests/agent.puppet.io.pem
./ssl/private_keys/agent.puppet.io.pem
./ssl/ca/requests/agent.puppet.io.pem
[root@master puppet]# rm -rf ./ssl/public_keys/agent.puppet.io.pem ./ssl/certificate_requests/agent.puppet.io.pem ./ssl/private_keys/agent.puppet.io.pem ./ssl/ca/requests/agent.puppet.io.pem
[root@master puppet]# puppet cert list
[root@master puppet]#
puppet-master搭建的更多相关文章
- Advacned Puppet: Puppet Master性能调优
本文是Advanced Puppet系列的第一篇:Puppet master性能调优,谈一谈如何优化和提高C/S架构下master端的性能. 故事情节往往惊人地类似:你是一名使用Puppet管理线上业 ...
- Puppet master nginx 扩展提升性能(puppet自动化系列4)
puppet使用SSL(https)协议来进行通讯,默认情况下,puppet server端使用基于Ruby的WEBRick HTTP服务器.由于WEBRick HTTP服务器在处理agent端的性能 ...
- 自动化运维工具之Puppet master/agent模型、站点清单和puppet多环境设定
前文我们了解了puppe中模块的使用,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/14086315.html:今天我来了解下puppet的master/age ...
- Configure Puppet Master with Passenger and Apache on Centos
What is Passenger? Passenger (AKA mod_rails or mod_rack) is an Apache 2.x module which lets you run ...
- WEBrick/Rack Puppet Master
Puppet's Services: The WEBrick Puppet Master Puppet master is the application that compiles configur ...
- Puppet master/agent installation on RHEL7
==================================================================================================== ...
- 部署puppet master/agent模型
自己画的一个简单的架构图 agent端每隔30分钟到master端请求与自己相关的catalog. 各节点时间要同步. 依赖DNS,各节点能通过主机名能解析. 1.同步时间 # yum install ...
- puppet master/agent
puppet master/agent 配置 安装 master: yum install puppet-server agent: yum install puppet 自动签名 puppet的ma ...
- Puppet的搭建和应用
Puppet的部署与应用 1. 案例概述 作为一名系统管理员,维护服务器正常运行是最基本的职责,在管理几台到几十台服务器时,大部分管理员喜欢自己写小工具来维护,但随着服务器的数量曾多,任务量也逐渐增多 ...
- puppet master 用 nginx + unicorn 作为前端
目录 1. 概要 2. nginx + unicorn 配置 2.1. package 安装 2.2. 配置文件设置 2.2.1. 配置 unicorn 2.2.2. 配置nginx 2.3. 测试配 ...
随机推荐
- 自学elastic search
工作也有一段时间了,虽然来这个公司之后学会了几门不同的语言,但想拨尖还是任重道远. 想往高级程序员甚至是架构师方向发展.他仍然是我的学习对象.我现在做着的,无非是他玩剩下的罢了. luncene之前有 ...
- 用Java代码通过JDBC连接Hiveserver2
1.在终端启动hiveserver2#hiveserver2 2.使用beeline连接hive另外打开一个终端,输入如下命令(xavierdb必须是已经存在的数据库)#beeline -u jdbc ...
- GUI学习之八——复选框QCheckBox的学习总结
一.描述 a.QCheckBox一般用于给用户提供若干选项中多个选择时的使用 b.控件左侧有一个方框来显示控件被选中. c.复选框是有三种状态的 二.使用 1.创建 复选框的创建和常规的按钮创建方式是 ...
- 6行代码实现纯js导出excel
// excel导出当前列表 function memberExport() { var oHtml = $('#list').html(); var excelHtml = '<html> ...
- java中的 java.util.concurrent.locks.ReentrantLock类中的lockInterruptibly()方法介绍
在java的 java.util.concurrent.locks包中,ReentrantLock类实现了lock接口,lock接口用于加锁和解锁限制,加锁后必须释放锁,其他的线程才能进入到里面执行, ...
- Java和C++的数组比较
Java:数组的定义:如下两种方式都可以:int array[];int[] array; 注意:数组在定义后,不能直接使用.必须在初始化后才能使用.初始化有两种方式:1.静态初始化:int arra ...
- 【微信小程序开发之坑】javascript创建date对象
最近开发中用到date,开始以如下方式来创建: var date = new Date('2018-01-30 11:00:00'); 在开发工具上,调试,ios 和 android都好好的. 在真机 ...
- Eclipse导入的User Libarary
在使用eclipse导入外部jar包时,经常使用Add User Libarary的方式,采用这种方式,外部的jar包没有直接添加到WEB-INF/libs下,那这些jar是在哪里引入的呢? 使用外部 ...
- 《Linux就该这么学》第十二天课程
使用ssh服务管理远程主机 绑定两块网卡 原创地址:https://www.linuxprobe.com/chapter-09.html 第1步:在虚拟机系统中再添加一块网卡设备,请确保两块网卡都处在 ...
- Maths | 层次分析法(Analytic Hierarchy Process)
目录 1. 概述 2. AHP算法 2.1. 建立层级 2.2. 构造 成对 比较 矩阵 2.3. 成对比较矩阵的 一致性检验 与 层次单排序 2.4. 层次总排序 参考: (中文)https://z ...