foreman的安装配置方法
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-04-09
介绍foreman是一个puppet的生命周期管理系统,类似puppet-dashboard,通过它可以很直观的查看puppet所有客户端的同步状态与facter参数,当前只有Ohad Levy, Frank Sweetser, Paul Kelly三位在默默无闻的管理开发这个项目,更多资料请参见foreman官方站:http://theforeman.org官方截图:http://theforeman.org/projects/foreman/wiki/Screenshots 本文介绍下foreman安装步骤,供各位研究puppet的朋友参考之用. 系统环境:CentOS5.4yum源: 光盘iso、dag-rpmforge、fedora-epel (mirrors.sohu.com)puppet版本:puppet-0.25.4.rpm 前提准备安装rakeyum install rubygem-rake rubygem-rack-1.0.1-1 rubygem-sqlite3-ruby下载foreman最新tar包cd /opthttp://theforeman.org/attachments/download/104/foreman-0.1-5.tar.bz2tar -jxf foreman-0.1-5.tar.bz2也可以通过git下载cd /optgit clone git://github.com/ohadlevy/foreman.git foremancd foremangit submodule initgit submodule update复制foreman-report脚本cp extras/puppet/foreman/files/foreman-report.rb /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb添加foreman用户useradd foreman -d /opt/foreman -M -s /sbin/nologin 安装foremancd /opt/foremanrake Rakefile && rake# foreman默认使用sqlite数据库,不需要改动数据库配置,如果你更喜欢MySQL的话,请手动创建foreman、foremandevel、 拥有帝国一切,皆有可能。欢迎访问phome.netforemantest三个库,然后修改数据库配置文件 foreman/config/database.yml 为以下内容.production: adapter: mysql database: foreman username: root password: host: localhost socket: "/var/lib/mysql/mysql.sock" development: adapter: mysql database: foremandevel username: root password: host: localhost socket: "/var/lib/mysql/mysql.sock" test: adapter: mysql database: foremantest username: root password: host: localhost socket: "/var/lib/mysql/mysql.sock" 建立数据库表结构RAILS_ENV=production rake db:migrate导入节点与facter信息# This will import your facts (only new facts) every time you run the script.rake puppet:import:hosts_and_facts RAILS_ENV=production# This will create all required settings from your facts.rake puppet:migrate:populate_hosts RAILS_ENV=production 创建服务文件 /etc/sysconfig/foreman# the location where foreman is installed #FOREMAN_HOME=/usr/share/foreman # the port which foreman web server is running at # note that if the foreman user is not root, it has to be a > 1024 #FOREMAN_PORT=3000 # the user which runs the web interface #FOREMAN_USER=foreman # the rails environment in which foreman runs #FOREMAN_ENV=production 创建服务启动脚本 /etc/init.d/foreman 拥有帝国一切,皆有可能。欢迎访问phome.net#!/bin/bash # # Init script for foreman # # chkconfig: - 85 15 # description: Init script for foreman # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/foreman ]; then . /etc/sysconfig/foreman fi prog=foreman RETVAL=0 # open port 80 need root user FOREMAN_PORT=${FOREMAN_PORT:-3000} FOREMAN_USER=${FOREMAN_USER:-root} FOREMAN_HOME=${FOREMAN_HOME:-/opt/foreman} FOREMAN_ENV=${FOREMAN_ENV:-production} FOREMAN_PID=${FOREMAN_PID:-${FOREMAN_HOME}/tmp/pids/server.pid} start() { echo -n $"Starting $pr |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: Linux磁盘Block Size研究备忘下一篇: Linux最多支持的磁盘数目
关于foreman的安装配置方法的所有评论