首页 文章 精选 留言 我的

精选列表

搜索[HTAP架构],共10000篇文章
优秀的个人博客,低调大师

foreman架构的引入4-安装Foreman1.6.3架构(foreman与puppetmaster分离)

之前讲的all-in-one方式建议只用于测试使用,如果要用于生产环境,建议将foreman和puppetmaster分离安装,更有利于后期的维护和扩展。还有就是之前你已经部署过puppetmaster了,如何单独部署foreman和puppetmaster通信也是值得考虑的问题。 1、软件包的选型如下: puppet-server 3.6.2 puppet 3.6.2 facter 2.0.2 mcollective 2.2.4 rabbitmq-server 3.2.4 foreman 1.6.3 foreman-proxy 1.6.3 2、系统环境准备 3、安装puppetmaster 3.1、安装puppetmaster,并生成CA和证书 [root@puppetmaster162~]#yuminstallpuppetpuppet-serverfacter [root@puppetmaster162puppet]#vim/etc/puppet/puppet.conf [agent] server=puppetmaster162.kisspuppet.com pluginsync=false ... [master] certname=puppetmaster162.kisspuppet.com environmentpath=/etc/puppet/environments basemodulepath=/etc/puppet/modules:/usr/share/puppet/modules environment_timeout=10 [root@puppetmaster162~]#/etc/init.d/puppetmasterstart Startingpuppetmaster:[OK] [root@puppetmaster162~]#puppetcert--list--all +"puppetmaster162.kisspuppet.com"(SHA256)2E:B3:73:4F:CD:EE:0C:64:2C:DF:24:E6:D3:62:F3:1C:AC:A3:28:60:67:1D:0C:8C:C5:CA:68:5B:4B:2F:49:B9(altnames:"DNS:puppet","DNS:puppet.kisspuppet.com","DNS:puppetmaster162.kisspuppet.com") 3.2、测试puppetmaster是否能够正常使用 [root@puppetmaster162~]#puppetagent-t Info:Cachingcatalogforpuppetmaster162.kisspuppet.com Info:Applyingconfigurationversion'1417749612' Notice:Finishedcatalogrunin0.04seconds 注:以上安装方式,puppetmaster工作在Webrick上,性能非常差,需要更换为性能好的web服务器上,如果更换,请参考http://kisspuppet.com/2014/10/18/puppet_learning_ext3/http://kisspuppet.com/2014/10/20/puppet_learning_ext4/ 4、安装Foreman 4.1、安装puppet客户端并完成认证 #安装 [root@foreman163~]#yuminstallpuppetfacter [root@foreman163~]#vim/etc/puppet/puppet.conf [main] ... privatekeydir=$ssldir/private_keys{group=service} hostprivkey=$privatekeydir/$certname.pem{mode=640} [agent] server=puppetmaster162.kisspuppet.com pluginsync=false #申请认证 [root@foreman163~]#puppetagent-t Info:CreatinganewSSLkeyforforeman163.kisspuppet.com Info:Cachingcertificateforca Info:csr_attributesfileloadingfrom/etc/puppet/csr_attributes.yaml Info:CreatinganewSSLcertificaterequestfor Info:CertificateRequestfingerprint(SHA256):35:5D:E5:74:71:E0:FD:D2:67:34:17:92:3D:60:F2:A1:34:26:BA:E5:2D:1F:3A:0E:07:6F:85:38:A8:39:8B:65 Info:Cachingcertificateforca Exiting;nocertificatefoundandwaitforcertisdisabled #授权证书 [root@puppetmaster162~]#puppetcert--signforeman163.kisspuppet.com Notice:Signedcertificaterequestforforeman163.kisspuppet.com Notice:RemovingfilePuppet::SSL::CertificateRequestforeman163.kisspuppet.comat'/var/lib/puppet/ssl/ca/requests/foreman163.kisspuppet.com.pem' #测试 [root@foreman163~]#puppetagent-t Info:Cachingcatalogforforeman163.kisspuppet.com Info:Applyingconfigurationversion'1417749612' Notice:Finishedcatalogrunin0.05seconds 4.2、通过foreman-installer安装foreman foreman默认安装选择的数据库为postgresql,这里选用mysql进行安装。 注意:openssl版本要升级到1.0.1e版本 #先安装包 [root@foreman163~]#yuminstallforeman-installerforemanmod_passengermod_sslruby193-rubygem-passenger-nativemysqlmysql-serverforeman-mysql2openssl ... Updated: openssl.x86_640:1.0.1e-15.el6 Replaced: ruby193-v8.x86_641:3.14.5.10-2.el6 Complete! #然后通过foreman-installer调用puppet进行配置 [root@foreman163~]#foreman-installer--foreman-db-adaptermysql2--foreman-db-typemysql--no-enable-puppet--no-enable-foreman-proxy--foreman-configure-epel-repo=false InstallingDone[100%][] Success! *Foremanisrunningathttps://foreman163.kisspuppet.com Initialcredentialsareadmin/2kWcqJsW6cLDwo7m Thefulllogisat/var/log/foreman-installer/foreman-installer.log 注:以上安装完成之后,默认登录密码为随机密码,这跟之前版本有所不同。 安装完成之后,通过火狐或者谷歌浏览器访问看是否安装成功https://192.168.20.11 记得修改默认密码,否则待会忘了又登录不了了。 5、安装Foreman-proxy 注:这里的foreman-proxy主要是代理puppet以及puppetca,所以要安装在puppetmaster上。 5.1、安装foreman-proxy [root@puppetmaster162~]#yuminstallforeman-installerforeman-proxytftp-serversyslinux [root@puppetmaster162yum.repos.d]#foreman-installer--no-enable-foreman--no-enable-foreman-cli--no-enable-foreman-plugin-bootdisk--no-enable-foreman-plugin-setup--no-enable-puppet--enable-foreman-proxy--foreman-proxy-puppetrun=true--foreman-proxy-puppetrun-provider=mcollective--foreman-proxy-puppetca=true--foreman-proxy-dhcp=false--foreman-proxy-tftp=false--foreman-proxy-dns=false--foreman-proxy-register-in-foreman=false--foreman-configure-epel-repo=false--foreman-configure-scl-repo=false InstallingDone[100%][] Success! *ForemanProxyisrunningathttps://puppetmaster162.kisspuppet.com:8443 Thefulllogisat/var/log/foreman-installer/foreman-installer.log #检测8443端口 [root@puppetmaster162~]#netstat-nlatp|grep8443 tcp000.0.0.0:84430.0.0.0:*LISTEN4635/ruby 5.2、设置ENC #从foreman-installer中获取node.rb(貌似不能用,可以通过all-in-one方式安装后获取) [root@puppetmaster162~]#cp/usr/share/foreman-installer/modules/foreman/files/foreman-report_v2.rb/etc/puppet/node.rb [root@puppetmaster162~]#chownpuppet./etc/puppet/node.rb#设置属组和属主都为puppet [root@puppetmaster162~]#chmod550/etc/puppet/node.rb#设置执行权限 5.3、设置report #从foreman-installer中获取foreman.rb [root@puppetmaster162~]#cp/usr/share/foreman-installer/modules/foreman/files/foreman-report_v2.rb/usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb 5.4、设置连接foreman的信息 #这里跟foreman1.5版本(包括1.5版本)不一样,请注意 [root@puppetmaster162puppet]#vim/etc/puppet/foreman.yaml --- :url:"https://foreman163.kisspuppet.com" :ssl_ca:"/var/lib/puppet/ssl/certs/ca.pem" :ssl_cert:"/var/lib/puppet/ssl/certs/puppetmaster162.kisspuppet.com.pem" :ssl_key:"/var/lib/puppet/ssl/private_keys/puppetmaster162.kisspuppet.com.pem" :user:"" :password:"" :puppetdir:"/var/lib/puppet" :puppetuser:"puppet" :facts:true :timeout:10 :threads:null [root@puppetmaster162~]#/etc/init.d/foreman-proxyrestart Stoppingforeman-proxy:[OK] Startingforeman-proxy:[OK] 6、注册puppet和puppetca 6.1、在puppetmaster上添加ENC配置和foreman报告 [root@puppetmaster162~]#vim/etc/puppet/puppet.conf [master] ... reports=foreman external_nodes=/etc/puppet/node.rb node_terminus=exec #重启生效 [root@puppetmaster162~]#/etc/init.d/puppetmasterrestart Stoppingpuppetmaster:[OK] Startingpuppetmaster:[OK] 6.2、登录foreman注册foreman-proxy 6.3、节点测试 [root@foreman163~]#puppetagent-t Info:Cachingcatalogforforeman163.kisspuppet.com Info:Applyingconfigurationversion'1417762929' Notice:Finishedcatalogrunin0.13seconds [root@puppetmaster162~]#puppetagent-t Info:Cachingcatalogforpuppetmaster162.kisspuppet.com Info:Applyingconfigurationversion'1417762858' Notice:Finishedcatalogrunin0.14seconds 注:如果测试报错,请将foreman中的puppet插件的enc_environment选项设置为false,具体如何使用后续讲解 本文转自凌激冰51CTO博客,原文链接:http://blog.51cto.com/dreamfire/1586726,如需转载请自行联系原作者

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码