久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

Cobbler系統(tǒng)如何安裝使用

共計(jì) 10181 個(gè)字符,預(yù)計(jì)需要花費(fèi) 26 分鐘才能閱讀完成。

丸趣 TV 小編給大家分享一下 Cobbler 系統(tǒng)如何安裝使用,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

一、簡(jiǎn)介

Cobbler 是一個(gè)快速網(wǎng)絡(luò)安裝 linux 的服務(wù),而且在經(jīng)過調(diào)整也可以支持網(wǎng)絡(luò)安裝 windows。該工具使用 python 開發(fā),小巧輕便(才 15k 行 python 代碼),使用簡(jiǎn)單的命令即可完成 PXE 網(wǎng)絡(luò)安裝環(huán)境的配置,同時(shí)還可以管理 DHCP、DNS、以及 yum 倉(cāng)庫(kù)、構(gòu)造系統(tǒng) ISO 鏡像。

Cobbler 支持命令行管理,web 界面管理,還提供了 API 接口,可以方便二次開發(fā)使用。

Cobbler 客戶端 Koan 支持虛擬機(jī)安裝和操作系統(tǒng)重新安裝,使重裝系統(tǒng)更便捷。

二、cobbler 提供的功能

使用 Cobbler,您無需進(jìn)行人工干預(yù)即可安裝機(jī)器。Cobbler 設(shè)置一個(gè) PXE 引導(dǎo)環(huán)境(它還可使用 yaboot 支持 PowerPC),并控制與安裝相關(guān)的所有方面,比如網(wǎng)絡(luò)引導(dǎo)服務(wù)(DHCP 和 TFTP)與存儲(chǔ)庫(kù)鏡像。當(dāng)希望安裝一臺(tái)新機(jī)器時(shí),Cobbler 可以:

使用一個(gè)以前定義的模板來配置 DHCP 服務(wù)(如果啟用了管理 DHCP)

將一個(gè)存儲(chǔ)庫(kù)(yum 或 rsync)建立鏡像或解壓縮一個(gè)媒介,以注冊(cè)一個(gè)新操作系統(tǒng)

在 DHCP 配置文件中為需要安裝的機(jī)器創(chuàng)建一個(gè)條目,并使用您指定的參數(shù)(IP 和 MAC 地址)

在 TFTFP 服務(wù)目錄下創(chuàng)建適當(dāng)?shù)?PXE 文件

重新啟動(dòng) DHCP 服務(wù)以反映更改

重新啟動(dòng)機(jī)器以開始安裝(如果電源管理已啟用)

Cobbler 支持眾多的發(fā)行版:Red Hat、Fedora、CentOS、Debian、Ubuntu 和 SuSE。當(dāng)添加一個(gè)操作系統(tǒng)(通常通過使用 ISO 文件)時(shí),Cobbler 知道如何解壓縮合適的文件并調(diào)整網(wǎng)絡(luò)服務(wù),以正確引導(dǎo)機(jī)器。

Cobbler 可使用 kickstart 模板。基于 Red Hat 或 Fedora 的系統(tǒng)使用 kickstart 文件來自動(dòng)化安裝流程。通過使用模板,您就會(huì)擁有基本的 kickstart 模板,然后定義如何針對(duì)一種配置文件或機(jī)器配置而替換其中的變量。例如,一個(gè)模板可能包含兩個(gè)變量 $domain 和 $machine_name。在 Cobbler 配置中,一個(gè)配置文件指定 domain=mydomain.com,并且每臺(tái)使用該配置文件的機(jī)器在 machine_name 變量中指定其名稱。該配置文件中的所有機(jī)器都使用相同的 kickstart 安裝且針對(duì) domain=mydomain.com 進(jìn)行配置,但每臺(tái)機(jī)器擁有其自己的機(jī)器名稱。您仍然可以使用 kickstart 模板在不同的域中安裝其他機(jī)器并使用不同的機(jī)器名稱。

為了協(xié)助管理系統(tǒng),Cobbler 可通過 fence scripts 連接到各種電源管理環(huán)境。Cobbler 支持 apc_snmp、bladecenter、bullpap、drac、ether_wake、ilo、integrity、ipmilan、ipmitool、lpar、rsa、virsh 和 wti。要重新安裝一臺(tái)機(jī)器,可運(yùn)行 reboot system foo 命令,而且 Cobbler 會(huì)使用必要的憑據(jù)和信息來為您運(yùn)行恰當(dāng)?shù)?fence scripts(比如機(jī)器插槽數(shù))。

