Chinaunix首页 | 论坛 | 博客
  • 博客访问: 625835
  • 博文数量: 142
  • 博客积分: 116
  • 博客等级: 入伍新兵
  • 技术积分: 1445
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-28 08:37
文章分类

全部博文(142)

文章存档

2017年(7)

2016年(57)

2015年(48)

2014年(30)

我的朋友

分类: LINUX

2016-04-19 18:16:35

本文记录了内网集群安装puppet的过程。

需要解决的问题:
1 内网主机不能访问外网
2 集群安装puppet

思路:
访问外网的问题,用一台外网机通过yum安装puppet,保存下载的rpm包,
搭建自己的yum源,内网机从自己的yum源下载rpm包。

集群安装puppet考虑使用GNU parallel命令批量执行。

过程:

1 在外网机安装puppet。
1.1 配置yum保存rpm。修改keepcache=1   (默认为0,不保存)
  1. # cat /etc/yum.conf
  2. [main]
  3. cachedir=/var/cache/yum/$basearch/$releasever
  4. keepcache=1
1.2 配置sohu源。(安装puppet时,会有一些依赖包ruby等需要安装)
  1. # cat /etc/yum.repos.d/sohu.repo
  2. [sohu_base]
  3. name=CentOS-$releasever - sohu base
  4. baseurl=
  5. gpgcheck=1
  6. enabled=0
  7. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  8. [sohu_updates]
  9. name=CentOS-$releasever - sohu updates
  10. baseurl=
  11. gpgcheck=1
  12. enabled=0
  13. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
1.3 安装puppet源
  1. rpm -ivh
会生成/etc/yum.repos.d/puppetlabs.repo,建议禁用里面的source,devel。

1.4 安装puppet
  1. yum install puppet-server puppet-dashboard
1.5 查看下载的rpm
  1. # find /var/cache/yum -name \*.rpm
  2. /var/cache/yum/x86_64/6/puppetlabs-deps/packages/ruby-augeas-0.4.1-3.el6.x86_64.rpm
  3. /var/cache/yum/x86_64/6/puppetlabs-deps/packages/ruby-mysql-2.8.2-1.el6.x86_64.rpm
  4. /var/cache/yum/x86_64/6/puppetlabs-deps/packages/rubygem-json-1.5.5-3.el6.x86_64.rpm
  5. /var/cache/yum/x86_64/6/puppetlabs-deps/packages/ruby-shadow-2.2.0-2.el6.x86_64.rpm
  6. /var/cache/yum/x86_64/6/puppetlabs-products/packages/puppet-3.8.6-1.el6.noarch.rpm
  7. /var/cache/yum/x86_64/6/puppetlabs-products/packages/facter-2.4.6-1.el6.x86_64.rpm
  8. /var/cache/yum/x86_64/6/puppetlabs-products/packages/hiera-1.3.4-1.el6.noarch.rpm
  9. /var/cache/yum/x86_64/6/puppetlabs-products/packages/puppet-dashboard-1.2.23-1.el6.noarch.rpm
  10. /var/cache/yum/x86_64/6/puppetlabs-products/packages/puppet-server-3.8.6-1.el6.noarch.rpm
  11. /var/cache/yum/x86_64/6/sohu_base/packages/rubygems-1.3.7-5.el6.noarch.rpm
  12. /var/cache/yum/x86_64/6/sohu_base/packages/ruby-1.8.7.374-4.el6_6.x86_64.rpm
  13. /var/cache/yum/x86_64/6/sohu_base/packages/ruby-libs-1.8.7.374-4.el6_6.x86_64.rpm
  14. /var/cache/yum/x86_64/6/sohu_base/packages/dmidecode-2.12-6.el6.x86_64.rpm
  15. /var/cache/yum/x86_64/6/sohu_base/packages/libselinux-ruby-2.0.94-5.8.el6.x86_64.rpm
  16. /var/cache/yum/x86_64/6/sohu_base/packages/wget-1.12-5.el6_6.1.x86_64.rpm
  17. /var/cache/yum/x86_64/6/sohu_base/packages/virt-what-1.11-1.2.el6.x86_64.rpm
  18. /var/cache/yum/x86_64/6/sohu_base/packages/augeas-libs-1.0.0-10.el6.x86_64.rpm
  19. /var/cache/yum/x86_64/6/sohu_base/packages/compat-readline5-5.2-17.1.el6.x86_64.rpm
  20. /var/cache/yum/x86_64/6/sohu_base/packages/ruby-irb-1.8.7.374-4.el6_6.x86_64.rpm
  21. /var/cache/yum/x86_64/6/sohu_base/packages/libselinux-2.0.94-5.8.el6.x86_64.rpm
  22. /var/cache/yum/x86_64/6/sohu_base/packages/libselinux-utils-2.0.94-5.8.el6.x86_64.rpm
  23. /var/cache/yum/x86_64/6/sohu_base/packages/pciutils-3.1.10-4.el6.x86_64.rpm
  24. /var/cache/yum/x86_64/6/sohu_base/packages/rubygem-rake-0.8.7-2.1.el6.noarch.rpm
  25. /var/cache/yum/x86_64/6/sohu_base/packages/ruby-rdoc-1.8.7.374-4.el6_6.x86_64.rpm
  26. /var/cache/yum/x86_64/6/sohu_base/packages/pciutils-libs-3.1.10-4.el6.x86_64.rpm


2 创建自己的yum源

2.1 安装createrepo
  1. yum install createrepo
2.2 创建yum源
  1. mkdir -p /opt/yum_repo/packages
  2. find /var/cache/yum/ -name \*.rpm -exec cp -p {} /opt/yum_repo/packages/ \;
  3. createrepo -v --basedir=/opt/yum_repo/packages --database --outputdir=/opt/yum_repo /opt/yum_repo

未完待续。。。





阅读(1983) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~