成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

puppet 3+Unicorn+Nginx安裝配置

運維 系統運維
Unicorn 效率要比 Webrick 高很多,所以決定要用Unicorn 替換 Webrick……

puppet server 安裝

  1. rpm -ivh http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-6.noarch.rpm  
  2. yum install puppet-server -y 

puppet server puppet.conf 配置:

  1. cat /etc/puppet/puppet.conf  
  2. [main]  
  3. # The Puppet log directory.  
  4. # The default value is '$vardir/log'.  
  5. logdir = /var/log/puppet  
  6. # Where Puppet PID files are kept.  
  7. # The default value is '$vardir/run'.  
  8. rundir = /var/run/puppet  
  9. # Where SSL certificates are kept.  
  10. # The default value is '$confdir/ssl'.  
  11. ssldir = $vardir/ssl  
  12. autosign = $confdir/autosign.conf { mode = 664 }  
  13. [agent]  
  14. # The file in which puppetd stores a list of the classes  
  15. # associated with the retrieved configuratiion. Can be loaded in  
  16. # the separate ``puppet`` executable using the ``--loadclasses``  
  17. # option.  
  18. # The default value is '$confdir/classes.txt'.  
  19. classfile = $vardir/classes.txt  
  20. # Where puppetd caches the local configuration. An  
  21. # extension indicating the cache format is added automatically.  
  22. # The default value is '$confdir/localconfig'.  
  23. localconfig = $vardir/localconfig  
  24. [development]  
  25. modulepath = /etc/puppet/modules:/usr/share/puppet/modules  
  26. config_version =  
  27. [production]  
  28. modulepath = /etc/puppet/modules:/usr/share/puppet/modules  
  29. config_version = 

Unicorn 安裝配置

  1. yum install ruby-devel make gcc  
  2. gem install unicorn rack  
  3. cp /usr/share/puppet/ext/rack/config.ru /etc/puppet/  
  4. vi /etc/puppet/unicorn.conf  
  5. worker_processes 8  
  6. working_directory "/etc/puppet"  
  7. listen '/var/run/puppet/puppetmaster_unicorn.sock', :backlog => 512  
  8. timeout 120  
  9. pid "/var/run/puppet/puppetmaster_unicorn.pid"  
  10. preload_app true  
  11. if GC.respond_to?(:copy_on_write_friendly=)  
  12. GC.copy_on_write_friendly = true 
  13. end  
  14. before_fork do |server, worker|  
  15. old_pid = "#{server.config[:pid]}.oldbin" 
  16. if File.exists?(old_pid); server.pid != old_pid  
  17. begin  
  18. Process.kill("QUIT", File.read(old_pid).to_i)  
  19. rescue Errno::ENOENT, Errno::ESRCH  
  20. # someone else did our job for us  
  21. end  
  22. end  
  23. end 

