您好,登錄后才能下訂單哦!
前言:
本篇博客參考了<puppet實戰(zhàn)>這本書,測試環(huán)境為OpenSuSe13.2+ruby2.1+Apache2.4+Puppet3.7.1 master,Puppet agent為2.7的版本
在領(lǐng)略了puppet種種神奇后,由于puppet通過catalog來更新內(nèi)容,期間還可能下載插件,下載file,同步file的內(nèi)容等,這必然要消耗掉master的諸多性能,在獲取的過程中master和agent說白了是https的通信,agent通過ruby內(nèi)置的Webrick服務(wù)器獲得catalog,而現(xiàn)在流行的webserver肯定對于靜態(tài)內(nèi)容效率與效果要更好,于是對master的擴(kuò)展的一種方式演變?yōu)閣ebserver的升級
1 準(zhǔn)備工作
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 ...提示... 如果這里提示你什么包頭文件沒裝,請不要進(jìn)行下一步,自己去嘗試安裝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端已經(jīng)配置好,還要啟動master才行,否則會報500的錯誤
puppet master start
回到我們的agent端進(jìn)行測試
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 "-" "-"
就實現(xiàn)了nginx輔助進(jìn)行catalog的傳遞這個過程
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。