除了這些特性,還可使用一個(gè)配置管理系統(tǒng) (CMS)。您有兩種選擇:該工具內(nèi)的一個(gè)內(nèi)部系統(tǒng),或者集成一個(gè)現(xiàn)有的外部 CMS,比如 Chef 或 Puppet。借助內(nèi)部系統(tǒng),您可以指定文件模板,這些模板會(huì)依據(jù)配置參數(shù)進(jìn)行處理(與 kickstart 模板的處理方式一樣),然后復(fù)制到您指定的位置。如果必須自動(dòng)將配置文件部署到特定機(jī)器,那么此功能很有用。

使用 koan 客戶端,Cobbler 可從客戶端配置虛擬機(jī)并重新安裝系統(tǒng)。我不會(huì)討論配置管理和 koan 特性,因?yàn)樗鼈儾粚儆诒疚牡慕榻B范疇。但是,它們是值得研究的有用特性。

三、安裝配置

1. 安裝方式

cobbler 可以手動(dòng)編譯安裝,也可以基于 yum 源的安裝,如果需要通過 yum 源安裝,則需要配置 epel 源,epel 源可以通過下載官方給的 epel 源的目錄來實(shí)現(xiàn)安裝 https://fedoraproject.org/wiki/EPEL

[root@node1 ~]# yum install cobbler cobbler-web pykickstart debmirror -y

2. 檢查配置文件,需要在 cobblerd 和 httpd 啟動(dòng)的情況下檢查

[root@node1 ~]# cobbler check The following are potential configuration items that you may want to fix: 1 : The  server  field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it. 2 : For PXE to be functional, the  next_server  field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network. 3 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run  cobbler get-loaders  to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The  cobbler get-loaders  command is the easiest way to resolve these requirements. 4 : change  disable  to  no  in /etc/xinetd.d/rsync 5 : comment out  dists  on /etc/debmirror.conf for proper debian support 6 : comment out  arches  on /etc/debmirror.conf for proper debian support 7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to  cobbler  and should be changed, try:  openssl passwd -1 -salt  random-phrase-here   your-password-here  to generate new one 8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

如上個(gè)問題的解決辦法為:

1. 修改 /etc/cobbler/settings 文件的 server 參數(shù)的值為提供 cobbler 服務(wù)的主機(jī)對(duì)應(yīng)的 ip 地址

2. 修改 /etc/cobbler/settings 文件的 next_server 參數(shù)的值為提供 PXE 服務(wù)的主機(jī)的對(duì)應(yīng) IP 地址

3. 如果當(dāng)前節(jié)點(diǎn)可以訪問互聯(lián)網(wǎng),執(zhí)行“cobbler get-loader”命令下載 pxelinux.0,menu.c32,elilo.efi, 或 yaboot 文件,否則,需要安裝 syslinux 程序包,而后復(fù)制 /usr/share/syslinux/ 中的 pxelinux.0,menu.c32 等文件至 /var/lib/cobbler/loaders 目錄中  4. 將 /etc/xinetd.d/rsync 中的 disable 改為 no,或者執(zhí)行“chkconfig rsync on”

5. 注釋 /etc/dedmirror.conf 文件中的“@dists= sid”一行

6. 注釋 /etc/dedmirror.conf 文件中的“@arches= i386”一行

7. 執(zhí)行“openssl passwd -1 -salt $(openssl rand -hex 4)”生成密碼,并用其替換 /etc/cobbler/settings 文件中 default_password_crypted 參數(shù)

8. 安裝 cam 和 fance-agents 來實(shí)現(xiàn)電源管理

通過 cobbler get-loaders 同步文件:

[root@node1 ~]# cobbler get-loaders task started: 2014-04-23_212251_get_loaders task started (id=Download Bootloader Content, time=Wed Apr 23 21:22:51 2014) downloading http://www.cobblerd.org/loaders/README to /var/lib/cobbler/loaders/README downloading http://www.cobblerd.org/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo downloading http://www.cobblerd.org/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot downloading http://www.cobblerd.org/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux downloading http://www.cobblerd.org/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi downloading http://www.cobblerd.org/loaders/yaboot-1.3.14-12 to /var/lib/cobbler/loaders/yaboot downloading http://www.cobblerd.org/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0 downloading http://www.cobblerd.org/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32 downloading http://www.cobblerd.org/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi downloading http://www.cobblerd.org/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi

四、配置及啟動(dòng) cobbler 所依賴的各服務(wù)

cobbler 的運(yùn)行依賴于 dhcp、tftp、rsync 及 dns 服務(wù),其中 dhcp 可由 dhcpd(isc)提供,也可由 dnsmasq 提供;tftp 可由 tftp-server 程序包提供,也可由 cobbler 功能提供,rsync 有 rsync 程序包提供,dns 可由 bind 提供,也可由 dnsmasq 提供

cobbler 可自行管理這些服務(wù)中的部分甚至是全部,但需要配置 /etc/cobbler/settings 文件中的“manange_dhcp”、“manager_tftpd”、“manager_rsync”、“manager_dns”分別來進(jìn)行定義,另外,由于各種服務(wù)都有著不同的實(shí)現(xiàn)方式,如若需要進(jìn)行自定義,需要通過修改 /etc/cobbler/modules.conf 配置文件中各服務(wù)的模塊參數(shù)的值來實(shí)現(xiàn)

本處通過獨(dú)立管理。即不通過 cobbler 來管理這些服務(wù)

1. 配置 dhcp 服務(wù)

定義好所需的“subnet”及其他參數(shù),本處的配置如下:

[root@node1 ~]# cp /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcp/dhcpd.conf  編輯配置文件  option domain-name  wangfeng7399  option domain-name-servers 192.168.1.201; default-lease-time 43200; max-lease-time 86400; log-facility local7; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.210 192.168.1.230 option routers 192.168.1.253 } next-server 192.168.1.210; filename= pxelinux.0

2. 配置 tftpd 服務(wù)

[root@node1 ~]# chkconfig tftp on

五、配置 cobbler

cobbler 的各主要組件間的關(guān)系如下圖所示:

 1. 管理 distro

是 cobbler 變得可用的 *** 步為定義 distro,其可以通過為其指定外部的安裝引導(dǎo)內(nèi)核及 ramdisk 文件的方式實(shí)現(xiàn)。而如果已經(jīng)有完成的安裝樹(如 os 的安裝鏡像)則推薦使用 improt 之間導(dǎo)入的方式進(jìn)行:

[root@node1 ~]# mount /dev/cdrom /media mount: block device /dev/sr0 is write-protected, mounting read-only [root@node1 ~]# cobbler import --name=centos6.5-x86-64 --path=/media/ task started: 2014-04-23_214916_import task started (id=Media import, time=Wed Apr 23 21:49:16 2014) Found a candidate signature: breed=redhat, version=rhel6 Found a matching signature: breed=redhat, version=rhel6 Adding distros from path /var/www/cobbler/ks_mirror/centos6.5-x86-64: creating new distro: centos6.5-64-x86_64 trying symlink: /var/www/cobbler/ks_mirror/centos6.5-x86-64 -  /var/www/cobbler/links/centos6.5-64-x86_64 creating new profile: centos6.5-64-x86_64 associating repos checking for rsync repo(s) checking for rhn repo(s) checking for yum repo(s) starting descent into /var/www/cobbler/ks_mirror/centos6.5-x86-64 for centos6.5-64-x86_64 processing repo at : /var/www/cobbler/ks_mirror/centos6.5-x86-64 need to process repo/comps: /var/www/cobbler/ks_mirror/centos6.5-x86-64 looking for /var/www/cobbler/ks_mirror/centos6.5-x86-64/repodata/*comps*.xml Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos6.5-x86-64/repodata *** TASK COMPLETE ***

列出所有的 distro:

[root@node1 ~]# cobbler distro list centos6.5-64-x86_64

如果有 kickstart 文件,也可以使用 –kickstart=/path/to/kickstart_file 進(jìn)行導(dǎo)入,因此 import 會(huì)自動(dòng)為導(dǎo)入的 distro 生成一個(gè) profile

2. 管理 profile

cobbler 使用 profile 來為特定的需求類別提供鎖需要安裝的配置,即在 distro 的基礎(chǔ)上通過提供 kiskstart 文件來生成一個(gè)特定的系統(tǒng)安裝配置。distro 的 profile 可以出現(xiàn)在 pxe 的引導(dǎo)菜單中作為安裝的選擇之一,關(guān)于 kickstark 文件的講解可以移步本人的相關(guān)博客 http://wangfeng7399.blog.51cto.com/3518031/1369553,不出就不再做詳細(xì)說明:

[root@node1 ~]# cobbler profile add --name=centos6.5-x86_64 --distro=centos6.5-64-x86_64 kickstart=/root/anaconda-ks.cfg

列出當(dāng)前系統(tǒng)上的 profile:

[root@node1 ~]# cobbler profile list centos6.5-64-x86_64 centos6.5-x86_64

刪除一個(gè) profile:

[root@node1 ~]# cobbler profile remove --name=centos6.5-64-x86_64

3. 重啟服務(wù)及同步數(shù)據(jù)到響應(yīng)的目錄  

[root@node1 ~]# service cobblerd restart Stopping cobbler daemon: [ OK ] Starting cobbler daemon: [ OK ] [root@node1 ~]# cobbler sync task started: 2014-04-23_220652_sync task started (id=Sync, time=Wed Apr 23 22:06:52 2014) running pre-sync triggers cleaning trees removing: /var/www/cobbler/images/centos6.5-64-x86_64 removing: /var/lib/tftpboot/pxelinux.cfg/default removing: /var/lib/tftpboot/grub/images removing: /var/lib/tftpboot/grub/efidefault removing: /var/lib/tftpboot/images/centos6.5-64-x86_64 removing: /var/lib/tftpboot/s390x/profile_list copying bootloaders trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -  /var/lib/tftpboot/pxelinux.0 trying hardlink /var/lib/cobbler/loaders/menu.c32 -  /var/lib/tftpboot/menu.c32 trying hardlink /var/lib/cobbler/loaders/yaboot -  /var/lib/tftpboot/yaboot  中間省去 N 行  received on stderr: running shell triggers from /var/lib/cobbler/triggers/sync/post/* running python triggers from /var/lib/cobbler/triggers/change/* running python trigger cobbler.modules.scm_track running shell triggers from /var/lib/cobbler/triggers/change/* *** TASK COMPLETE ***

 4. 測(cè)試  

可以看到我們定制的系統(tǒng)啟動(dòng)頁(yè)面,開始安裝系統(tǒng)

系統(tǒng)安裝成功,登陸系統(tǒng)

六、使用 cobbler_web

cobbler_web 支持多種認(rèn)證方式,如 authn_configfil、authn_ldap 或 authn_pam 等,默認(rèn)為 authn_denyall, 即拒絕所有用戶登陸。下面說明兩種能認(rèn)證用戶登錄 cobbler_web 的方式

1. 使用 authn_pam 模塊認(rèn)證 cobbler_web 用戶

首先修改 modules 中的 [authentication] 段中的 module 參數(shù)的值為 authn_pam,接著設(shè)定系統(tǒng)用戶,并為用戶設(shè)定密碼,而后將設(shè)定的系統(tǒng)用戶添加至 cobbler_web 的 admin 組中,修改 /etc/cobbler/users.conf 文件,將設(shè)定的用戶添加為 admin 參數(shù)的值即可。

 2. 使用 authn_configfile 模塊認(rèn)證 cobbler_web 用戶

首先修改 modules 中的 [authentication] 段中的 module 參數(shù)的值為 authn_configfile,接著創(chuàng)建其認(rèn)證文件 /etc/cobbler/users.digest,并添加所需要的用戶即可。需要注意的是,添加 *** 用戶時(shí),需要為 htdigest 命令使用“-c”選項(xiàng),后續(xù)添加其他用戶則不能再使用。

本處使用的為 authn_pam

[root@node1 ~]# vi /etc/cobbler/modules.conf [authentication] module = authn_pam [root@node1 ~]# useradd wangfeng7399 [root@node1 ~]# passwd wangfeng7399 Changing password for user wangfeng7399. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@node1 ~]# vi /etc/cobbler/users.conf [admins] admin =  wangfeng7399

以上是“Cobbler 系統(tǒng)如何安裝使用”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注丸趣 TV 行業(yè)資訊頻道!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-08-25發(fā)表,共計(jì)10181字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請(qǐng)注明出處。
評(píng)論(沒有評(píng)論)
主站蜘蛛池模板: 新化县| 乌恰县| 田阳县| 洪泽县| 皮山县| 漾濞| 措勤县| 萨迦县| 五台县| 县级市| 友谊县| 蕲春县| 格尔木市| 明溪县| 宁明县| 黔西县| 玉田县| 灵丘县| 闵行区| 明溪县| 阜阳市| 运城市| 湘乡市| 宜都市| 淮阳县| 望谟县| 木里| 肥东县| 福贡县| 深水埗区| 宜丰县| 聂荣县| 韶关市| 武胜县| 沾益县| 汉沽区| 临邑县| 噶尔县| 台中县| 聂荣县| 浙江省|