目錄
部署PXE遠(yuǎn)程安裝服務(wù)
1.PXE概述
2.實(shí)現(xiàn)過程
3.實(shí)驗(yàn)操作
3.1安裝dhcp、vsftpd、tftp-server.x86_64、syslinux服務(wù)
3.2修改配置文件——DHCP
?編輯3.3修改配置文件——TFTP
3.4kickstart——無人值守安裝
3.4.1選擇程序
?編輯3.4.2修改基礎(chǔ)配置
?編輯3.4.3修改安裝方法?
?編輯3.4.4安裝新引導(dǎo)裝載程序?
?編輯3.4.5配置分區(qū)信息?
3.4.5.1配置boot分區(qū)
3.4.5.2配置swap分區(qū)?
3.4.5.3配置根分區(qū)?
?編輯3.4.6防火墻配置?
3.4.7顯示配置——不安裝圖形環(huán)境?
?編輯
3.4.8安裝后腳本配置??
3.4.9保存配置信息??
3.4.10新建虛擬機(jī)配置參數(shù)?
3.4.11開啟虛擬機(jī)——選擇網(wǎng)絡(luò)安裝系統(tǒng)?
3.4.12在此界面只需等待即可?
?編輯3.4.13測試——登錄成功?
4.Cobbler——快速建立Linux網(wǎng)絡(luò)安裝環(huán)境
4.1Cobbler工作原理?
4.2實(shí)際操作
4.2.1安裝epel源
4.2.2安裝cobbler軟件、dhcp軟件和httpd軟件?
?4.2.3設(shè)置開機(jī)自啟
4.2.4檢查Cobbler哪些配置需要修改
4.2.5生成新密碼
4.2.6修改cobbler配置信息
4.2.7重啟服務(wù),查看配置信息
4.2.8配置dhcp文件信息
4.2.9導(dǎo)入Centos系統(tǒng)的安裝文件,生成相應(yīng)的yum源
4.2.10重啟客戶機(jī),選擇網(wǎng)絡(luò)安裝系統(tǒng)?
4.2.11選擇內(nèi)核?
?4.2.12在頁面等待即可?
?編輯?編輯4.2.13驗(yàn)證
4.3延伸
系統(tǒng)裝機(jī)的三種引導(dǎo)方式
- 硬盤(u盤)
- 光驅(qū)
- 網(wǎng)絡(luò)
pe 小型的操作系統(tǒng)? 在操作系統(tǒng)中再裝操作系統(tǒng)
系統(tǒng)安裝過程
-
加載boot loader
Boot Loader 是在操作系統(tǒng)內(nèi)核運(yùn)行之前運(yùn)行的一段小程序。通過這段小程序,我們可以初始化硬件設(shè)備、建立內(nèi)存空間的映射圖,從而將系統(tǒng)的軟硬件環(huán)境帶到一個(gè)合適的狀態(tài),以便為最終調(diào)用操作系統(tǒng)內(nèi)核準(zhǔn)備好正確的環(huán)境
-
加載啟動(dòng)安裝菜單
-
加載內(nèi)核和initrd系統(tǒng)(文件才能使用文件)
-
加載根系統(tǒng)()
-
運(yùn)行anaconda的安裝向?qū)?/p>
Linux安裝光盤的安裝相關(guān)文件
在系統(tǒng)光盤的isolinux目錄下有和安裝相關(guān)的文件
- boot.cat: 相當(dāng)于grub的第一階段
- isolinux.bin:光盤引導(dǎo)程序,在mkisofs的選項(xiàng)中需要明確給出文件路徑,這個(gè)文件屬于SYSLINUX項(xiàng)目
- isolinux.cfg:啟動(dòng)菜單的配置文件,當(dāng)光盤啟動(dòng)后(即運(yùn)行isolinux.bin),會(huì)自動(dòng)去找isolinux.cfg文件
- vesamenu.c32:是光盤啟動(dòng)后的啟動(dòng)菜單圖形界面,也屬于SYSLINUX項(xiàng)目,menu.c32提供純文本的菜單
- memtest:內(nèi)存檢測程序
- splash.png:光盤啟動(dòng)菜單界面的背景圖
- vmlinuz:是內(nèi)核映像
- initrd.img:ramfs文件(精簡版的linux系統(tǒng),文件系統(tǒng)驅(qū)動(dòng)等)
部署PXE遠(yuǎn)程安裝服務(wù)
1.PXE概述
開機(jī)自檢 ——> MBR引導(dǎo)——>grub2菜單——>內(nèi)核初始化——>init初始化
PXE 的全稱是 preboot execute environment它其實(shí)是Intel在很久以前提出來的一項(xiàng)用于通過網(wǎng)絡(luò)來引導(dǎo)系統(tǒng)的標(biāo)準(zhǔn)。允許客戶機(jī)通過網(wǎng)絡(luò)從遠(yuǎn)程服務(wù)器上下載引導(dǎo)鏡像,并加載安裝文件或者整個(gè)操作系統(tǒng)。
PXE(預(yù)啟動(dòng)執(zhí)行環(huán)境,在操作系統(tǒng)之前運(yùn)行)由Intel公司開發(fā)的網(wǎng)絡(luò)引導(dǎo)技術(shù),工作在Client/Server模式, 允許客戶機(jī)通過網(wǎng)絡(luò)從遠(yuǎn)程服務(wù)器下載引導(dǎo)鏡像,并加載安裝文件或者整個(gè)操作系統(tǒng)
pxe是通過網(wǎng)卡引導(dǎo)啟動(dòng)
2.實(shí)現(xiàn)過程
1.網(wǎng)卡需要查找相關(guān)的dhcp服務(wù)器(獲取地址時(shí)間)
2.找到后dhcp服務(wù)器提供ip地址,和引導(dǎo)程序(boot loader)的地址 還提供給客戶機(jī)TFTPserver地址(dhcp本身不提供tftp服務(wù))
3.網(wǎng)卡使用tftp客戶端吧引導(dǎo)程序加載到內(nèi)存中來
4.bios執(zhí)行引導(dǎo)程序
5.引導(dǎo)程序會(huì)去TFTP去查找配置文件
6.根據(jù)配置文件去引導(dǎo)安裝系統(tǒng)
7.系統(tǒng)安裝過程
3.實(shí)驗(yàn)操作
3.1安裝dhcp、vsftpd、tftp-server.x86_64、syslinux服務(wù)
[root@localhost ~]#yum install dhcp vsftpd tftp-server.x86_64 syslinux
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.bupt.edu.cn
* epel: mirror.nju.edu.cn
* extras: mirrors.bupt.edu.cn
* updates: mirrors.nju.edu.cn
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 dhcp.x86_64.12.4.2.5-83.el7.centos.1 將被 安裝
--> 正在處理依賴關(guān)系 dhcp-libs(x86-64) = 12:4.2.5-83.el7.centos.1,它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 dhcp-common = 12:4.2.5-83.el7.centos.1,它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 libisc-export.so.169()(64bit),它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 libdns-export.so.1102()(64bit),它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
---> 軟件包 syslinux.x86_64.0.4.05-15.el7 將被 安裝
---> 軟件包 tftp-server.x86_64.0.5.2-22.el7 將被 安裝
---> 軟件包 vsftpd.x86_64.0.3.0.2-29.el7_9 將被 安裝
--> 正在檢查事務(wù)
---> 軟件包 bind-export-libs.x86_64.32.9.11.4-26.P2.el7_9.15 將被 安裝
---> 軟件包 dhcp-common.x86_64.12.4.2.5-58.el7.centos 將被 升級
--> 正在處理依賴關(guān)系 dhcp-common = 12:4.2.5-58.el7.centos,它被軟件包 12:dhclient-4.2.5-58.el7.centos.x86_64 需要
---> 軟件包 dhcp-common.x86_64.12.4.2.5-83.el7.centos.1 將被 更新
---> 軟件包 dhcp-libs.x86_64.12.4.2.5-58.el7.centos 將被 升級
---> 軟件包 dhcp-libs.x86_64.12.4.2.5-83.el7.centos.1 將被 更新
--> 正在檢查事務(wù)
---> 軟件包 dhclient.x86_64.12.4.2.5-58.el7.centos 將被 升級
---> 軟件包 dhclient.x86_64.12.4.2.5-83.el7.centos.1 將被 更新
--> 解決依賴關(guān)系完成
依賴關(guān)系解決
==================================================================================
Package 架構(gòu) 版本 源 大小
==================================================================================
正在安裝:
dhcp x86_64 12:4.2.5-83.el7.centos.1 updates 515 k
syslinux x86_64 4.05-15.el7 base 990 k
tftp-server x86_64 5.2-22.el7 base 47 k
vsftpd x86_64 3.0.2-29.el7_9 updates 173 k
為依賴而安裝:
bind-export-libs x86_64 32:9.11.4-26.P2.el7_9.15 updates 1.1 M
為依賴而更新:
dhclient x86_64 12:4.2.5-83.el7.centos.1 updates 286 k
dhcp-common x86_64 12:4.2.5-83.el7.centos.1 updates 177 k
dhcp-libs x86_64 12:4.2.5-83.el7.centos.1 updates 133 k
事務(wù)概要
==================================================================================
安裝 4 軟件包 (+1 依賴軟件包)
升級 ( 3 依賴軟件包)
總計(jì):3.4 M
總下載量:1.7 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): tftp-server-5.2-22.el7.x86_64.rpm | 47 kB 00:00:00
(2/4): dhcp-4.2.5-83.el7.centos.1.x86_64.rpm | 515 kB 00:00:00
(3/4): syslinux-4.05-15.el7.x86_64.rpm | 990 kB 00:00:00
(4/4): vsftpd-3.0.2-29.el7_9.x86_64.rpm | 173 kB 00:00:05
----------------------------------------------------------------------------------
總計(jì) 295 kB/s | 1.7 MB 00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : 12:dhcp-libs-4.2.5-83.el7.centos.1.x86_64 1/11
正在更新 : 12:dhcp-common-4.2.5-83.el7.centos.1.x86_64 2/11
正在安裝 : 32:bind-export-libs-9.11.4-26.P2.el7_9.15.x86_64 3/11
正在安裝 : 12:dhcp-4.2.5-83.el7.centos.1.x86_64 4/11
正在更新 : 12:dhclient-4.2.5-83.el7.centos.1.x86_64 5/11
正在安裝 : tftp-server-5.2-22.el7.x86_64 6/11
正在安裝 : syslinux-4.05-15.el7.x86_64 7/11
正在安裝 : vsftpd-3.0.2-29.el7_9.x86_64 8/11
清理 : 12:dhclient-4.2.5-58.el7.centos.x86_64 9/11
清理 : 12:dhcp-common-4.2.5-58.el7.centos.x86_64 10/11
清理 : 12:dhcp-libs-4.2.5-58.el7.centos.x86_64 11/11
驗(yàn)證中 : 12:dhcp-common-4.2.5-83.el7.centos.1.x86_64 1/11
驗(yàn)證中 : 12:dhcp-4.2.5-83.el7.centos.1.x86_64 2/11
驗(yàn)證中 : 12:dhcp-libs-4.2.5-83.el7.centos.1.x86_64 3/11
驗(yàn)證中 : 12:dhclient-4.2.5-83.el7.centos.1.x86_64 4/11
驗(yàn)證中 : vsftpd-3.0.2-29.el7_9.x86_64 5/11
驗(yàn)證中 : syslinux-4.05-15.el7.x86_64 6/11
驗(yàn)證中 : tftp-server-5.2-22.el7.x86_64 7/11
驗(yàn)證中 : 32:bind-export-libs-9.11.4-26.P2.el7_9.15.x86_64 8/11
驗(yàn)證中 : 12:dhcp-common-4.2.5-58.el7.centos.x86_64 9/11
驗(yàn)證中 : 12:dhcp-libs-4.2.5-58.el7.centos.x86_64 10/11
驗(yàn)證中 : 12:dhclient-4.2.5-58.el7.centos.x86_64 11/11
已安裝:
dhcp.x86_64 12:4.2.5-83.el7.centos.1 syslinux.x86_64 0:4.05-15.el7
tftp-server.x86_64 0:5.2-22.el7 vsftpd.x86_64 0:3.0.2-29.el7_9
作為依賴被安裝:
bind-export-libs.x86_64 32:9.11.4-26.P2.el7_9.15
作為依賴被升級:
dhclient.x86_64 12:4.2.5-83.el7.centos.1
dhcp-common.x86_64 12:4.2.5-83.el7.centos.1
dhcp-libs.x86_64 12:4.2.5-83.el7.centos.1
完畢!
3.2修改配置文件——DHCP
[root@localhost ~]#cat /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
[root@localhost ~]#cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
#拷貝配置模版
cp:是否覆蓋"/etc/dhcp/dhcpd.conf"? y
[root@localhost ~]#vim /etc/dhcp/dhcpd.conf
#配置DHCP服務(wù)信息
subnet 192.168.241.0 netmask 255.255.255.0 {
range 192.168.241.30 192.168.241.60;
option routers 192.168.241.2;
next-server 192.168.241.11;
#通過192.168.241.11的服務(wù)端進(jìn)行服務(wù)
filename= "pxelinux.0";
#獲取引導(dǎo)信息
}
[root@localhost ~]#systemctl start dhcpd
#開啟dhcp服務(wù)
3.3修改配置文件——TFTP
[root@localhost ~]#rpm -qc tftp-server
#查看tftp服務(wù)配置信息位置
/etc/xinetd.d/tftp
[root@localhost ~]#vim /etc/xinetd.d/tftp
disable = no
#默認(rèn)為yes 修改為no
[root@localhost ~]#cd /var/lib/tftpboot/
[root@localhost tftpboot]#mount /dev/sr0 /mnt
mount: /dev/sr0 寫保護(hù),將以只讀方式掛載
[root@localhost tftpboot]#cp /mnt/isolinux/initrd.img /mnt/isolinux/vmlinuz .
#拷貝提供驅(qū)動(dòng)的initrd程序(小型Linux系統(tǒng)) vmlinuz內(nèi)核程序到當(dāng)前文件夾
[root@localhost tftpboot]#ls
initrd.img vmlinuz
[root@localhost tftpboot]#rpm -ql syslinux |grep pxelinux.0
/usr/share/syslinux/gpxelinux.0
/usr/share/syslinux/pxelinux.0
[root@localhost tftpboot]#cp /usr/share/syslinux/pxelinux.0 .
#拷貝引導(dǎo)程序pxelinux.0到當(dāng)前目錄
[root@localhost tftpboot]#ls
initrd.img pxelinux.0 vmlinuz
#目前已具備驅(qū)動(dòng)、引導(dǎo)程序、內(nèi)核
[root@localhost tftpboot]#mkdir pxelinux.cfg
[root@localhost tftpboot]#cd pxelinux.cfg/
[root@localhost pxelinux.cfg]#ls
[root@localhost pxelinux.cfg]#vim default
default linux
#權(quán)限為linux
timeout 600
#超時(shí)等待時(shí)長為600秒
label linux
kernel vmlinuz
#內(nèi)核 核心為vmlinuz
append initrd=initrd.img method=ftp://192.168.241.11/centos7
#驅(qū)動(dòng)使用initrd.img 獲取方式為ftp協(xié)議連接到192.168.241.11/centos7
[root@localhost tftpboot]#mkdir /var/ftp/centos7
[root@localhost tftpboot]#mount /dev/sr0 /var/ftp/centos7/
mount: /dev/sr0 寫保護(hù),將以只讀方式掛載
[root@localhost pxelinux.cfg]#cd ..
[root@localhost tftpboot]#ls
initrd.img pxelinux.0 pxelinux.cfg vmlinuz
[root@localhost tftpboot]#systemctl start tftp
#開啟tftp服務(wù)
[root@localhost tftpboot]#systemctl start vsftpd
#開啟vsftpd服務(wù)
[root@localhost tftpboot]#systemctl stop firewalld
#關(guān)閉防火墻
[root@localhost tftpboot]#setenforce 0
#關(guān)閉防護(hù)
setenforce: SELinux is disabled
3.4kickstart——無人值守安裝
kickstart文件主要包括三個(gè)部分:命令段,程序包段,腳本段
命令段:指明各種安裝前配置,如鍵盤類型等
命令段中的常見命令
- keyboard: 設(shè)定鍵盤類型
- lang: 語言類型
- zerombr:清除mbr
- clearpart:清除分區(qū)
- part: 創(chuàng)建分區(qū)
- rootpw: 指明root的密碼
- timezone: 時(shí)區(qū)
- text: 文本安裝界面
- network:指定網(wǎng)絡(luò)設(shè)置
- firewall:設(shè)置防火墻設(shè)置
- selinux:設(shè)置selinux設(shè)置
- reboot:安裝完自動(dòng)重啟
- user:安裝完成后為系統(tǒng)創(chuàng)建新用戶
- url: 指明安裝源
程序包段:指明要安裝的程序包組或程序包,不安裝的程序包等
%packages
@^environment group: 指定環(huán)境包組,如:@^minimal-environment
@group_name
package
-package
%end
腳本段
%pre: 安裝前腳本
%post: 安裝后腳本
%post
useradd wang ? ?#執(zhí)行什么腳本
%end
注意:CentOS 8,7,6 不同版本的kickstart文件格式不盡相同,不可混用
[root@localhost tftpboot]#yum install system-config-kickstart.noarch -y
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.bupt.edu.cn
* epel: mirror.nju.edu.cn
* extras: mirrors.bupt.edu.cn
* updates: mirrors.nju.edu.cn
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 system-config-kickstart.noarch.0.2.9.7-1.el7 將被 安裝
--> 正在處理依賴關(guān)系 system-config-keyboard >= 1.3.1,它被軟件包 system-config-kickstart-2.9.7-1.el7.noarch 需要
--> 正在處理依賴關(guān)系 system-config-language,它被軟件包 system-config-kickstart-2.9.7-1.el7.noarch 需要
--> 正在處理依賴關(guān)系 system-config-date,它被軟件包 system-config-kickstart-2.9.7-1.el7.noarch 需要
--> 正在檢查事務(wù)
---> 軟件包 system-config-date.noarch.0.1.10.6-3.el7.centos 將被 安裝
--> 正在處理依賴關(guān)系 system-config-date-docs,它被軟件包 system-config-date-1.10.6-3.el7.centos.noarch 需要
--> 正在處理依賴關(guān)系 gnome-python2-canvas,它被軟件包 system-config-date-1.10.6-3.el7.centos.noarch 需要
---> 軟件包 system-config-keyboard.noarch.0.1.4.0-5.el7 將被 安裝
--> 正在處理依賴關(guān)系 system-config-keyboard-base = 1.4.0-5.el7,它被軟件包 system-config-keyboard-1.4.0-5.el7.noarch 需要
---> 軟件包 system-config-language.noarch.0.1.4.0-9.el7 將被 安裝
--> 正在處理依賴關(guān)系 usermode-gtk,它被軟件包 system-config-language-1.4.0-9.el7.noarch 需要
--> 正在檢查事務(wù)
---> 軟件包 gnome-python2-canvas.x86_64.0.2.28.1-14.el7 將被 安裝
--> 正在處理依賴關(guān)系 gnome-python2(x86-64) = 2.28.1-14.el7,它被軟件包 gnome-python2-canvas-2.28.1-14.el7.x86_64 需要
--> 正在處理依賴關(guān)系 libgnomecanvas(x86-64) >= 2.8.0,它被軟件包 gnome-python2-canvas-2.28.1-14.el7.x86_64 需要
--> 正在處理依賴關(guān)系 libgnomecanvas-2.so.0()(64bit),它被軟件包 gnome-python2-canvas-2.28.1-14.el7.x86_64 需要
--> 正在處理依賴關(guān)系 libart_lgpl_2.so.2()(64bit),它被軟件包 gnome-python2-canvas-2.28.1-14.el7.x86_64 需要
---> 軟件包 system-config-date-docs.noarch.0.1.0.11-4.el7 將被 安裝
--> 正在處理依賴關(guān)系 rarian-compat,它被軟件包 system-config-date-docs-1.0.11-4.el7.noarch 需要
---> 軟件包 system-config-keyboard-base.noarch.0.1.4.0-5.el7 將被 安裝
---> 軟件包 usermode-gtk.x86_64.0.1.111-6.el7 將被 安裝
--> 正在處理依賴關(guān)系 usermode = 1.111-6.el7,它被軟件包 usermode-gtk-1.111-6.el7.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 gnome-python2.x86_64.0.2.28.1-14.el7 將被 安裝
---> 軟件包 libart_lgpl.x86_64.0.2.3.21-10.el7 將被 安裝
---> 軟件包 libgnomecanvas.x86_64.0.2.30.3-8.el7 將被 安裝
---> 軟件包 rarian-compat.x86_64.0.0.8.1-11.el7 將被 安裝
--> 正在處理依賴關(guān)系 rarian = 0.8.1-11.el7,它被軟件包 rarian-compat-0.8.1-11.el7.x86_64 需要
--> 正在處理依賴關(guān)系 rarian,它被軟件包 rarian-compat-0.8.1-11.el7.x86_64 需要
--> 正在處理依賴關(guān)系 librarian.so.0()(64bit),它被軟件包 rarian-compat-0.8.1-11.el7.x86_64 需要
---> 軟件包 usermode.x86_64.0.1.111-5.el7 將被 升級
---> 軟件包 usermode.x86_64.0.1.111-6.el7 將被 更新
--> 正在檢查事務(wù)
---> 軟件包 rarian.x86_64.0.0.8.1-11.el7 將被 安裝
--> 解決依賴關(guān)系完成
依賴關(guān)系解決
==================================================================================
Package 架構(gòu) 版本 源 大小
==================================================================================
正在安裝:
system-config-kickstart noarch 2.9.7-1.el7 base 348 k
為依賴而安裝:
gnome-python2 x86_64 2.28.1-14.el7 base 47 k
gnome-python2-canvas x86_64 2.28.1-14.el7 base 34 k
libart_lgpl x86_64 2.3.21-10.el7 base 67 k
libgnomecanvas x86_64 2.30.3-8.el7 base 226 k
rarian x86_64 0.8.1-11.el7 base 98 k
rarian-compat x86_64 0.8.1-11.el7 base 66 k
system-config-date noarch 1.10.6-3.el7.centos base 591 k
system-config-date-docs noarch 1.0.11-4.el7 base 527 k
system-config-keyboard noarch 1.4.0-5.el7 base 33 k
system-config-keyboard-base noarch 1.4.0-5.el7 base 103 k
system-config-language noarch 1.4.0-9.el7 base 133 k
usermode-gtk x86_64 1.111-6.el7 base 110 k
為依賴而更新:
usermode x86_64 1.111-6.el7 base 193 k
事務(wù)概要
==================================================================================
安裝 1 軟件包 (+12 依賴軟件包)
升級 ( 1 依賴軟件包)
總計(jì):2.5 M
總下載量:2.3 M
Downloading packages:
(1/13): gnome-python2-canvas-2.28.1-14.el7.x86_64.rpm | 34 kB 00:00:00
(2/13): gnome-python2-2.28.1-14.el7.x86_64.rpm | 47 kB 00:00:00
(3/13): libart_lgpl-2.3.21-10.el7.x86_64.rpm | 67 kB 00:00:00
(4/13): libgnomecanvas-2.30.3-8.el7.x86_64.rpm | 226 kB 00:00:00
(5/13): rarian-0.8.1-11.el7.x86_64.rpm | 98 kB 00:00:00
(6/13): rarian-compat-0.8.1-11.el7.x86_64.rpm | 66 kB 00:00:00
(7/13): system-config-date-1.10.6-3.el7.centos.noarch.rpm | 591 kB 00:00:00
(8/13): system-config-keyboard-1.4.0-5.el7.noarch.rpm | 33 kB 00:00:00
(9/13): system-config-date-docs-1.0.11-4.el7.noarch.rpm | 527 kB 00:00:00
(10/13): system-config-keyboard-base-1.4.0-5.el7.noarch.rp | 103 kB 00:00:00
(11/13): system-config-language-1.4.0-9.el7.noarch.rpm | 133 kB 00:00:00
(12/13): usermode-gtk-1.111-6.el7.x86_64.rpm | 110 kB 00:00:00
(13/13): system-config-kickstart-2.9.7-1.el7.noarch.rpm | 348 kB 00:00:00
----------------------------------------------------------------------------------
總計(jì) 2.1 MB/s | 2.3 MB 00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : usermode-1.111-6.el7.x86_64 1/15
正在安裝 : libart_lgpl-2.3.21-10.el7.x86_64 2/15
正在安裝 : libgnomecanvas-2.30.3-8.el7.x86_64 3/15
正在安裝 : usermode-gtk-1.111-6.el7.x86_64 4/15
正在安裝 : system-config-language-1.4.0-9.el7.noarch 5/15
正在安裝 : gnome-python2-2.28.1-14.el7.x86_64 6/15
正在安裝 : gnome-python2-canvas-2.28.1-14.el7.x86_64 7/15
正在安裝 : rarian-0.8.1-11.el7.x86_64 8/15
正在安裝 : rarian-compat-0.8.1-11.el7.x86_64 9/15
正在安裝 : system-config-date-docs-1.0.11-4.el7.noarch 10/15
正在安裝 : system-config-date-1.10.6-3.el7.centos.noarch 11/15
正在安裝 : system-config-keyboard-base-1.4.0-5.el7.noarch 12/15
正在安裝 : system-config-keyboard-1.4.0-5.el7.noarch 13/15
正在安裝 : system-config-kickstart-2.9.7-1.el7.noarch 14/15
清理 : usermode-1.111-5.el7.x86_64 15/15
驗(yàn)證中 : libgnomecanvas-2.30.3-8.el7.x86_64 1/15
驗(yàn)證中 : system-config-keyboard-base-1.4.0-5.el7.noarch 2/15
驗(yàn)證中 : system-config-date-docs-1.0.11-4.el7.noarch 3/15
驗(yàn)證中 : system-config-language-1.4.0-9.el7.noarch 4/15
驗(yàn)證中 : system-config-date-1.10.6-3.el7.centos.noarch 5/15
驗(yàn)證中 : system-config-keyboard-1.4.0-5.el7.noarch 6/15
驗(yàn)證中 : system-config-kickstart-2.9.7-1.el7.noarch 7/15
驗(yàn)證中 : gnome-python2-canvas-2.28.1-14.el7.x86_64 8/15
驗(yàn)證中 : rarian-compat-0.8.1-11.el7.x86_64 9/15
驗(yàn)證中 : rarian-0.8.1-11.el7.x86_64 10/15
驗(yàn)證中 : usermode-gtk-1.111-6.el7.x86_64 11/15
驗(yàn)證中 : libart_lgpl-2.3.21-10.el7.x86_64 12/15
驗(yàn)證中 : usermode-1.111-6.el7.x86_64 13/15
驗(yàn)證中 : gnome-python2-2.28.1-14.el7.x86_64 14/15
驗(yàn)證中 : usermode-1.111-5.el7.x86_64 15/15
已安裝:
system-config-kickstart.noarch 0:2.9.7-1.el7
作為依賴被安裝:
gnome-python2.x86_64 0:2.28.1-14.el7
gnome-python2-canvas.x86_64 0:2.28.1-14.el7
libart_lgpl.x86_64 0:2.3.21-10.el7
libgnomecanvas.x86_64 0:2.30.3-8.el7
rarian.x86_64 0:0.8.1-11.el7
rarian-compat.x86_64 0:0.8.1-11.el7
system-config-date.noarch 0:1.10.6-3.el7.centos
system-config-date-docs.noarch 0:1.0.11-4.el7
system-config-keyboard.noarch 0:1.4.0-5.el7
system-config-keyboard-base.noarch 0:1.4.0-5.el7
system-config-language.noarch 0:1.4.0-9.el7
usermode-gtk.x86_64 0:1.111-6.el7
作為依賴被升級:
usermode.x86_64 0:1.111-6.el7
完畢!
[root@localhost tftpboot]#vim anaconda-ks.cfg
%post
useradd cxk
%end
3.4.1選擇程序
3.4.2修改基礎(chǔ)配置
3.4.3修改安裝方法?
3.4.4安裝新引導(dǎo)裝載程序?
3.4.5配置分區(qū)信息?
3.4.5.1配置boot分區(qū)
3.4.5.2配置swap分區(qū)?
3.4.5.3配置根分區(qū)?
3.4.6防火墻配置?
3.4.7顯示配置——不安裝圖形環(huán)境?
3.4.8安裝后腳本配置??
3.4.9保存配置信息??
[root@localhost ~]#cd /var/ftp/
[root@localhost ftp]#ls
centos7 ks.cfg pub
[root@localhost ftp]#vim ks.cfg
#ks.cfg是在kickstart程序配置好的相關(guān)信息
[root@localhost ftp]#cd /var/lib/tftpboot/
[root@localhost tftpboot]#ls
anaconda-ks.cfg initrd.img pxelinux.0 pxelinux.cfg vmlinuz
#安裝后腳本信息 驅(qū)動(dòng)信息 引導(dǎo)程序信息 linux程序信息 內(nèi)核信息
[root@localhost tftpboot]#vim pxelinux.cfg/default
default linux
timeout 600
label linux
kernel vmlinuz
append initrd=initrd.img method=ftp://192.168.241.11/centos7
ks=ftp://192.168.241.11/ks.cfg
3.4.10新建虛擬機(jī)配置參數(shù)?
3.4.11開啟虛擬機(jī)——選擇網(wǎng)絡(luò)安裝系統(tǒng)?
3.4.12在此界面只需等待即可?
3.4.13測試——登錄成功?
4.Cobbler——快速建立Linux網(wǎng)絡(luò)安裝環(huán)境
Cobbler可以用來快速建立Linux網(wǎng)絡(luò)安裝環(huán)境
- Cobbler是一個(gè)Linux服務(wù)器安裝的服務(wù),可以通過網(wǎng)絡(luò)啟動(dòng)(PXE)的方式來快速安裝、重裝物理服務(wù)器和虛擬機(jī),同時(shí)還可以管理DHCP,DNS等
- Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),還提供了API接口,可以方便二次開發(fā)使用
- Cobbler是較早前的kickstart的升級版,優(yōu)點(diǎn)是比較容易配置,還自帶web界面比較易于管理
- Cobbler內(nèi)置了一個(gè)輕量級配置管理系統(tǒng),但它也支持和其它配置管理系統(tǒng)集成,如Puppet
4.1Cobbler工作原理?
- client裸機(jī)配置了從網(wǎng)絡(luò)啟動(dòng)后,開機(jī)后會(huì)廣播包請求DHCP服務(wù)器(cobbler server)發(fā)送其分配好的一個(gè)IP
- DHCP服務(wù)器(cobbler server)收到請求后發(fā)送responese,包括其ip地址
- client裸機(jī)拿到ip后再向cobbler server發(fā)送請求OS引導(dǎo)文件的請求
- cobbler server告訴裸機(jī)OS引導(dǎo)文件的名字和TFTP server的ip和port
- client裸機(jī)通過上面告知的TFTP server地址通信,下載引導(dǎo)文件
- client裸機(jī)執(zhí)行執(zhí)行該引導(dǎo)文件,確定加載信息,選擇要安裝的os,期間會(huì)再向cobbler server請求kickstart文件和os image
- cobbler server發(fā)送請求的kickstart和os iamge
- client裸機(jī)加載kickstart文件
- client裸機(jī)接收os image,安裝該os image
?
4.2實(shí)際操作
4.2.1安裝epel源
[root@localhost ~]#yum install epel-release.noarch -y
已加載插件:fastestmirror, langpacks
base | 3.6 kB 00:00:00
epel/x86_64/metalink | 7.8 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:10
(2/2): epel/x86_64/primary_db | 7.0 MB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.bfsu.edu.cn
* epel: mirror.nju.edu.cn
* extras: mirrors.bupt.edu.cn
* updates: mirrors.bupt.edu.cn
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 epel-release.noarch.0.7-11 將被 升級
---> 軟件包 epel-release.noarch.0.7-14 將被 更新
--> 解決依賴關(guān)系完成
依賴關(guān)系解決
==================================================================================
Package 架構(gòu) 版本 源 大小
==================================================================================
正在更新:
epel-release noarch 7-14 epel 15 k
事務(wù)概要
==================================================================================
升級 1 軟件包
總計(jì):15 k
Downloading packages:
警告:/var/cache/yum/x86_64/7/epel/packages/epel-release-7-14.noarch.rpm: 頭V4 RSA/SHA256 Signature, 密鑰 ID 352c64e5: NOKEY
從 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 檢索密鑰
導(dǎo)入 GPG key 0x352C64E5:
用戶ID : "Fedora EPEL (7) <epel@fedoraproject.org>"
指紋 : 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
軟件包 : epel-release-7-11.noarch (@extras)
來自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : epel-release-7-14.noarch 1/2
清理 : epel-release-7-11.noarch 2/2
驗(yàn)證中 : epel-release-7-14.noarch 1/2
驗(yàn)證中 : epel-release-7-11.noarch 2/2
更新完畢:
epel-release.noarch 0:7-14
完畢!
4.2.2安裝cobbler軟件、dhcp軟件和httpd軟件?
[root@localhost ~]#yum install cobbler dhcp httpd -y
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.bfsu.edu.cn
* epel: mirrors.bfsu.edu.cn
* extras: mirrors.bupt.edu.cn
* updates: mirrors.bupt.edu.cn
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 cobbler.x86_64.0.2.8.5-6.el7 將被 安裝
--> 正在處理依賴關(guān)系 mod_wsgi,它被軟件包 cobbler-2.8.5-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 python2-cheetah,它被軟件包 cobbler-2.8.5-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 python2-pyyaml,它被軟件包 cobbler-2.8.5-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 python2-simplejson,它被軟件包 cobbler-2.8.5-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 syslinux,它被軟件包 cobbler-2.8.5-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 tftp-server,它被軟件包 cobbler-2.8.5-6.el7.x86_64 需要
---> 軟件包 dhcp.x86_64.12.4.2.5-83.el7.centos.1 將被 安裝
--> 正在處理依賴關(guān)系 dhcp-libs(x86-64) = 12:4.2.5-83.el7.centos.1,它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 dhcp-common = 12:4.2.5-83.el7.centos.1,它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 libisc-export.so.169()(64bit),它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 libdns-export.so.1102()(64bit),它被軟件包 12:dhcp-4.2.5-83.el7.centos.1.x86_64 需要
---> 軟件包 httpd.x86_64.0.2.4.6-99.el7.centos.1 將被 安裝
--> 正在處理依賴關(guān)系 httpd-tools = 2.4.6-99.el7.centos.1,它被軟件包 httpd-2.4.6-99.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 /etc/mime.types,它被軟件包 httpd-2.4.6-99.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 libaprutil-1.so.0()(64bit),它被軟件包 httpd-2.4.6-99.el7.centos.1.x86_64 需要
--> 正在處理依賴關(guān)系 libapr-1.so.0()(64bit),它被軟件包 httpd-2.4.6-99.el7.centos.1.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 apr.x86_64.0.1.4.8-7.el7 將被 安裝
---> 軟件包 apr-util.x86_64.0.1.5.2-6.el7_9.1 將被 安裝
---> 軟件包 bind-export-libs.x86_64.32.9.11.4-26.P2.el7_9.15 將被 安裝
---> 軟件包 dhcp-common.x86_64.12.4.2.5-58.el7.centos 將被 升級
--> 正在處理依賴關(guān)系 dhcp-common = 12:4.2.5-58.el7.centos,它被軟件包 12:dhclient-4.2.5-58.el7.centos.x86_64 需要
---> 軟件包 dhcp-common.x86_64.12.4.2.5-83.el7.centos.1 將被 更新
---> 軟件包 dhcp-libs.x86_64.12.4.2.5-58.el7.centos 將被 升級
---> 軟件包 dhcp-libs.x86_64.12.4.2.5-83.el7.centos.1 將被 更新
---> 軟件包 httpd-tools.x86_64.0.2.4.6-99.el7.centos.1 將被 安裝
---> 軟件包 mailcap.noarch.0.2.1.41-2.el7 將被 安裝
---> 軟件包 mod_wsgi.x86_64.0.3.4-18.el7 將被 安裝
---> 軟件包 python2-cheetah.x86_64.0.2.4.4-6.el7 將被 安裝
--> 正在處理依賴關(guān)系 python-pygments,它被軟件包 python2-cheetah-2.4.4-6.el7.x86_64 需要
--> 正在處理依賴關(guān)系 python2-markdown,它被軟件包 python2-cheetah-2.4.4-6.el7.x86_64 需要
---> 軟件包 python2-pyyaml.noarch.0.3.10-0.el7 將被 安裝
--> 正在處理依賴關(guān)系 PyYAML >= 3.10,它被軟件包 python2-pyyaml-3.10-0.el7.noarch 需要
---> 軟件包 python2-simplejson.x86_64.0.3.11.1-1.el7 將被 安裝
---> 軟件包 syslinux.x86_64.0.4.05-15.el7 將被 安裝
---> 軟件包 tftp-server.x86_64.0.5.2-22.el7 將被 安裝
--> 正在檢查事務(wù)
---> 軟件包 PyYAML.x86_64.0.3.10-11.el7 將被 安裝
--> 正在處理依賴關(guān)系 libyaml-0.so.2()(64bit),它被軟件包 PyYAML-3.10-11.el7.x86_64 需要
---> 軟件包 dhclient.x86_64.12.4.2.5-58.el7.centos 將被 升級
---> 軟件包 dhclient.x86_64.12.4.2.5-83.el7.centos.1 將被 更新
---> 軟件包 python-pygments.noarch.0.1.4-10.el7 將被 安裝
--> 正在處理依賴關(guān)系 python-imaging,它被軟件包 python-pygments-1.4-10.el7.noarch 需要
---> 軟件包 python2-markdown.noarch.0.2.4.1-4.el7 將被 安裝
--> 正在檢查事務(wù)
---> 軟件包 libyaml.x86_64.0.0.1.4-11.el7_0 將被 安裝
---> 軟件包 python-pillow.x86_64.0.2.0.0-23.gitd1c6db8.el7_9 將被 安裝
--> 解決依賴關(guān)系完成
依賴關(guān)系解決
==================================================================================
Package 架構(gòu) 版本 源 大小
==================================================================================
正在安裝:
cobbler x86_64 2.8.5-6.el7 epel 580 k
dhcp x86_64 12:4.2.5-83.el7.centos.1 updates 515 k
httpd x86_64 2.4.6-99.el7.centos.1 updates 2.7 M
為依賴而安裝:
PyYAML x86_64 3.10-11.el7 base 153 k
apr x86_64 1.4.8-7.el7 base 104 k
apr-util x86_64 1.5.2-6.el7_9.1 updates 92 k
bind-export-libs x86_64 32:9.11.4-26.P2.el7_9.15 updates 1.1 M
httpd-tools x86_64 2.4.6-99.el7.centos.1 updates 94 k
libyaml x86_64 0.1.4-11.el7_0 base 55 k
mailcap noarch 2.1.41-2.el7 base 31 k
mod_wsgi x86_64 3.4-18.el7 base 77 k
python-pillow x86_64 2.0.0-23.gitd1c6db8.el7_9 updates 439 k
python-pygments noarch 1.4-10.el7 base 599 k
python2-cheetah x86_64 2.4.4-6.el7 epel 342 k
python2-markdown noarch 2.4.1-4.el7 epel 250 k
python2-pyyaml noarch 3.10-0.el7 epel 3.0 k
python2-simplejson x86_64 3.11.1-1.el7 epel 188 k
syslinux x86_64 4.05-15.el7 base 990 k
tftp-server x86_64 5.2-22.el7 base 47 k
為依賴而更新:
dhclient x86_64 12:4.2.5-83.el7.centos.1 updates 286 k
dhcp-common x86_64 12:4.2.5-83.el7.centos.1 updates 177 k
dhcp-libs x86_64 12:4.2.5-83.el7.centos.1 updates 133 k
事務(wù)概要
==================================================================================
安裝 3 軟件包 (+16 依賴軟件包)
升級 ( 3 依賴軟件包)
總計(jì):8.8 M
總下載量:7.2 M
Downloading packages:
(1/18): apr-1.4.8-7.el7.x86_64.rpm | 104 kB 00:00:00
(2/18): apr-util-1.5.2-6.el7_9.1.x86_64.rpm | 92 kB 00:00:00
(3/18): httpd-tools-2.4.6-99.el7.centos.1.x86_64.rpm | 94 kB 00:00:00
(4/18): cobbler-2.8.5-6.el7.x86_64.rpm | 580 kB 00:00:00
(5/18): libyaml-0.1.4-11.el7_0.x86_64.rpm | 55 kB 00:00:00
(6/18): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00
(7/18): mod_wsgi-3.4-18.el7.x86_64.rpm | 77 kB 00:00:00
(8/18): httpd-2.4.6-99.el7.centos.1.x86_64.rpm | 2.7 MB 00:00:00
(9/18): python2-cheetah-2.4.4-6.el7.x86_64.rpm | 342 kB 00:00:00
(10/18): python-pygments-1.4-10.el7.noarch.rpm | 599 kB 00:00:00
(11/18): python2-markdown-2.4.1-4.el7.noarch.rpm | 250 kB 00:00:00
(12/18): dhcp-4.2.5-83.el7.centos.1.x86_64.rpm | 515 kB 00:00:00
(13/18): python2-pyyaml-3.10-0.el7.noarch.rpm | 3.0 kB 00:00:00
(14/18): python2-simplejson-3.11.1-1.el7.x86_64.rpm | 188 kB 00:00:00
(15/18): python-pillow-2.0.0-23.gitd1c6db8.el7_9.x86_64.rp | 439 kB 00:00:00
(16/18): syslinux-4.05-15.el7.x86_64.rpm | 990 kB 00:00:00
(17/18): tftp-server-5.2-22.el7.x86_64.rpm | 47 kB 00:00:00
(18/18): PyYAML-3.10-11.el7.x86_64.rpm | 153 kB 00:00:05
----------------------------------------------------------------------------------
總計(jì) 1.2 MB/s | 7.2 MB 00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : 12:dhcp-libs-4.2.5-83.el7.centos.1.x86_64 1/25
正在安裝 : apr-1.4.8-7.el7.x86_64 2/25
正在安裝 : apr-util-1.5.2-6.el7_9.1.x86_64 3/25
正在更新 : 12:dhcp-common-4.2.5-83.el7.centos.1.x86_64 4/25
正在安裝 : 32:bind-export-libs-9.11.4-26.P2.el7_9.15.x86_64 5/25
正在安裝 : httpd-tools-2.4.6-99.el7.centos.1.x86_64 6/25
正在安裝 : python-pillow-2.0.0-23.gitd1c6db8.el7_9.x86_64 7/25
正在安裝 : python-pygments-1.4-10.el7.noarch 8/25
正在安裝 : python2-markdown-2.4.1-4.el7.noarch 9/25
正在安裝 : python2-cheetah-2.4.4-6.el7.x86_64 10/25
正在安裝 : libyaml-0.1.4-11.el7_0.x86_64 11/25
正在安裝 : PyYAML-3.10-11.el7.x86_64 12/25
正在安裝 : python2-pyyaml-3.10-0.el7.noarch 13/25
正在安裝 : tftp-server-5.2-22.el7.x86_64 14/25
正在安裝 : syslinux-4.05-15.el7.x86_64 15/25
正在安裝 : python2-simplejson-3.11.1-1.el7.x86_64 16/25
正在安裝 : mailcap-2.1.41-2.el7.noarch 17/25
正在安裝 : httpd-2.4.6-99.el7.centos.1.x86_64 18/25
正在安裝 : mod_wsgi-3.4-18.el7.x86_64 19/25
正在安裝 : cobbler-2.8.5-6.el7.x86_64 20/25
正在更新 : 12:dhclient-4.2.5-83.el7.centos.1.x86_64 21/25
正在安裝 : 12:dhcp-4.2.5-83.el7.centos.1.x86_64 22/25
清理 : 12:dhclient-4.2.5-58.el7.centos.x86_64 23/25
清理 : 12:dhcp-common-4.2.5-58.el7.centos.x86_64 24/25
清理 : 12:dhcp-libs-4.2.5-58.el7.centos.x86_64 25/25
驗(yàn)證中 : cobbler-2.8.5-6.el7.x86_64 1/25
驗(yàn)證中 : mailcap-2.1.41-2.el7.noarch 2/25
驗(yàn)證中 : 12:dhclient-4.2.5-83.el7.centos.1.x86_64 3/25
驗(yàn)證中 : httpd-2.4.6-99.el7.centos.1.x86_64 4/25
驗(yàn)證中 : python2-cheetah-2.4.4-6.el7.x86_64 5/25
驗(yàn)證中 : python2-pyyaml-3.10-0.el7.noarch 6/25
驗(yàn)證中 : python2-simplejson-3.11.1-1.el7.x86_64 7/25
驗(yàn)證中 : python-pygments-1.4-10.el7.noarch 8/25
驗(yàn)證中 : apr-util-1.5.2-6.el7_9.1.x86_64 9/25
驗(yàn)證中 : apr-1.4.8-7.el7.x86_64 10/25
驗(yàn)證中 : mod_wsgi-3.4-18.el7.x86_64 11/25
驗(yàn)證中 : 12:dhcp-common-4.2.5-83.el7.centos.1.x86_64 12/25
驗(yàn)證中 : 12:dhcp-4.2.5-83.el7.centos.1.x86_64 13/25
驗(yàn)證中 : 12:dhcp-libs-4.2.5-83.el7.centos.1.x86_64 14/25
驗(yàn)證中 : syslinux-4.05-15.el7.x86_64 15/25
驗(yàn)證中 : tftp-server-5.2-22.el7.x86_64 16/25
驗(yàn)證中 : libyaml-0.1.4-11.el7_0.x86_64 17/25
驗(yàn)證中 : httpd-tools-2.4.6-99.el7.centos.1.x86_64 18/25
驗(yàn)證中 : python2-markdown-2.4.1-4.el7.noarch 19/25
驗(yàn)證中 : 32:bind-export-libs-9.11.4-26.P2.el7_9.15.x86_64 20/25
驗(yàn)證中 : PyYAML-3.10-11.el7.x86_64 21/25
驗(yàn)證中 : python-pillow-2.0.0-23.gitd1c6db8.el7_9.x86_64 22/25
驗(yàn)證中 : 12:dhcp-libs-4.2.5-58.el7.centos.x86_64 23/25
驗(yàn)證中 : 12:dhclient-4.2.5-58.el7.centos.x86_64 24/25
驗(yàn)證中 : 12:dhcp-common-4.2.5-58.el7.centos.x86_64 25/25
已安裝:
cobbler.x86_64 0:2.8.5-6.el7 dhcp.x86_64 12:4.2.5-83.el7.centos.1
httpd.x86_64 0:2.4.6-99.el7.centos.1
作為依賴被安裝:
PyYAML.x86_64 0:3.10-11.el7
apr.x86_64 0:1.4.8-7.el7
apr-util.x86_64 0:1.5.2-6.el7_9.1
bind-export-libs.x86_64 32:9.11.4-26.P2.el7_9.15
httpd-tools.x86_64 0:2.4.6-99.el7.centos.1
libyaml.x86_64 0:0.1.4-11.el7_0
mailcap.noarch 0:2.1.41-2.el7
mod_wsgi.x86_64 0:3.4-18.el7
python-pillow.x86_64 0:2.0.0-23.gitd1c6db8.el7_9
python-pygments.noarch 0:1.4-10.el7
python2-cheetah.x86_64 0:2.4.4-6.el7
python2-markdown.noarch 0:2.4.1-4.el7
python2-pyyaml.noarch 0:3.10-0.el7
python2-simplejson.x86_64 0:3.11.1-1.el7
syslinux.x86_64 0:4.05-15.el7
tftp-server.x86_64 0:5.2-22.el7
作為依賴被升級:
dhclient.x86_64 12:4.2.5-83.el7.centos.1
dhcp-common.x86_64 12:4.2.5-83.el7.centos.1
dhcp-libs.x86_64 12:4.2.5-83.el7.centos.1
完畢!
?4.2.3設(shè)置開機(jī)自啟
[root@localhost ~]#systemctl enable --now cobblerd.service httpd.service tftp.socket dhcpd
Created symlink from /etc/systemd/system/multi-user.target.wants/cobblerd.service to /usr/lib/systemd/system/cobblerd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
Created symlink from /etc/systemd/system/sockets.target.wants/tftp.socket to /usr/lib/systemd/system/tftp.socket.
Created symlink from /etc/systemd/system/multi-user.target.wants/dhcpd.service to /usr/lib/systemd/system/dhcpd.service.
Job for dhcpd.service failed because the control process exited with error code. See "systemctl status dhcpd.service" and "journalctl -xe" for details.
4.2.4檢查Cobbler哪些配置需要修改
[root@localhost ~]#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 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : Some network boot-loaders are missing from /var/lib/cobbler/loaders. 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.
5 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
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
Restart cobblerd and then run 'cobbler sync' to apply changes.
#這里配置1.2.8的服務(wù)即可
4.2.5生成新密碼
#需要設(shè)置新密碼 默認(rèn)安裝好的root用戶的密碼是cobbler 該項(xiàng)不設(shè)置也可以
[root@localhost ~]#openssl passwd -1 '123123'
$1$UXvic1Mh$JnZrF61ogglkIYZXuL1H..
#生成123123密碼的加密格式
4.2.6修改cobbler配置信息
[root@localhost ~]#vim /etc/cobbler/settings
#配置cobbler文件信息
101 default_password_crypted: "$1$UXvic1Mh$JnZrF61ogglkIYZXuL1H.." #登錄密碼123123
242 manage_dhcp: 1 #默認(rèn)為0,設(shè)置為1,通過cobbler生成dhcpd.conf配置文件
278 next_server: 192.168.241.11 #tftp服務(wù)器的IP地址
298 pxe_just_once: 1 #默認(rèn)為0,設(shè)置為1,防止重復(fù)安裝系統(tǒng)
390 server: 192.168.241.11 #cobbler服務(wù)器的IP地址
4.2.7重啟服務(wù),查看配置信息
[root@localhost ~]#systemctl restart cobblerd.service
[root@localhost ~]#cobbler check
The following are potential configuration items that you may want to fix:
1 : change 'disable' to 'no' in /etc/xinetd.d/tftp
2 : Some network boot-loaders are missing from /var/lib/cobbler/loaders. 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.
3 : enable and start rsyncd.service with systemctl
4 : debmirror package is not installed, it will be required to manage debian deployments and repositories
5 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Restart cobblerd and then run 'cobbler sync' to apply changes.
4.2.8配置dhcp文件信息
[root@localhost ~]#vim /etc/cobbler/dhcp.template
subnet 192.168.241.0 netmask 255.255.255.0 {
option routers 192.168.241.2;
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.241.30 192.168.241.60;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
[root@localhost ~]#cobbler sync
#自動(dòng)生成dhcp配置文件并啟動(dòng)
task started: 2024-01-17_141426_sync
task started (id=Sync, time=Wed Jan 17 14:14:26 2024)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout:
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
#任務(wù)完成
4.2.9導(dǎo)入Centos系統(tǒng)的安裝文件,生成相應(yīng)的yum源
[root@localhost ~]#mount /dev/sr0 /mnt
mount: /dev/sr0 寫保護(hù),將以只讀方式掛載
[root@localhost ~]#cobbler import --name=centos-7-x86_64 --path=/mnt --arch=x86_64task started: 2024-01-17_141704_import
task started (id=Media import, time=Wed Jan 17 14:17:04 2024)
Found a candidate signature: breed=suse, version=opensuse15.0
Found a candidate signature: breed=suse, version=opensuse15.1
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/centos-7-x86_64:
creating new distro: centos-7-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos-7-x86_64 -> /var/www/cobbler/links/centos-7-x86_64
creating new profile: centos-7-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/centos-7-x86_64 for centos-7-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos-7-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/centos-7-x86_64
looking for /var/www/cobbler/ks_mirror/centos-7-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos-7-x86_64/repodata
*** TASK COMPLETE ***
4.2.10重啟客戶機(jī),選擇網(wǎng)絡(luò)安裝系統(tǒng)?
4.2.11選擇內(nèi)核?
?4.2.12在頁面等待即可?

4.2.13驗(yàn)證
4.3延伸
#下載啟動(dòng)的相關(guān)文件
[root@centos7 ~]#cobbler get-loaders
[root@centos7 ~]#ls /var/lib/cobbler/loaders
[root@centos7 ~]#tree /var/lib/tftpboot/
[root@centos7 ~]#cobbler sync
#也可以在導(dǎo)入yum源的同時(shí)進(jìn)行關(guān)聯(lián)自定義的kickstart文件
[root@centos7 ~]#cobbler import --name=centos-7.7-x86_64 --path=/mnt --arch=x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos7.cfg
[root@centos7 ~]#du -sh /var/www/cobbler/ks_mirror/*
#設(shè)置默認(rèn)安裝菜單, 這樣未裝系統(tǒng)的設(shè)備會(huì)自動(dòng)從pxe引導(dǎo)啟動(dòng)你需要安裝的系統(tǒng), 不需要再手動(dòng)接顯示器選了
[root@centos7 ~]#cobbler system add --name=default --profile=centos-7-x86_64
配置文件 | 作用 |
/etc/cobbler | 配置文件目錄 |
/etc/cobbler/settings | cobbler主配置文件,這個(gè)文件是YAML格式,Cobbler是python寫的程序 |
/etc/cobbler/dhcp.template | DHCP服務(wù)的配置模版 |
/etc/cobbler/tftpd.template | tftp服務(wù)的配置模板 |
/etc/cobbler/rsync.template | rsync服務(wù)的配置模板 |
/etc/cobbler/iso | iso服務(wù)的配置模板 |
/etc/cobbler/pxe | pxe模板文件目錄 |
/etc/cobbler/poewer | 電源的配置文件目錄 |
/etc/cobbler/users.conf | Web服務(wù)授權(quán)配置文件 |
/etc/cobbler/users.digest | 用于web訪問的用戶名密碼配置文件 |
/etc/cobbler/dnsmasq.template | DNS服務(wù)的配置模板 |
/etc/cobbler/modules.conf | Cobbler模塊配置文件 |
/var/lib/cobbler | Cobbler數(shù)據(jù)目錄 |
/var/lib/cobbler/config | 配置文件 |
/var/lib/cobbler/kickstarts | 默認(rèn)存放kickstart文件 |
var/lib/cobbler/loaders | 存放的各種引導(dǎo)程序 |
/var/www/cobbler | 系統(tǒng)安裝鏡像目錄 |
/var/www/cobbler/ks_mirror | 導(dǎo)入的系統(tǒng)鏡像列表 |
/var/www/cobbler/images | 導(dǎo)入的系統(tǒng)鏡像啟動(dòng)文件 |
/var/www/cobbler/repo_mirror | yum源存儲目錄 |
/var/log/cobbler | 日志目錄 |
/var/log/cobbler/install.log | 客戶端系統(tǒng)安裝日志 |
/var/log/cobbler/cobbler.log | cobbler日志文章來源:http://www.zghlxwxcb.cn/news/detail-813496.html |
Cobbler命令幫助 | |
命令 | 說明 |
cobbler check | 核對當(dāng)前設(shè)置是否有問題 |
cobbler list | 列出所有的cobbler元素 |
cobbler report | 列出元素的詳細(xì)信息 |
cobbler sync | 同步配置到數(shù)據(jù)目錄,更改配置最好都執(zhí)行一下 |
cobbler reposync | 同步y(tǒng)um倉庫 |
cobbler distro | 查看導(dǎo)入的發(fā)行版系統(tǒng)信息 |
cobbler system | 查看添加的系統(tǒng)信息 |
cobbler profile | 查看配置信息 |
?文章來源地址http://www.zghlxwxcb.cn/news/detail-813496.html
到了這里,關(guān)于LINUX網(wǎng)絡(luò)第七章:PXE——高效批量網(wǎng)絡(luò)裝機(jī)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!