Ubuntu 14.04上如何安裝Foreman
Foreman是一個(gè)集成的數(shù)據(jù)中心生命周期管理工具,提供了服務(wù)開通,配置管理以及報(bào)告功能,和Puppet Dahboard一樣,F(xiàn)oreman也是一個(gè)Ruby on Rails程序。Foreman和Dashboard不同的地方在于Foreman更多的關(guān)注服務(wù)開通和管理數(shù)據(jù)中心的能力,例如和引導(dǎo)工具,PXE啟動(dòng)服務(wù)器,DHCP服務(wù)器及服務(wù)器開通工具進(jìn)行集成。
Foreman 機(jī)器統(tǒng)一管理平臺(tái)
◆Foreman可以與Puppet集成使用,通常是作為puppet的前端接入。
◆Foreman takes care of provisioning until the point puppet is running, allowing Puppet to do what it does best.(太難翻了 -_-!!)
◆Foreman能夠通過(guò)Facter組件顯示系統(tǒng)目錄信息,并且可以從Puppet主機(jī)報(bào)表中提供實(shí)時(shí)信息。
◆Foreman能夠準(zhǔn)備你管理新機(jī)器的所有工作。它的設(shè)計(jì)目標(biāo)是能夠自動(dòng)化的完成所有手工管理的工作,通過(guò)Foreman可以重新配置機(jī)器。
◆Foreman能夠管理大規(guī)模(當(dāng)然也包括小規(guī)模)的,企業(yè)級(jí)的的網(wǎng)絡(luò),可能有很多域,子網(wǎng)和很多puppet master節(jié)點(diǎn)。Foreman也可以實(shí)現(xiàn)配置版本的回溯。
Foreman 可以運(yùn)行在幾乎所有流行的 Linux 系統(tǒng)上,如:
◆RHEL / CentOS / Fedora / Oracle Enterprise Linux / Scientific Linux
◆SUSE/openSUSE
◆Debian/Ubuntu
◆CoreOS
◆JunOS
也支持很多云供應(yīng)商,如:
◆VMWare
◆Amazon EC2
◆Libvirt
◆OpenStack
◆oVirt and RHEV
◆Rackspace
◆Google Compute engine
如何安裝
好了,現(xiàn)在我們進(jìn)入主題,按照以下命令輸入,首先切換到 Root 賬戶:
- sudo su
或者輸入
- su
啟用 Puppet labs 和 Foreman 庫(kù):
- 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
運(yùn)行 Foreman 安裝命令:
- foreman-installer
幾分鐘后,你會(huì)看到下面的輸出內(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
記下其中以粗體顯示的用戶名和密碼。后面我們需要用來(lái)訪問(wèn) Foreman 面板。
#p#
配置Foreman
首先,我們需要啟用“diffs”,這將有助于你看到Foreman的報(bào)表。
編輯/etc/puppet/puppet.conf文件:
- vi /etc/puppet/puppet.conf
找到以下行并修改為ture:
[…]
show_diff = true
[…]
保存并關(guān)閉文件。
接下來(lái),我們需要將 Foreman 主機(jī)添加到 Foreman 的數(shù)據(jù)庫(kù)。運(yùn)行:
- 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。不用理會(huì)警告繼續(xù)。
訪問(wèn) Foreman Web 控制臺(tái)
打開 Web 瀏覽器,然后導(dǎo)航至:https://IP地址/。
會(huì)出現(xiàn)界面,輸入之前記錄的登陸賬戶及密碼。
下載我們可以進(jìn)去了解整個(gè)控制臺(tái)界面:

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