环境:CentOS 6.5 x86_64
- 安装依赖环境:
ruby 1.8:yum安装
ruby gem:yum安装
openssl:yum安装
gcc 编译环境:yum安装
# yum install ruby gcc glibc rubygems openssl*
2. 安装好后可以安装 hiera、facter、puppet了。
下载源码包。
puppet官方源码包下载地址: https://downloads.puppetlabs.com/
hiera版本:1.3.4
facter版本:2.4.5
puppet版本:3.8.5
# tar xf hiera-1.3.4.tar.gz # ruby hiera-1.3.4/install.rb # tar xf facter-2.4.5.tar.gz # ruby facter-2.4.5/install.rb # tar xf puppet-3.8.5.tar.gz # ruby puppet-3.8.5/install.rb # puppet -V #查看版本号 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘: no such file to load -- json (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/module.rb:3 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser/files.rb:1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb:1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser/scope.rb:6 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser/methods.rb:2 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/method_call.rb:2 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:115 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser.rb:11 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/parser.rb:4 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet.rb:282 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require‘ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require‘ from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:12 from /usr/bin/puppet:7:in `require‘ from /usr/bin/puppet:7
报错,gem里面的json软件包没有安装。
# yum install rubygem-json # 发现没有该软件包
我这里选择用yum的方式安装 rubygem-json ,首选要安装puppet 的源。
# rpm -ivh # yum install rubygem-json
可以正常运行了。
3. 配置puppet 服务脚本
# cp puppet-3.8.5/ext/redhat/client.init /etc/init.d/puppet #puppet agent端服务脚本 # cp puppet-3.8.5/ext/redhat/master.init /etc/init.d/puppetmaster #puppet master端服务脚本 # chmod +x /etc/init.d/puppet* # service puppet start
可以正常启动。
时间: 2024-11-10 01:00:27