Ubuntu 14.04上如何安裝Foreman
Foreman是一個集成的數(shù)據(jù)中心生命周期管理工具,提供了服務開通,配置管理以及報告功能,和Puppet Dahboard一樣,F(xiàn)oreman也是一個Ruby on Rails程序。Foreman和Dashboard不同的地方在于Foreman更多的關注服務開通和管理數(shù)據(jù)中心的能力,例如和引導工具,PXE啟動服務器,DHCP服務器及服務器開通工具進行集成。
Foreman 機器統(tǒng)一管理平臺
◆Foreman可以與Puppet集成使用,通常是作為puppet的前端接入。
◆Foreman takes care of provisioning until the point puppet is running, allowing Puppet to do what it does best.(太難翻了 -_-!!)
◆Foreman能夠通過Facter組件顯示系統(tǒng)目錄信息,并且可以從Puppet主機報表中提供實時信息。
◆Foreman能夠準備你管理新機器的所有工作。它的設計目標是能夠自動化的完成所有手工管理的工作,通過Foreman可以重新配置機器。
◆Foreman能夠管理大規(guī)模(當然也包括小規(guī)模)的,企業(yè)級的的網(wǎng)絡,可能有很多域,子網(wǎng)和很多puppet master節(jié)點。Foreman也可以實現(xiàn)配置版本的回溯。
Foreman 可以運行在幾乎所有流行的 Linux 系統(tǒng)上,如:
◆RHEL / CentOS / Fedora / Oracle Enterprise Linux / Scientific Linux
◆SUSE/openSUSE
◆Debian/Ubuntu
◆CoreOS
◆JunOS
也支持很多云供應商,如:
◆VMWare
◆Amazon EC2
◆Libvirt
◆OpenStack
◆oVirt and RHEV
◆Rackspace
◆Google Compute engine
如何安裝
好了,現(xiàn)在我們進入主題,按照以下命令輸入,首先切換到 Root 賬戶:
- sudo su
或者輸入
- su
啟用 Puppet labs 和 Foreman 庫:
- apt-get -y install ca-certificates
- wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
- dpkg -i puppetlabs-release-trusty.deb
- echo "deb http://deb.theforeman.org/ trusty 1.9" > /etc/apt/sources.list.d/foreman.list
- echo "deb http://deb.theforeman.org/ plugins 1.9" >> /etc/apt/sources.list.d/foreman.list
- wget -q http://deb.theforeman.org/pubkey.gpg -O- | apt-key add -
更新源:
- apt-get update
下載 Foreman-installer 安裝腳本:
- apt-get -y install foreman-installer
運行 Foreman 安裝命令:
- foreman-installer
幾分鐘后,你會看到下面的輸出內(nèi)容:
[…]
Success!
* Foreman is running at https://server.unixmen.local
Initial credentials are admin / jrPiWSpSBXBdzv57
* Foreman Proxy is running at https://server.unixmen.local:8443
* Puppetmaster is running at port 8140
The full log is at /var/log/foreman-installer/foreman-installer.log
記下其中以粗體顯示的用戶名和密碼。后面我們需要用來訪問 Foreman 面板。
#p#
配置Foreman
首先,我們需要啟用“diffs”,這將有助于你看到Foreman的報表。
編輯/etc/puppet/puppet.conf文件:
- vi /etc/puppet/puppet.conf
找到以下行并修改為ture:
[…]
show_diff = true
[…]
保存并關閉文件。
接下來,我們需要將 Foreman 主機添加到 Foreman 的數(shù)據(jù)庫。運行:
- puppet agent --test
輸出內(nèi)容:
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 400 on SERVER: Failed to find server1.unixmen.local via exec: Execution of ‘/etc/puppet/node.rb server1.unixmen.local’ returned 1:
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for server1.unixmen.local
Info: Applying configuration version ‘1441613934’
Notice: Finished catalog run in 0.22 seconds
注意:Puppet 3+ 版本將顯示警告消息:the first time that the node can’t be found。不用理會警告繼續(xù)。
訪問 Foreman Web 控制臺
打開 Web 瀏覽器,然后導航至:https://IP地址/。
會出現(xiàn)界面,輸入之前記錄的登陸賬戶及密碼。
下載我們可以進去了解整個控制臺界面:

官方網(wǎng)站:http://theforeman.org/