前言:
為淅川等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及淅川網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、淅川網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!本篇博客參考了
在領(lǐng)略了puppet種種神奇后,由于puppet通過(guò)catalog來(lái)更新內(nèi)容,期間還可能下載插件,下載file,同步file的內(nèi)容等,這必然要消耗掉master的諸多性能,在獲取的過(guò)程中master和agent說(shuō)白了是https的通信,agent通過(guò)ruby內(nèi)置的Webrick服務(wù)器獲得catalog,而現(xiàn)在流行的webserver肯定對(duì)于靜態(tài)內(nèi)容效率與效果要更好,于是對(duì)master的擴(kuò)展的一種方式演變?yōu)閣ebserver的升級(jí)
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 ...提示... 如果這里提示你什么包頭文件沒(méi)裝,請(qǐng)不要進(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 8140SSLEngine 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/ 檢查語(yǔ)法錯(cuò)誤,下面錯(cuò)誤不是重點(diǎn)就不管了 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-preforOptions None AllowOverride None Order Allow,Deny Allow from All
這是apache端已經(jīng)配置好,還要啟動(dòng)master才行,否則會(huì)報(bào)500的錯(cuò)誤
puppet master start
回到我們的agent端進(jìn)行測(cè)試
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 "-" "-"
就實(shí)現(xiàn)了nginx輔助進(jìn)行catalog的傳遞這個(gè)過(guò)程
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。