前言:
專注于為中小企業提供成都網站建設、做網站服務,電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業遼陽免費做網站提供優質的服務。我們立足成都,凝聚了一批互聯網行業人才,有力地推動了上千余家企業的穩健成長,幫助中小企業通過網站建設實現規模擴充和轉變。
本篇博客參考了<puppet實戰>這本書,測試環境為OpenSuSe13.2+ruby2.1+Apache2.4+Puppet3.7.1 master,Puppet agent為2.7的版本
在領略了puppet種種神奇后,由于puppet通過catalog來更新內容,期間還可能下載插件,下載file,同步file的內容等,這必然要消耗掉master的諸多性能,在獲取的過程中master和agent說白了是https的通信,agent通過ruby內置的Webrick服務器獲得catalog,而現在流行的webserver肯定對于靜態內容效率與效果要更好,于是對master的擴展的一種方式演變為webserver的升級
1 準備工作
zypper in ruby apache2 libcurl libcurl-devel apr apr-devel apache2-devel(yum -y install ruby httpd ...) gem install rack passenger rails passenger-install-apache2-module.ruby2.1 ...提示... 如果這里提示你什么包頭文件沒裝,請不要進行下一步,自己去嘗試安裝devel cat /etc/apache2/vhost.d/liuliancao.com.conf LoadModule passenger_module /usr/lib64/ruby/gems/2.1.0/gems/passenger-5.0.22/buildout/apache2/mod_passenger.so PassengerRoot /usr/lib64/ruby/gems/2.1.0/gems/passenger-5.0.22 PassengerDefaultRuby /usr/bin/ruby.ruby2.1 # And the passenger performance tuning settings: PassengerHighPerformance On # now it is on # PassengerUseGlobalQueue On # Set this to about 1.5 times the number of CPU cores in your master: PassengerMaxPoolSize 3 # Recycle master processes after they service 1000 requests PassengerMaxRequests 1000 # Stop processes if they sit idle for 10 minutes PassengerPoolIdleTime 600 Listen 8140 <VirtualHost *:8140> SSLEngine On # Only allow high security cryptography, ALter if needed for compatibility SSLProtocol ALL -SSLv2 SSLCipherSuite HIGH:!ADH:RC4+RSA:-MEDIUM:-LOW:-EXP SSLCertificateFile /var/lib/puppet/ssl/certs/puppet-master.pem SSLCertificateKeyFile /var/lib/puppet/ssl/private_keys/puppet-master.pem SSLCertificateChainFile /var/lib/puppet/ssl/ca/ca_crt.pem SSLCACertificateFile /var/lib/puppet/ssl/ca/ca_crt.pem SSLCARevocationFile /var/lib/puppet/ssl/ca/ca_crl.pem SSLVerifyCLient optional SSLVerifyDepth 1 SSLOptions +StdEnvVars +ExportCertData # These request headers are used to pass the client certificates # authentication infomation on to the puppet master process RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e #RackAutoDetect On DocumentRoot /usr/share/puppet/rack/puppetmasterd/public/ <Directory /usr/share/puppet/rack/puppetmasterd/> Options None AllowOverride None Order Allow,Deny Allow from All </Directory> </VirtualHost> 檢查語法錯誤,下面錯誤不是重點就不管了 httpd2 -t AH00558: httpd2: Could not reliably determine the server's fully qualified domain name, using 172.16.236.1. Set the 'ServerName' directive globally to suppress this message Syntax OK systemctl start apache2 netstat -tnlp|grep 8140 tcp 0 0 :::8140 :::* LISTEN 11371/httpd2-prefor
這是apache端已經配置好,還要啟動master才行,否則會報500的錯誤
puppet master start
回到我們的agent端進行測試
puppet agent --server puppet-master --test --noop ... notice: Class[Nginx]: Would have triggered 'refresh' from 9 events notice: Stage[main]: Would have triggered 'refresh' from 1 events notice: Finished catalog run in 13.62 seconds
查看master日志的情況
tail /var/log/apache2/access_log 172.16.236.101 - - [20/Dec/2015:21:15:03 +0800] "POST /production/catalog/puppet-agent HTTP/1.1" 200 11044 "-" "-" 172.16.236.101 - - [20/Dec/2015:21:15:04 +0800] "GET /production/file_metadata/modules/user/file_from_module?links=manage HTTP/1.1" 200 303 "-" "-" 172.16.236.101 - - [20/Dec/2015:21:15:18 +0800] "PUT /production/report/puppet-agent HTTP/1.1" 200 9 "-" "-"
就實現了nginx輔助進行catalog的傳遞這個過程
網頁題目:關于puppet的擴展APACHE2+PASSENGER
轉載來源:http://m.newbst.com/article18/gdocgp.html
成都網站建設公司_創新互聯,為您提供Google、自適應網站、網站策劃、移動網站建設、面包屑導航、網站制作
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