资源预览内容
第1页 / 共11页
第2页 / 共11页
第3页 / 共11页
第4页 / 共11页
第5页 / 共11页
第6页 / 共11页
第7页 / 共11页
第8页 / 共11页
第9页 / 共11页
第10页 / 共11页
亲,该文档总共11页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Puppet 系统安装运维手册1 安装配置 .11.1 版本信息 .11.2 服务器安装 .11.2.1 锁定 YUM 安装版本(如果需要安装旧版) .11.2.2 安装配置 Puppet-server.11.2.3 安装 Foreman.21.3 客户端安装 .52 管理服务 .52.1 Puppet-Server .52.2 Foreman .52.3 Foreman-Proxy .53 修改记录 .6第 1 页1 安装配置1.1 版本信息 操作系统: CentOS5.X 64bit1.2 服务器安装1.2.1 锁定 YUM 安装版本 (如果需要安装旧版)1.2.1.1 安装 yum-versionlockyum install yum-versionlock1.2.1.2 编辑/etc/yum/pluginconf.d/versionlock.listpuppet 2.7.20puppet-server 2.7.201.2.2 安装配置 Puppet-server1.2.2.1 安装rpm Uvh http:/dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpmrpm Uvh http:/ yum.puppetlabs.com/el/5/products/x86_64/puppetlabs-release-5-6.noarch.rpmyum -y install gcc gcc-c+ libstdc+-develyum install puppet-server (旧版安装 yum install puppet-server-2.7.20)1.2.2.2 编辑/etc/puppet/ auth.confpath /runauth anymethod saveallow *1.2.2.3 增加/etc/puppet/ autosign.conf*1.2.2.4 编辑/etc/puppet/fileserver.conffilespath /var/lib/puppet/filesallow *1.2.2.5 编辑/etc/puppet/puppet.confmain# The Puppet log directory.第 2 页# The default value is $vardir/log.logdir = /var/log/puppet# Where Puppet PID files are kept.# The default value is $vardir/run.rundir = /var/run/puppet# Where SSL certificates are kept.# The default value is $confdir/ssl.ssldir = $vardir/ssl vardir=/var/lib/puppetssldir=/var/lib/puppet/sslfactpath=/var/lib/puppet/lib/factertemplatedir=/etc/puppet/templateshostcert = $vardir/ssl/certs/puppet.pemcertdir = $vardir/ssl/certsmasterreports = log,foremancertname=puppet-test-02 #服务器名 autosign=true autosign = /etc/puppet/autosign.conf1.2.2.6 修改/etc/hosts172.16.30.188 test-01 server #服务端 ip 地址,名称172.17.30.xxx xxxx xxxx #客户端 ip 地址,名称1.2.3 安装 Foreman1.2.3.1 安装 Mysql-Serveryum install mysql-server mysqlchkconfig -add mysqldchkconfig -level 235 mysqld onservice mysqld start1.2.3.2 创建数据库mysql uroot pCREATE DATABASE foreman CHARACTER SET utf8;CREATE USER foremanlocalhost IDENTIFIED BY foreman;GRANT ALL PRIVILEGES ON foreman.* TO foremanlocalhost;第 3 页1.2.3.3 安装 foremanrpm Uvh http:/yum.theforeman.org/releases/1.0/el5/foreman-release.rpmyum install postgresql-develyum install libvirt-develyum install foreman 修改/usr/share/foreman/config/ database.ymlproduction:adapter: mysqldatabase: foremanusername: foremanpassword: foremanencoding: utf8 将补丁复制到 usr/share/foreman/并替换相应文件vi /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb# copy this file to your report dir - e.g. /usr/lib/ruby/1.8/puppet/reports/# add this report in your puppetmaster reports - e.g, in your puppet.conf add:# reports=log, foreman # (or any other reports you want)# URL of your Foreman installation#$foreman_url=$foreman_url=http:/0.0.0.0:3000/require puppetrequire net/httprequire uriPuppet:Reports.register_report(:foreman) doPuppet.settings.use(:reporting)desc Sends reports directly to Foremandef processbeginuri = URI.parse($foreman_url)http = Net:HTTP.new(uri.host, uri.port)if uri.scheme = https thenhttp.use_ssl = true第 4 页http.verify_mode = OpenSSL:SSL:VERIFY_NONEendreq = Net:HTTP:Post.new(/reports/create?format=yml)req.set_form_data(report = to_yaml)response = http.request(req)rescue Exception = eraise Puppet:Error, Could not send report to Foreman at #$foreman_url/reports/create?format=yml: #eendendendcd /usr/share/foreman/bundle installbundle install -without development test postgresql libvirt sqlitegem install activerecord-mysql2-adapterRAILS_ENV=production rake db:migratescript/rails s -p 3000 -e production -d 初始化 admin 口令cd /usr/share/foreman# RAILS_ENV=production rake permissions:reset编辑/usr/share/foreman/config/setting.yaml:puppet_server: #修改为你的 puppetmaster:login: false #改为 trueforeman web 打开 setting 那个页面,重启 foreman,进入 My account 修改密码1.2.3.4 安装 foreman-proxyyum install foreman-proxy编辑/etc/foreman-proxy/settings.yml:puppetca: true:puppet: true:puppet_conf: /etc/puppet/puppet.conf 修改 vis
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号