Puppet Detailed Deployment Guide

Source: Internet
Author: User

First, installation environment

Requires two computers or virtual machines; one is server and one is client; the configuration is as follows:

Cat/etc/hosts

127.0.0.1 localhost.localdomain localhost

192.168.*.200 server.example.com Server

192.168.*.180 client.example.com Client

Note: The host name must be a combination of letters and numbers, no special symbols such as _;

Note: All hosts require clock synchronization

Yum Install NTP

Chkconfig NTP on

Ntpdate pool.ntp.org

Note: Configure the Epel source

RPM-IVH https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Yum-config-manager--enable Epel

Yum Update


Second, the installation of puppet services

1. Service Side

Yum install ruby Ruby-libs ruby-rdoc #Puppet需要Ruby支持, see command-line help to install Ruby-rdoc

Yum Install Puppet-server

Chkconfig Puppet on

/etc/init.d/puppetmaster start

Close Iptables and SELinux

2, the Client

Yum Install puppet

In/etc/puppet/puppet.conf [agent] Plus server = server.example.com Specify the service side

3. Configure auto-issuing certificate settings on the server

Cat/etc/puppet/autosign.conf

*.example.com

In/etc/puppet/puppet.conf [main] plus autosign = true to make autosign.conf effective

/etc/init.d/puppetmaster restart

4. Debug Test generation certificate on client

Puppet agent--no-daemonize--onetime--verbose--debug

5. View certificate information on the service side

Puppet cert List-all

"Server.example.com" (25:11:e6:a6:21:55:a3:4f:30:e4:c7:50:92:4c:63:50) (Alt names: "Dns:puppet", "DNS: Puppet.example.com "," DNS:server.example.com ")

+ "client.example.com" (9c:da:6f:89:c3:5c:4e:73:5a:9f:a6:35:66:fe:53:8e)

Front with "+" indicates successful certificate signing

6. Example Test

Service side

Cat/etc/puppet/manifests/site.pp

Node Default {

File {

"/tmp/helloworld.txt": content = "Hello, world";

}

}

Note:

Err:could not retrieve catalog from remote Server:error to server:could not to find default node or by name with ' Clie Nt.example.com, client.example, client ' on node client.example.com

Warning:not using cache on failed catalog

Err:could not retrieve catalog; Skipping run

It could be/etc/puppet/manifests/site. PP This file has a problem writing format

Client

Puppet Agent--test--server=server.example.com

Cat/tmp/helloworld.txt

Hello, world


III. Dashboard Tools for installing puppet on the service side

1. Installation settings MySQL

Yum install MySQL mysql-devel mysql-server-y

In/etc/my.cnf [mysqld], add max_allowed_packet = 32M

/etc/init.d/mysqld start

Chkconfig mysqld on

mysqladmin-u root password ' 123456 '

Cat Create_dashboard.sql #创建数据库

CREATE DATABASE dashboard CHARACTER SET UTF8;

CREATE USER ' dashboard ' @ ' localhost ' identified by ' 123456 ';

GRANT all privileges on dashboard.* to ' dashboard ' @ ' localhost ';

FLUSH privileges;


2. Set the Yum source and install the Puppet-dashboard

Since Puppet-dashboard is not in the official CentOS and Epel sources, add the Puppetlabs source

RPM-IVH http://yum.puppetlabs.com/el/6.4/products/x86_64/puppetlabs-release-6-12.noarch.rpm

Yum Install Puppet-dashboard


3, Configuration Puppet-dashboard

Vi/usr/share/puppet-dashboard/config/database.yml

Production:

Database:dashboard Username:dashboard

password:123456

Encoding:utf8

Wuyi Adapter:mysql

Vi/usr/share/puppet-dashboard/config/environment.rb

Config.time_zone = ' Beijing '

Modify the database configuration, the time zone, respectively;

Initialize the database:

Rake Rails_env=production Db:migrate

Check whether the import was successful:

Mysql> Show tables;

+------------------------------+

| Tables_in_dashboard |

+------------------------------+

| Delayed_job_failures |

| Delayed_jobs |

| Metrics |

| Node_class_memberships |

| node_classes |

| Node_group_class_memberships |

| Node_group_edges |

| Node_group_memberships |

| node_groups |

| Nodes |

| Old_reports |

| Parameters |

| Report_logs |

| Reports |

| resource_events |

| resource_statuses |

| schema_migrations |

| timeline_events |

+------------------------------+

Rows in Set (0.00 sec)


4. Start and run dashboard (Webrick mode)

/etc/init.d/puppetmaster restart

/etc/init.d/puppet-dashboard start


5. Visit http://server.example.com:3000/


Puppet Detailed Deployment Guide

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.