foreman安装使用
1.centos7支持的最高版本为3.3版本
需要使用>= 6.0.0 < 8.0.0版本的puppet
官网地址为:https://theforeman.org/manuals/3.3/quickstart_guide.html
如果之前安装了puppet8-release需要先卸载rpm -e puppet8-release
#Repositories #Note: The RPM packages are not tested on Scientific Linux or Oracle Linux. The Foreman installation on Scientific Linux or Oracle Linux may or may not work. #Enable Puppet's 7.x repository: sudo yum -y install https://yum.puppet.com/puppet7-release-el-7.noarch.rpm #Enable the EPEL (Extra Packages for Enterprise Linux), Foreman and SCL (Software Collections) repositories: sudo yum-config-manager --enable extras #如果报错-bash: yum-config-manager: command not found 则先安装yum install yum-utils sudo yum -y install epel-release centos-release-scl-rh sudo yum -y install https://yum.theforeman.org/releases/3.3/el7/x86_64/foreman-release.rpm #Downloading the installer sudo yum -y install foreman-installer
使用上面官网的步骤不能安装tfm-rubygem,需要手动添加epel及CentOS-SCLo-scl-rh源
vim epel.repo [epel] name=Extra Packages for Enterprise Linux 7 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1
vim epel-testing.repo [epel-testing] name=Extra Packages for Enterprise Linux 7 - Testing - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch failovermethod=priority enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-testing-debuginfo] name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch/debug metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 [epel-testing-source] name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/SRPMS metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1
vim CentOS-SCLo-scl-rh.repo # CentOS-SCLo-rh.repo # # Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more # information [centos-sclo-rh] name=CentOS-7 - SCLo rh #baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/ mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-rh gpgcheck=0 enabled=1 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo [centos-sclo-rh-testing] name=CentOS-7 - SCLo rh Testing baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/rh/ gpgcheck=0 enabled=0 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo [centos-sclo-rh-source] name=CentOS-7 - SCLo rh Sources baseurl=http://vault.centos.org/centos/7/sclo/Source/rh/ gpgcheck=1 enabled=0 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo [centos-sclo-rh-debuginfo] name=CentOS-7 - SCLo rh Debuginfo baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/ gpgcheck=1 enabled=0 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
此时直接安装foreman会报错
If 'hostname -f' still returns an unexpected result, check /etc/hosts and put the hostname entry in the correct order, for example: 1.2.3.4 hostname.example.com hostname
需要添加hosts解析,而且必须按照这种格式进行填写,不能只写ip和解析 要写三个元素,如:
10.12.7.156 kubernetes-dev-worker-2.com kubernetes-dev-worker-2
最后安装foreman
foreman-installer
需要443端口无占用,会启动443端口
如果执行安装时报错
Traceback (most recent call last): 13: from /usr/sbin/foreman-installer:8:in `<main>' 12: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:50:in `run' 11: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run' 10: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `new' 9: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:115:in `initialize' 8: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/configuration.rb:325:in `run_migrations' 7: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/migrations.rb:35:in `run' 6: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/migrations.rb:35:in `each' 5: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/migrations.rb:38:in `block in run' 4: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/migration_context.rb:10:in `execute' 3: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/migration_context.rb:10:in `instance_eval' 2: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/migrations.rb:25:in `block (2 levels) in load_migrations' 1: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/migrations.rb:25:in `instance_eval' /etc/foreman-installer/scenarios.d/foreman.migrations/20200909151007_manage_acls_on_debian.rb:1:in `block (2 levels) in load_migrations': undefined method `[]' for nil:NilClass (NoMethodError)
只需要将报错中的/etc/foreman-installer/scenarios.d/foreman.migrations/20200909151007_manage_acls_on_debian.rb文件清空然后重新执行就可以拉
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?