puppet集群
实验目的:
由于现有的环境中,puppetmaster是单节点,客户端更新时出现了更新失败和时间较长等现象。
考虑将puppetmaster做成集群的模式,解决大量客户端更新延时和单节点故障问题。主要解决证书问题
环境:
puppetmaster两台:
Puppetmaster1:10.9.24.168
Puppetmaster2:10.9.24.184
Nginx:
Nginx: 10.9.24.183
Client:
Client: 10.9.3.153
yum install puppet-server rubygem-mongrel
配置:
在/etc/hosts写好对应关系
Puppetmaster1:
/etc/sysconfig/puppetmaster(启用mongrel模式)
PUPPETMASTER_PORTS=( 18140 18141 18142 18143 )
PUPPETMASTER_EXTRA_OPTS="—servertype=mongrel --ssl_client_header=HTTP_X_SSL_SUBJECT"
/etc/puppet/puppet.conf:
[main]
bindaddress = 0.0.0.0
(加上这句让puppetmaster监听地址为0.0.0.0,否则只以localhost监听)
netstat -antp
tcp 0 0 0.0.0.0:18140 0.0.0.0:* LISTEN 22822/ruby
tcp 0 0 0.0.0.0:18141 0.0.0.0:* LISTEN 22872/ruby
tcp 0 0 0.0.0.0:18142 0.0.0.0:* LISTEN 22922/ruby
tcp 0 0 0.0.0.0:18143 0.0.0.0:* LISTEN 22972/ruby
/etc/exports:
/var/lib/puppet 10.9.24.184(rw,sync)
(用nfs共享的模式,同步证书)
/etc/puppet//fileserver.conf:
[files]
path /var/lib/puppet/files
allow *
Puppetmaster2:
配置文件参照puppetmaster1
service puppetmaster start,启动puppetmaster
在/etc/fstab中加入如下:
10.9.24.168:/var/lib/puppet /var/lib/puppet nfs defaults 0 0
mount -a //挂载/var/lib/puppet
Nginx:
将puppetmaster1/var/lib/puppet下的文件拷贝到本机/var/lib/puppet下(用nfs挂载也可以)
cat /etc/nginx/nginx.conf:
user daemon daemon;
worker_processes 2;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
large_client_header_buffers 16 4k;
proxy_buffers 128 4k;
keepalive_timeout 65;
ssl on;
upstream puppet-production {
server 10.9.24.168:18140;
server 10.9.24.168:18141;
server 10.9.24.168:18142;
server 10.9.24.168:18143;
server 10.9.24.184:18140;
server 10.9.24.184:18141;
server 10.9.24.184:18142;
server 10.9.24.184:18143;
}
//nginx分发请求
server {
listen 8140;
ssl on;
ssl_session_timeout 5m;
ssl_certificate /var/lib/puppet/ssl/certs/xx.pem;
ssl_certificate_key /var/lib/puppet/ssl/private_keys/xx.pem;
ssl_client_certificate /var/lib/puppet/ssl/ca/ca_crt.pem;
ssl_ciphers SSLv2:-LOW:-EXPORT:RC4+RSA;
ssl_verify_client optional;
ssl_crl /var/lib/puppet/ssl/ca/ca_crl.pem;
(证书位置,先复制到本地)
access_log /var/log/host.access.log main;
location / {
proxy_pass http://puppet-production;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Client-Verify $ssl_client_verify;
proxy_set_header X-Client-DN $ssl_client_s_dn;
proxy_set_header X-SSL-Subject $ssl_client_s_dn;
proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
proxy_read_timeout 65;
}
}
}
现在puppetmaster是用同步方式实现的,可以考虑用证书链的方式实现
Client:
我故意在puppetmaster1和puppetmaster2配置不同的文件:
puppetmaster1
cat /etc/puppet/manifests/main.pp:
node default {
file { "/tmp/temp1.txt": content => "Hello,from puppetmaster1\n"; }
file { "/tmp/test.file":
path => "/tmp/test.file",
source => "puppet://puppet/files/test.file",
owner => "root",
group => "root",
mode => 644,
}
}
puppetmaster2
node default {
file { "/tmp/temp1.txt": content => "Hello,from puppetmaster2\n"; }
file { "/tmp/test.file":
path => "/tmp/test.file",
source => "puppet://puppet/files/test.file",
owner => "root",
group => "root",
mode => 644,
}
}
Client:
puppetd -t:
info: Caching catalog for taffy
info: Applying configuration version '1301714542'
notice: /Stage[main]//Node[default]/File[/tmp/test.file]/ensure: content changed '{md5}52688f6d76cbeccd058bdf6f412b4da0' to '{md5}52688f6d76cbeccd058bdf6f412b4da0'
notice: /Stage[main]//Node[default]/File[/tmp/temp1.txt]/checksum: defined 'checksum' as '{md5}1cf6c62d2c8ddde94e97aa9140861b0e'
notice: /Stage[main]//Node[default]/File[/tmp/temp1.txt]/content: defined content as 'unknown checksum'
notice: Finished catalog run in 0.13 seconds
cat /tmp/temp1.txt:
Hello,from puppetmaster1 (从puppetmaster1取过来的)
puppetd -t: (再推一次)
info: Caching catalog for taffy
info: Applying configuration version '1301505457'
--- /tmp/temp1.txt 2011-04-02 11:20:38.509009000 +0800
+++ /tmp/puppet-diffing20110402-1217-jqru9o-0 2011-04-02 11:30:10.258009000 +0800
@@ -1 +1 @@
-Hello,from puppetmaster1
+Hello,from puppetmaster2 (过来了,从puppetmaster2取出的)
info: /Stage[main]//Node[default]/File[/tmp/temp1.txt]: Filebucketed /tmp/temp1.txt to puppet with sum cab0e6a2c555b3f96f10ed2972708d34
notice: /Stage[main]//Node[default]/File[/tmp/temp1.txt]/content: content changed '{md5}cab0e6a2c555b3f96f10ed2972708d34' to 'unknown checksum'
notice: Finished catalog run in 0.11 seconds
puppet集群的更多相关文章
- 多puppetmaster,多ca,keepalived+haproxy(nginx)puppet集群搭建
多puppetmaster,多ca,keepalived+haproxy(nginx)puppet集群搭建 一.服务器详情 192.168.122.111 pm01.jq.com pm01 #(pup ...
- 基于puppet分布式集群管理公有云多租户的架构浅谈
基于puppet分布式集群管理公有云多租户的架构浅谈 一.架构介绍 在此架构中,每个租户的业务集群部署一台puppet-master作为自己所在业务集群的puppet的主服务器,在每个业务集群所拥 ...
- 利用 Puppet 实现自动化管理配置 Linux 计算机集群
随着虚拟化和云计算技术的兴起,计算机集群的自动化管理和配置成为了数据中心运维管理的热点.对于 IaaS.Paas.Saas 来说,随着业务需求的提升,后台计算机集群的数量也会线性增加.对于数据中心的运 ...
- 扩展Puppet – 建立Puppet CA集群
扩展Puppet – 建立Puppet CA集群 (1 votes, average: 5.00 out of 5) 588 views 2012 年 3 月 4 日Puppet.运维ca.mast ...
- 集群工具ansible使用方法
ansible简介 ansible是与puppet.saltstack类似的集群管理工具,其优点是仅需要ssh和Python即可使用,而不像puppet.saltstack那样都需要客户端.与pupp ...
- Linux 集群
html,body { } .CodeMirror { height: auto } .CodeMirror-scroll { } .CodeMirror-lines { padding: 4px 0 ...
- redis集群讨论
一.生产应用场景 二.存储架构演变 三.应用最佳实践 四.运维经验总结 第1.2节:介绍redis cluster在唯品会的生产应用场景,以及存储架构的演变.第3节:redis cluster的稳定性 ...
- 使用Chef管理windows集群
但凡服务器上了一定规模(百台以上),普通的ssh登录管理的模式就越来越举步维艰.试想Linux发布了一个高危漏洞的补丁,你要把手下成百上千台机器都更新该补丁,如果没有一种自动化方式,那么至少要耗上大半 ...
- Hadoop - Ambari集群管理剖析
1.Overview Ambari是Apache推出的一个集中管理Hadoop的集群的一个平台,可以快速帮助搭建Hadoop及相关以来组件的平台,管理集群方便.这篇博客记录Ambari的相关问题和注意 ...
随机推荐
- Leetcode之动态规划(DP)专题-53. 最大子序和(Maximum Subarray)
Leetcode之动态规划(DP)专题-53. 最大子序和(Maximum Subarray) 给定一个整数数组 nums ,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和. ...
- WinForm笔记1:TextBox编辑时和DataGridView 单元格编辑时 的事件及其顺序
TextBox 编辑框 When you change the focus by using the mouse or by calling the Focus method, focus event ...
- (4.15)mysql备份还原——物理备份之XtraBackup的下载与安装
关键词:mysql物理备份,XtraBackup,XtraBackup安装,XtraBackup下载 实践链接:https://www.cnblogs.com/gered/p/11147193.htm ...
- 【转帖】Gitlab 从 12.1 版本开始将不再支持 MySQL !
Gitlab 从 12.1 版本开始将不再支持 MySQL ! Gitlab 官方宣布,将从 12.1 版本开始不再支持 MySQL 数据库. http://news.51cto.com/art/20 ...
- Head First PHP&MySQl第一章代码
HTML: <!doctype html> <html lang="zh-cn"> <head> <meta charset=" ...
- Codeforces 1220E. Tourism
传送门 这是一道英语题,首先要读懂题目: $\text{Alex believes that his trip will be interesting only if he will not use ...
- spring boot 配置文件动态更新原理 以Nacos为例
配置文件的动态更新 通常获取配置文件的方式 1, @Value 2. @ConfigurationProperties(Prefix) 如果是在运行时要动态更新的话, 第一种方式要在bean上加@Re ...
- 第一篇 jQuery
1-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3. ...
- snappy-java两种压缩方式的区别
1.Snappy-java项目地址 https://github.com/xerial/snappy-java 2.Snappy-java两种压缩方式 使用Snappy.compress进行压缩 St ...
- 06 基本数据结构 - 双端队列(Deque)
一.双端队列(Deque) - 概念:deque(也称为双端队列)是与队列类似的项的有序集合.它有两个端部,首部和尾部,并且项在集合中保持不变. - 特性:deque 特殊之处在于添加和删除项是非限制 ...