調試:

  1. unicorn -c /etc/puppet/unicorn.conf  
  2. I, [2014-08-15T08:55:36.452577 #9031] INFO -- : Refreshing Gem list  
  3. I, [2014-08-15T08:55:38.779972 #9031] INFO -- : unlinking existing socket=/var/run/puppet/puppetmaster_unicorn.sock  
  4. I, [2014-08-15T08:55:38.780441 #9031] INFO -- : listening on addr=/var/run/puppet/puppetmaster_unicorn.sock fd=6 
  5. I, [2014-08-15T08:55:38.787469 #9059] INFO -- : worker=0 spawned pid=9059 
  6. I, [2014-08-15T08:55:38.790368 #9059] INFO -- : worker=0 ready  
  7. I, [2014-08-15T08:55:38.792410 #9060] INFO -- : worker=1 spawned pid=9060 
  8. I, [2014-08-15T08:55:38.795405 #9060] INFO -- : worker=1 ready  
  9. I, [2014-08-15T08:55:38.796387 #9061] INFO -- : worker=2 spawned pid=9061 
  10. I, [2014-08-15T08:55:38.799071 #9061] INFO -- : worker=2 ready  
  11. I, [2014-08-15T08:55:38.801353 #9062] INFO -- : worker=3 spawned pid=9062 
  12. I, [2014-08-15T08:55:38.804052 #9062] INFO -- : worker=3 ready  
  13. I, [2014-08-15T08:55:38.805570 #9063] INFO -- : worker=4 spawned pid=9063 
  14. I, [2014-08-15T08:55:38.808220 #9063] INFO -- : worker=4 ready  
  15. I, [2014-08-15T08:55:38.810281 #9064] INFO -- : worker=5 spawned pid=9064 
  16. I, [2014-08-15T08:55:38.812904 #9064] INFO -- : worker=5 ready  
  17. I, [2014-08-15T08:55:38.814869 #9065] INFO -- : worker=6 spawned pid=9065 
  18. I, [2014-08-15T08:55:38.817497 #9065] INFO -- : worker=6 ready  
  19. I, [2014-08-15T08:55:38.817731 #9031] INFO -- : master process ready  
  20. I, [2014-08-15T08:55:38.819580 #9066] INFO -- : worker=7 spawned pid=9066 
  21. I, [2014-08-15T08:55:38.822096 #9066] INFO -- : worker=7 ready 

按ctrl+c結束

編寫啟動腳本

  1. vi /etc/init.d/puppet-unicorn  
  2. #!/bin/bash  
  3. # unicorn-puppet  
  4. # chkconfig: - 98 02  
  5. #  
  6. # description: Enables periodic system configuration checks through unicorn-puppet.  
  7. # processname: unicorn-puppet  
  8. # Source function library.  
  9. . /etc/rc.d/init.d/functions  
  10. lockfile=/var/lock/puppetmaster-unicorn  
  11. pidfile=/var/run/puppet/puppetmaster_unicorn.pid  
  12. RETVAL=0 
  13. DAEMON=/usr/bin/unicorn  
  14. DAEMON_OPTS="-D -c /etc/puppet/unicorn.conf" 
  15. start() {  
  16. echo -n $"Starting puppet unicorn: "  
  17. daemon $DAEMON $DAEMON_OPTS  
  18. RETVAL=$?  
  19. echo  
  20. [ $RETVAL = 0 ] && touch ${lockfile}  
  21. return $RETVAL  
  22. }  
  23. stop() {  
  24. echo -n $"Stopping puppet unicorn: "  
  25. kill `cat $pidfile`  
  26. RETVAL=$?  
  27. [ $RETVAL -eq 0 ] && rm -f {$lockfile} {$pidfile}  
  28. [ $RETVAL -eq 0 ] && echo_success || echo_failure  
  29. echo  
  30. return $RETVAL  
  31. }  
  32. restart() {  
  33. stop  
  34. start  
  35. }  
  36. usage() {  
  37. echo "Usage: $0 {start|stop|restart}" ;  
  38. return 3  
  39. }  
  40. case "$1" in  
  41. start)  
  42. start  
  43. ;;  
  44. stop)  
  45. stop  
  46. ;;  
  47. restart)  
  48. restart  
  49. ;;  
  50. *)  
  51. usage  
  52. ;;  
  53. esac  
  54. exit $RETVAL 
  1. chmod +x /etc/init.d/puppet-unicorn  
  2. chkconfig puppet-unicorn on 

配置nginx

  1. vi /etc/nginx/conf.d/puppets-unicorn  
  2. upstream puppetmaster_unicorn {  
  3. server unix:/var/run/puppet/puppetmaster_unicorn.sock fail_timeout=0;  
  4. }  
  5. server {  
  6. listen 8140;  
  7. ssl on;  
  8. ssl_session_timeout 5m;  
  9. ssl_certificate /var/lib/puppet/ssl/certs/puppet.test.com.pem;  
  10. ssl_certificate_key /var/lib/puppet/ssl/private_keys/puppet.test.com.pem;  
  11. ssl_client_certificate /var/lib/puppet/ssl/ca/ca_crt.pem;  
  12. ssl_ciphers SSLv2:-LOW:-EXPORT:RC4+RSA;  
  13. ssl_verify_client optional;  
  14. root /usr/share/empty;  
  15. proxy_set_header Host $host;  
  16. proxy_set_header X-Real-IP $remote_addr;  
  17. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
  18. proxy_set_header X-Client-Verify $ssl_client_verify;  
  19. proxy_set_header X-Client-DN $ssl_client_s_dn;  
  20. proxy_set_header X-SSL-Issuer $ssl_client_i_dn;  
  21. proxy_read_timeout 120;  
  22. location / {  
  23. proxy_pass http://puppetmaster_unicorn;  
  24. proxy_redirect off;  
  25. }  
  26. }  
  27. /etc/init.d/nginx start  
  28. chkconfig nginx on 

參考網址:

https://linuxmoz.com/rhel-centos-install-puppet-nginx-unicorn/

http://projects.puppetlabs.com/projects/1/wiki/using_unicorn

原文鏈接:http://my.oschina.net/u/142602/blog/301400

責任編輯:牛小雨 來源: 酒瓶不倒的博客
相關推薦

2010-02-06 14:00:05

Linux Nginx

2010-06-07 11:22:28

2011-02-25 17:48:52

2011-03-02 10:41:41

Vsftpd安裝

2011-04-01 15:00:35

2011-04-02 14:21:46

MRTG安裝

2011-02-23 10:43:17

2012-06-19 15:51:22

集群系列2

2012-09-04 14:52:28

Puppet

2011-03-11 16:42:38

Ubuntu安裝LAMP

2011-03-25 13:40:28

Cacti安裝配置

2013-11-28 09:44:00

2011-11-08 21:55:58

MRTG 配置

2011-03-30 15:05:40

MRTG安裝

2011-04-02 15:26:51

Cacti安裝

2011-02-25 17:19:09

Pureftpd安裝

2011-03-25 15:01:44

Cacti安裝

2011-04-02 15:17:59

2011-04-02 15:26:58

Cacti安裝

2011-03-24 13:00:30

點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 福利一区二区 | 国产成人免费在线 | 中文字幕国产 | 亚洲一区二区久久 | 欧美a在线| 国产精品成人国产乱一区 | 自拍偷拍亚洲欧美 | ririsao久久精品一区 | 日本不卡一区 | 成人精品国产一区二区4080 | 亚洲综合天堂网 | 91精品国产综合久久国产大片 | 精品欧美乱码久久久久久 | 久久精品国产99国产精品 | 亚洲午夜精品视频 | 欧美激情欧美激情在线五月 | 成年人网站在线观看视频 | 黄色国产视频 | 久久精品国产一区二区电影 | 玖玖爱365 | 91精品国产色综合久久不卡蜜臀 | 色综合久久天天综合网 | 国产精品一区二区三区免费观看 | 国产黄色小视频在线观看 | 超碰97av | 国产精品欧美一区二区 | 国产精品一区二区视频 | 亚洲成人在线网 | 天天干天天操天天射 | 欧美日韩国产一区 | 日批免费看 | 欧美激情视频一区二区三区在线播放 | 亚洲一区二区视频 | h视频亚洲 | 久久成人精品一区二区三区 | 特级做a爰片毛片免费看108 | 久久久久国产一区二区三区四区 | 九九精品网 | www.色综合 | 一区二区三区中文字幕 | 欧美日韩亚洲视频 |