【linux系统下载_学习_教程_编程_软件】提供全系列Linux发行版下载学习-Linux部落
当前位置: 主页 > Linux系统教程 > 自动化 >

puppet用nginx做代理多个端口负载均衡

时间:2017-09-19 14:31来源:原创 作者:admin 点击:
------分隔线----------------------------
有的时候puppet客户端主机多了,puppetmaster难以承载,下面介绍一下在puppetmaster起多个端口同时提供服务,提升性能的方法

系统环境          :CentOS 6.5
puppet安装     :略
nginx安装参考:http://www.linuxzone.net/web/198.html

#yum install rubygem-mongrel nginx
#cat /etc/sysconfig/puppetmaster
PUPPETMASTER_PORTS=(8141 8142 8143)
PUPPETMASTER_EXTRA_OPTS="--servertype=mongrel --ssl_client_header=HTTP_X_SSL_SUBJECT"

# cat /usr/local/nginx/conf/vhosts/puppet_server.conf
 upstream puppetmaster {
      server 127.0.0.1:8141;
      server 127.0.0.1:8142;
      server 127.0.0.1:8143;
  }

 server {
        listen 8140;
        server_name  puppet.linuxzone.net;
        root    /etc/puppet;
        access_log   /var/wwwlog/puppet/access.log main;
 
        ssl                     on;
        ssl_session_timeout     5m;
        ssl_certificate             /etc/puppet/ssl/certs/puppet.linuxzone.net.pem;                   #puppetserver的证书
        ssl_certificate_key     /etc/puppet/ssl/private_keys/puppet.linuxzone.net.pem;
        ssl_client_certificate  /etc/puppet/ssl/ca/ca_crt.pem;
        ssl_crl                 /etc/puppet/ssl/ca/ca_crl.pem;
        ssl_ciphers             SSLv2:-LOW:-EXPORT:RC4+RSA;
        ssl_verify_client       optional;
        location / {
            proxy_pass          http://puppetmaster;
            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;
        }
    }

启动nginx,重启puppetserver,配置完成


本文地址:http://www.linuxzone.net/auto/219.html
------分隔线----------------------------
相关文章
栏目列表