Puppet3 installation in CentOS6.5 Cluster
Puppet3 installation in CentOS6.5 Cluster
Environment: three hosts,
The IP addresses are 10.211.55.11, 12, and 13 respectively.
Install puppet master on 10.211.55.11
Puppet agent is installed on 10.211.55.11, 12, and 13
1. Install puppet Dashboard after the EPEL Library
Yum install yum-priorities
Rpm-ivh https://dl.Fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
Rpm-import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
The source can be replaced with a domestic image.
Http://mirrors.ustc.edu.cn/fedora/epel/epel-release-latest-6.noarch.rpm
Http://mirrors.ustc.edu.cn/fedora/epel/RPM-GPG-KEY-EPEL-6
Modify the/etc/yum. repos. d/epel. repo File
Add an attribute at the end of [epel]
Priority = 11
It means that yum first goes to the official site for source check, and the official site does not go to the epel site for source check.
2. Install the dnsmasq domain name resolution service on 10.211.55.11.
Yum install dnsmasq
Chkconfig dnsmasq on
Service dnsmasq start
Lokkit-p 53: udp (Open Port iptables 53)
Echo "10.211.55.11 node01.myhost.com">/etc/hosts
Modify dnsmasq. conf
Interface = eth0
Listen-address = 10.211.55.11
Bind-interfaces
Resolv-file =/etc/resolv. conf
Addn-hosts =/etc/hosts
Enter
Echo "nameserver 10.211.55.11">/etc/resolv. conf
Change Host Name
1
2
Vi/etc/sysconfig/network
Change to node01.myhost.com, node02.myhost.com, and node03.myhost.com respectively.
Verify that DNS is successful
Netstat-tunlp | grep 53
Dig node02.myhost.com
3. Install the time synchronization server on 10.211.55.11.
Yum install ntp
Chkconfig ntpd on
Service ntpd start
(To be improved)
4. Install Puppet
Install official sources
Rpm-ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
Import the GPG key (verify the integrity of the package)
Rpm -- import http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
Install
Yum install puppet-server
Service puppetmaster start
Service puppet start
Chkconfig puppetmaster on
Chkconfig puppet on
Edit/etc/puppet. conf
[Agent]
Server = node01.myhost.com
Automatic Signature
Cat>/etc/puppet/autosign. conf <
Test connection
Puppet agent-t
Delete Certificate
Find/var/lib/puppet/ssl-name localhost. pem-delete
Common Information
Puppet cert list-all (view all certificates)
Cat/etc/sysconfig/puppet (default configuration)
/Var/lib/puppet (agent certificate location)
/Etc/puppet. conf (configuration file)
/Usr/share/puppet (installation location)
Puppet config print modulepath (View module location)
Puppet agent-t -- summarize (View Report)
5. Install Dashboard
Yum install-y mysql-devel mysql-server httpd mod_passenger puppet-dashboard
Mod_passenger enables apache to support ruby
Configuration:
/Etc/my. cnf,
Add the last line in the [mysqld] Field
# Allowing 32 MB allows an occasional 17 MB row with plenty of spare room
Max_allowed_packet = 32 M
/Etc/init. d/mysqld start
Chkconfig mysqld on
Chkconfig httpd on
Service httpd start
Mysqladmin-u root password 'Password'
Create a dashboard Database
1
Mysql-uroot-ppassword <
Edit/usr/share/puppet-dashboard/config/database. yml
Production:
Database: dashboard
Username: dashboard
Password: password
Encoding: utf8
Adapter: mysql
Modify the time zone/usr/share/puppet-dashboard/config/environment. rb
# Config. time_zone = 'utc'
Config. time_zone = 'beijing'
Initialize Database
Cd/usr/share/puppet-dashboard/
Rake RAILS_ENV = production db: migrate
Configure Apache
Cat>/etc/httpd/conf. d/passenger. conf <EOF
LoadModule passenger_module modules/mod_passenger.so
PassengerRoot/usr/share/rubygems/gems/passenger-3.0.17
PassengerRuby/usr/bin/ruby
PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
PassengerStatThrottleRate 120
RailsAutoDetect On
ServerName node01.myhost.com
DocumentRoot "/usr/share/puppet-dashboard/public /"
<Directory "/usr/share/puppet-dashboard/public/">
Options None
AllowOverride AuthConfig
Order allow, deny
Allow from all
ErrorLog/var/log/httpd/node01.myhost.com _ error. log
LogLevel warn
CustomLog/var/log/httpd/node06.chenshake.com _ access. log combined
ServerSignature On
EOF
/Etc/init. d/httpd start
Chkconfig httpd on
Lokkit-p 80: tcp
Configure puppet
# Puppet. conf (on puppet master)
[Master]
Reports = store, http
Reporturl = http://node06.chenshake.com: 80/reports/upload
/Etc/init. d/puppetmaster restart
Import report
Cd/usr/share/puppet-dashboard
Rake gems: refresh_specs
Rake RAILS_ENV = production reports: import
Delayed Job Workers
Env RAILS_ENV = production/usr/share/puppet-dashboard/script/delayed_job-p dashboard-n 4-m start
Ps-ef | grep delayed_job | grep-v grep
Env RAILS_ENV = production/usr/share/puppet-dashboard/script/delayed_job-p dashboard-n 4-m stop
At this time, you can see the data in Dashbaord.
6. Install Foreman (to be improved)
Puppet Learning Series:
Puppet Learning 1: Installation and simple instance applications
Puppet 2: simple module configuration and application
Research on three Backup Recovery solutions for Puppet agent
Register your Puppet node in a safer way
Deep understanding of Puppet syntax and working mechanism through SSH Configuration
Puppet uses Nginx multiple ports for Load Balancing
Puppet centralized Configuration Management System details
C/S mode instance of Puppet in CentOS (5 and 6)
For more information about Puppet, click here.
Puppet: click here
This article permanently updates the link address: