Puppet installation and deployment

Source: Internet
Author: User

Puppet installation and deployment

Environment: CoentOS 5.8 x86_64, selinux, and iptables have disabled host planning:
 
 
  1. server.laoguang.me  192.168.12.117 
  2. client.laoguang.me  192.168.12.161 
1. Preparations before installation are required.1.1 hostname and IP ing write/etc/hosts
 
 
  1. echo " 
  2. 192.168.12.117  server.laoguang.me  server 
  3. 192.168.12.161  client.laoguang.me  client 
  4. " >> /etc/hosts 
  5.  
  6. scp /etc/hosts client:/etc/ 
1.2 synchronization time, which is very important
 
 
  1. yum -y install ntp 
  2. ntpdate ntp.api.bz 
Ii. Install puppet2.1 software preparation
 
 
  1. Factor ## factor is a built-in tool provided by puppet to obtain client variables.
  2. Wget http://puppetlabs.com/downloads/facter/facter-1.6.7.tar.gz
  3. Puppet
  4. Wget http://puppetlabs.com/downloads/puppet/puppet-2.7.13.tar.gz
2.2 install ruby. Puppet is written in ruby.
 
 
  1. yum -y install ruby 
2.3 install facter
 
 
  1. tar zxvf facter-1.6.4.tar.gz 
  2. cd facter-1.6.4 
  3. ruby install.rb 
2.3 install Puppet
 
 
  1. cd .. 
  2. tar zxvf puppet-2.7.6.tar.gz 
  3. cd puppet-2.7.6 
  4. ruby install.rb 
2.4 Add puppet users
 
 
  1. useradd -s /sbin/nologin puppet 
2.5 copy the required configuration file.
 
 
  1. cd conf/redhat/ 
  2. cp puppet.conf /etc/puppet/ 
  3. cp fileserver.conf /etc/puppet/ 
  4. cp logrotate /etc/puppet/ 
  5. cp server.sysconfig /etc/sysconfig/puppetmaster 
  6. cp server.init /etc/init.d/puppetmaster 
Iii. Configuration and Testing3.1 modify the configuration file server without modifying the client:
 
 
  1. Vim/etc/puppet. conf
  2.  
  3. [Main]
  4. Logdir =/var/log/puppet
  5. Rundir =/var/run/puppet
  6. Ssldir = $ vardir/ssl
  7. [Agent]
  8. Classfile = $ vardir/classes.txt
  9. Serverserver = server. laoguang. me # define server
  10. Report = true # status report
  11. Runinterval = 180 # client Update Interval
  12. Localconfig = $ vardir/localconfig
3.2 Test the server front-end startup to facilitate viewing logs:
 
 
  1. puppet master --no-daemonize --debug --verbose 
Client Verification:
 
 
  1. puppetd --test --server server.laoguang.me  
Server to check whether a signature request is received:
 
 
  1. puppet cert --list  
  2.   client.laoguang.me (xx:xx:xx:xx:xx:xx:--) 
The server signs the client
 
 
  1. puppet cert -s client.laoguang.me 
The client obtains the server's configuration for the client and applies
 
 
  1. pupppet --test --server server.laoguang.me 
Deployment is complete! Problems: 1. no puppet is added. server startup fails. 2. no synchronization time, no signature is allowed. After the synchronization time, delete all files under/var/lib/puppet/ssl/and verify again. The installation is relatively simple, the specific configuration in the future will be very complicated. Let's make it easy to update: deploy the puppet web Management page puppet-dashboard 4. Deploy the dashboard4.1 software preparation 1. ruby-enterprise-1.8.7 # compatibility issues with the 1.8.5 System
 
 
  1. wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2012.02.tar.gz 
2. readline-devel # ruby dependency, which is not included in my source
 
 
  1. Wget ftp://rpmfind.net/linux/centos/5.9/ OS /i386/CentOS/readline-devel-5.1-3.el5.i386.rpm # x64 available
3. libtermcap-devel # readline-devel dependency
 
 
  1. wget ftp://rpmfind.net/linux/centos/5.8/os/x86_64/CentOS/libtermcap-devel-2.0.8-46.1.x86_64.rpm 
4. puppet-dashboard-1.2.7 # what we want to install
 
 
  1. wget http://downloads.puppetlabs.com/dashboard/puppet-dashboard-1.2.7.tar.gz 
4.2 install ruby-enterprise-1.87 first install the dependency package
 
 
  1. rpm -ivh libtermcap-devel-2.0.8-46.1.x86_64.rpm readline-devel-5.1-3.el5.i386.rpm 
Unzip and install ruby
 
 
  1. Tar xvf ruby-enterprise-1.8.7-2012.02.tar.gz
  2. Ruby-enterprise-1.8.7-2012.02
  3. ./Installer
  4. <Enter>
  5. [/Opt/ruby-enterprise-1.8.7-2012.02]:/usr/local/ruby # change the installation directory
  6. <Enter>
Change environment variables:
 
 
  1. vim /etc/profile.d/ruby.sh 
  2. export PATH=$PATH:/usr/local/ruby/bin 
  3.  
  4. . /etc/profile.d/ruby.sh 
Add alias
 
 
  1. vim /root/.bashrc 
  2. alias ruby='/usr/local/ruby/bin/ruby' 
  3. . /root/.bashrc 
View version
 
 
  1. ruby -v 
  2. ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) 
  3. [x86_64-linux], MBARI 0x6770,Ruby Enterprise Edition 2012.02 
4.3 install other tools
 
 
  1. gem install ruby-mysql 
  2. gem install rake 
  3. gem install rails 
4.4 install Mysql and Mysql-server
 
 
  1. yum -y install mysql-devel mysql mysql-server 
Start Mysql
 
 
  1. service mysqld start 
Create a database
 
 
  1. mysql 
  2. mysql> create database dashboard default charset utf8; 
  3. mysql> grant all on dashboard.* to 'dashboard'@'localhost' identified by 'redhat'; 
  4. mysql> flush privileges; 
4.5 install dashboard
 
 
  1. tar xvf puppet-dashboard-1.2.7.tar.gz 
  2. mv puppet-dashboard-1.2.7 /usr/local/puppet-dashboard 
  3. cd /usr/local/puppet-dashboard 
Edit configuration file
 
 
  1. Cp config/database. yml. example config/database. yml
  2. Vim config/database. yml
  3.  
  4. Production:
  5. Database: dashboard
  6. Username: dashboard
  7. Password: "redhat"
  8. Encoding: utf8
  9. Adapter: mysql # If mysql-server is on another host, you can add host: Segment
Generate table
 
 
  1. Rake RAILS_ENV = production db: create # This may cause an error. The gem and rails versions may be incompatible,
I chose to downgrade the gem.
 
 
  1. Gem update -- system 1.5.3 # downgrade gem
Re-Execute
 
 
  1. Rake RAILS_ENV = production db: create # Run in/usr/local/puppet-dashboard
  2. Rake RAILS_ENV = production db: migrate
If the execution is normal, congratulations on starting dashboard
 
 
  1. /usr/local/puppet-dashboard/script/server -e production -d 
  2. => Booting WEBrick 
  3. => Rails 2.3.14 application starting on http://0.0.0.0:3000    
Access http: // ip: 3000

650) this. width = 650; "src =" http://img1.51cto.com/attachment/201302/115554268.png "border =" 0 "alt =" "data-pinit =" registered "/>

This article from the "Free Linux, Share Linux" blog, please be sure to keep this source http://laoguang.blog.51cto.com/6013350/1130240

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.