本文记录了内网集群安装puppet的过程。
需要解决的问题:
1 内网主机不能访问外网
2 集群安装puppet
思路:
访问外网的问题,用一台外网机通过yum安装puppet,保存下载的rpm包,
搭建自己的yum源,内网机从自己的yum源下载rpm包。
集群安装puppet考虑使用GNU parallel命令批量执行。
过程:
1 在外网机安装puppet。
1.1 配置yum保存rpm。修改keepcache=1 (默认为0,不保存)
-
# cat /etc/yum.conf
-
[main]
-
cachedir=/var/cache/yum/$basearch/$releasever
-
keepcache=1
1.2 配置sohu源。(安装puppet时,会有一些依赖包ruby等需要安装)
-
# cat /etc/yum.repos.d/sohu.repo
-
[sohu_base]
-
name=CentOS-$releasever - sohu base
-
baseurl=
-
gpgcheck=1
-
enabled=0
-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
-
-
[sohu_updates]
-
name=CentOS-$releasever - sohu updates
-
baseurl=
-
gpgcheck=1
-
enabled=0
-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
1.3 安装puppet源
会生成/etc/yum.repos.d/puppetlabs.repo,建议禁用里面的source,devel。
1.4 安装puppet
-
yum install puppet-server puppet-dashboard
1.5 查看下载的rpm
-
# find /var/cache/yum -name \*.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-deps/packages/ruby-augeas-0.4.1-3.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-deps/packages/ruby-mysql-2.8.2-1.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-deps/packages/rubygem-json-1.5.5-3.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-deps/packages/ruby-shadow-2.2.0-2.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-products/packages/puppet-3.8.6-1.el6.noarch.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-products/packages/facter-2.4.6-1.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-products/packages/hiera-1.3.4-1.el6.noarch.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-products/packages/puppet-dashboard-1.2.23-1.el6.noarch.rpm
-
/var/cache/yum/x86_64/6/puppetlabs-products/packages/puppet-server-3.8.6-1.el6.noarch.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/rubygems-1.3.7-5.el6.noarch.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/ruby-1.8.7.374-4.el6_6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/ruby-libs-1.8.7.374-4.el6_6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/dmidecode-2.12-6.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/libselinux-ruby-2.0.94-5.8.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/wget-1.12-5.el6_6.1.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/virt-what-1.11-1.2.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/augeas-libs-1.0.0-10.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/compat-readline5-5.2-17.1.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/ruby-irb-1.8.7.374-4.el6_6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/libselinux-2.0.94-5.8.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/libselinux-utils-2.0.94-5.8.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/pciutils-3.1.10-4.el6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/rubygem-rake-0.8.7-2.1.el6.noarch.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/ruby-rdoc-1.8.7.374-4.el6_6.x86_64.rpm
-
/var/cache/yum/x86_64/6/sohu_base/packages/pciutils-libs-3.1.10-4.el6.x86_64.rpm
2 创建自己的yum源
2.1 安装createrepo
2.2 创建yum源
-
mkdir -p /opt/yum_repo/packages
-
find /var/cache/yum/ -name \*.rpm -exec cp -p {} /opt/yum_repo/packages/ \;
-
createrepo -v --basedir=/opt/yum_repo/packages --database --outputdir=/opt/yum_repo /opt/yum_repo
未完待续。。。
阅读(1983) | 评论(0) | 转发(0) |