cobbler
簡介
Cobbler是一個Linux伺服器安裝的服務,可以通過網絡啟動(PXE)的方式來快速安裝、重裝實體伺服器和虛拟機,同時還可以管理DHCP,DNS等。
Cobbler可以使用指令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),還提供了API接口,可以友善二次開發使用。
Cobbler是較早前的kickstart的更新版,優點是比較容易配置,還自帶web界面比較易于管理。
Cobbler内置了一個輕量級配置管理系統,但它也支援和其它配置管理系統內建,如Puppet,暫時不支援SaltStack。
Cobbler官網:http://cobbler.github.io/
cobbler內建的服務
- PXE服務支援
- DHCP服務管理
- DNS服務管理(可選bind,dnsmasq)
- 電源管理
- Kickstart服務支援
- YUM倉庫管理
- TFTP(PXE啟動時需要) Apache(提供kickstart的安裝源,并提供定制化的kickstart配置),是用來給輕量檔案傳輸的
cobbler配置檔案詳解
cobbler配置檔案目錄在/etc/cobbler
配置檔案 | 作用 |
---|---|
/etc/cobbler/settings | cobbler 主配置檔案 |
/etc/cobbler/iso/ | iso模闆配置檔案 |
/etc/cobbler/pxe | pxe模闆配置檔案 |
/etc/cobbler/power | 電源配置檔案 |
/etc/cobbler/user.conf | web服務授權配置檔案 |
/etc/cobbler/users.digest | web通路的使用者名密碼配置檔案 |
/etc/cobbler/dhcp.template | dhcp伺服器的的配置模闆 |
/etc/cobbler/dnsmasq.template | dns伺服器的配置模闆 |
/etc/cobbler/tftpd.template | tftp服務的配置模闆 |
/etc/cobbler/modules.conf | 子產品的配置檔案 |
cobbler資料目錄
目錄 | |
---|---|
/var/lib/cobbler/config/ | 用于存放distros,system,profiles等資訊配置檔案 |
/var/lib/cobbler/triggers/ | 用于存放使用者定義的cobbler指令 |
/var/lib/cobbler/kickstart/ | 預設存放kickstart檔案 |
/var/lib/cobbler/loaders/ | 存放各種引導程式以及鏡像目錄 |
/var/www/cobbler/ks_mirror/ | 導入的發行版系統的所有資料 |
/var/www/cobbler/images/ | 導入發行版的kernel和initrd鏡像用于遠端網絡啟動 |
/var/www/cobbler/repo_mirror/ | yum倉庫存儲目錄 |
cobbler日志檔案
日志檔案路徑 | 說明 |
---|---|
/var/log/cobbler/installing | 用戶端安裝日志 |
/var/log/cobbler/cobbler.log | cobbler日志 |
部署
[root@localhost ~]# systemctl disable --now firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# vim /etc/selinux/config
[root@localhost ~]# reboot
[root@localhost ~]# setenforce 0
setenforce: SELinux is disabled
安裝dnf
[root@localhost ~]# yum -y install dnf
安裝epel源
[root@localhost ~]# yum -y install epel-release
安裝cobbler以及相關的軟體
[root@localhost ~]# yum -y install httpd dhcp-* tftp xinetd pykickstart
[root@localhost ~]# yum -y install module enable cobbler
檢視一下cobbler
[root@localhost ~]# yum list all|grep cobbler
cobbler.x86_64 2.8.5-0.3.el7 @epel
cobbler-web.noarch 2.8.5-0.3.el7 epel
[root@localhost ~]# yum -y install cobbler cobbler-web
啟動服務并設定開機自啟
[root@localhost ~]# systemctl enable --now httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable --now cobblerd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/cobblerd.service to /usr/lib/systemd/system/cobblerd.service.
[root@localhost ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 5 127.0.0.1:25151 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 :::80 :::*
LISTEN 0 128 :::22 :::*
LISTEN 0 100 ::1:25 :::*
LISTEN 0 128 :::443 :::*
将tftp和serverip設定為本機ip
[root@localhost ~]# sed -i 's/^server: 127.0.0.1/server: 192.168.145.188/' /etc/cobbler/settings.yaml
[root@localhost ~]# sed -i 's/^next_server: 127.0.0.1/next_server: 192.168.145.188/' /etc/cobbler/settings.yaml
下載下傳缺失檔案
[root@localhost ~]# cobbler get-loaders
task started: 2021-10-13_043247_get_loaders
task started (id=Download Bootloader Content, time=Wed Oct 13 04:32:47 2021)
running python triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
shell triggers finished successfully
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***
為cobbler提供發行版存放目錄及存儲庫檔案
[root@localhost ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/cobbler/loaders/
cp: overwrite '/var/lib/cobbler/loaders/pxelinux.0'? y
[root@localhost ~]# cp /usr/share/syslinux/menu.c32 /var/lib/cobbler/loaders/
cp: overwrite '/var/lib/cobbler/loaders/menu.c32'? y
重新開機服務
root@localhost ~]# systemctl restart cobblerd
修改配置檔案
[root@localhost cobbler]# vim settings
server: 192.168.145.149
next_server: 192.168.145.149
生成密碼
[root@localhost ~]# openssl passwd -1
Password:
Verifying - Password:
$1$tdfM4Jv1$ULGr7idAE9MEPTrFD0Uje/
配置檔案中修改生成的密碼
[root@localhost cobbler]# vim settings
default_password_crypted: "$1$tdfM4Jv1$ULGr7idAE9MEPTrFD0Uje/"
啟動rsyncd并設定開機自啟
[root@localhost cobbler]# systemctl enable --now rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
[root@localhost cobbler]# systemctl status rsyncd
● rsyncd.service - fast remote file copy program daemon
Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; enabled; vendor preset: disabled)
Active: active (running) since 三 2021-10-13 10:36:41 EDT; 12s ago
Main PID: 67465 (rsync)
CGroup: /system.slice/rsyncd.service
└─67465 /usr/bin/rsync --daemon --no-detach
10月 13 10:36:41 localhost.localdomain systemd[1]: Started fast remote file copy progr....
10月 13 10:36:41 localhost.localdomain systemd[1]: Starting fast remote file copy prog....
10月 13 10:36:41 localhost.localdomain rsyncd[67465]: rsyncd version 3.1.2 starting, l...3
Hint: Some lines were ellipsized, use -l to show in full.
重新開機一下cobblerd
[root@localhost ~]# systemctl restart cobblerd
[root@localhost cobbler]# vim /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no //yes 改成 no
per_source = 11
cps = 100 2
flags = IPv4
}
[root@localhost cobbler]# cobbler check //檢查一下錯誤問題
The following are potential configuration items that you may want to fix:
1 : 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.
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : 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.
第二個與第三個問題是關于debian系統的錯誤可以忽略
安裝包fence-agents解決第三個問題
[root@localhost cobbler]# yum -y install fence-agents
在CentOS8傳輸檔案到CentOS7中解決第一個問題
[root@localhost ~]# cd /var/lib/cobbler/loaders/
[root@localhost loaders]# ls
COPYING.syslinux README grub-x86_64.efi pxelinux.0
COPYING.yaboot grub-x86.efi menu.c32 yaboot
[root@localhost loaders]# scp -r /var/lib/cobbler/loaders [email protected]:/var/lib/cobbler/
[email protected]'s password:
README 100% 9339 9.6MB/s 00:00
COPYING.yaboot 100% 9339 8.5MB/s 00:00
COPYING.syslinux 100% 9339 5.9MB/s 00:00
yaboot 100% 9339 8.1MB/s 00:00
pxelinux.0 100% 41KB 26.0MB/s 00:00
menu.c32 100% 26KB 24.0MB/s 00:00
grub-x86.efi 100% 9339 11.8MB/s 00:00
grub-x86_64.efi 100% 9339 12.5MB/s 00:00
[root@localhost cobbler]# ls
config kickstarts lock snippets web.ss
distro_signatures.json loaders scripts triggers webui_sessions
[root@localhost cobbler]# ll
總用量 64
drwxr-xr-x 10 root root 143 10月 13 02:38 config
-rw-r--r-- 1 root root 50604 8月 30 2019 distro_signatures.json
drwxr-xr-x 3 root root 4096 10月 13 02:38 kickstarts
drwxr-xr-x 2 root root 157 10月 13 04:55 loaders
-rw-r--r-- 1 root root 0 10月 13 02:52 lock
drwxr-xr-x 2 root root 63 10月 13 02:38 scripts
drwxr-xr-x 2 root root 4096 10月 13 02:38 snippets
drwxr-xr-x 7 root root 72 10月 13 02:38 triggers
-rw------- 1 apache root 1024 10月 13 11:08 web.ss
drwx------ 2 apache root 6 10月 14 2019 webui_sessions
[root@localhost cobbler]# ls loaders/
COPYING.syslinux grub-x86_64.efi menu.c32 README
COPYING.yaboot grub-x86.efi pxelinux.0 yaboot
重新開機cobblerd同步一下
[root@localhost cobbler]# systemctl restart cobblerd
[root@localhost cobbler]# cobbler sync
task started: 2021-10-13_112435_sync
task started (id=Sync, time=Wed Oct 13 11:24:35 2021)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/grub/images
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
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
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 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 ***
[root@localhost cobbler]# vim settings
manage_dhcp: 1
[root@localhost cobbler]# vim dhcp.template
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.145.0 netmask 255.255.255.0 {
option routers 192.168.145.149;
option domain-name-servers 192.168.145.2;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.145.200 192.168.145.254;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
重新開機同步
[root@localhost cobbler]# systemctl restart cobblerd
[root@localhost cobbler]# cobbler sync
task started: 2021-10-13_113155_sync
task started (id=Sync, time=Wed Oct 13 11:31:55 2021)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
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 ***
安裝net-tools 檢視dhcp功能是否打開
[root@localhost cobbler]# yum -y install net-tools
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.njupt.edu.cn
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.njupt.edu.cn
* updates: mirrors.njupt.edu.cn
正在解決依賴關系
--> 正在檢查事務
---> 軟體包 net-tools.x86_64.0.2.0-0.25.20131004git.el7 将被 安裝
--> 解決依賴關系完成
依賴關系解決
===========================================================================================
Package 架構 版本 源 大小
===========================================================================================
正在安裝:
net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k
事務概要
===========================================================================================
安裝 1 軟體包
總下載下傳量:306 k
安裝大小:917 k
Downloading packages:
net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安裝 : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1
驗證中 : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1
已安裝:
net-tools.x86_64 0:2.0-0.25.20131004git.el7
完畢!
[root@localhost cobbler]# netstat -anulp|grep dhcp
udp 0 0 0.0.0.0:67 0.0.0.0:* 117078/dhcpd
挂載安裝CD光牒
[root@localhost ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 寫保護,将以隻讀方式挂載
[root@localhost ~]# ls /mnt/
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
導入
[root@localhost ~]# cobbler import --path=/mnt --name=centos-7 --arch=x86_64
task started: 2021-10-13_114833_import
task started (id=Media import, time=Wed Oct 13 11:48:33 2021)
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 ***
檢視
[root@localhost cobbler]# cobbler list
distros:
centos-7-x86_64
profiles:
centos-7-x86_64
systems:
repos:
images:
mgmtclasses:
packages:
files:
生成檔案
[root@localhost ~]# cat > /var/lib/cobbler/kickstarts/rhel-7-x86_64.ks <<'EOF'
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.145.149/cobbler/ks_mirror/rhel-7-x86_64
$yum_repo_stanza
reboot
rootpw --iscrypted $6$2WTFvfNvAMgCUPuC$MJgWGzhakgxrRObcEbAwSe8vkz0s//xyiTllGwxRsHHruQhcskO69u2LVTU9u0eemHXH2pzcGawyAJ54R2E/x0
selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr
%packages
@^minimal
@core
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
EOF
修改名字
[root@localhost cobbler]# cd /var/lib/cobbler/kickstarts/
[root@localhost kickstarts]# mv rhel-7-x86_64.ks centos-7-x86_64.ks
[root@localhost kickstarts]# ls
centos-7-x86_64.ks install_profiles sample_end.ks sample_esxi6.ks sample.seed.28
default.ks legacy.ks sample_esx4.ks sample.ks
esxi4-ks.cfg pxerescue.ks sample_esxi4.ks sample_old.seed
esxi5-ks.cfg sample_autoyast.xml sample_esxi5.ks sample.seed
把anaconda-ks.cfg裡面的密碼替換centos-7-x86_64.ks裡的密碼
[root@localhost ~]# vim anaconda-ks.cfg
# Root password
rootpw --iscrypted $6$lhC7jSt4gX8hWhza$yVoq4SRtV/QKvFdFK9DI0uODI7K.7alKhkLnZPWDERJNXWTrLlCnXIjcVWKIiBIc9B86XwgUA7zj8ngCfHG9d.
[root@localhost kickstarts]# vim centos-7-x86_64.ks
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.145.149/cobbler/ks_mirror/centos-7-x86_64 //告訴它檔案的位置
$yum_repo_stanza
reboot
rootpw --iscrypted $6$lhC7jSt4gX8hWhza$yVoq4SRtV/QKvFdFK9DI0uODI7K.7alKhkLnZPWDERJNXWTrLlCnXIjcVWKIiBIc9B86XwgUA7zj8ngCfHG9d.
selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr
%packages
@^minimal
@core
kexec-tools
%end
文法檢查
[root@localhost kickstarts]# cobbler validateks
task started: 2021-10-13_121044_validateks
task started (id=Kickstart Validation, time=Wed Oct 13 12:10:44 2021)
----------------------------
osversion: rhel7
checking url: http://192.168.145.149/cblr/svc/op/ks/profile/centos-7-x86_64
running: /usr/bin/ksvalidator -v "rhel7" "http://192.168.145.149/cblr/svc/op/ks/profile/centos-7-x86_64"
received on stdout:
received on stderr:
*** all kickstarts seem to be ok ***
*** TASK COMPLETE ***
檢視配置檔案
[root@localhost kickstarts]# cobbler profile list
centos-7-x86_64
修改profile,将我們建立的ks檔案設為預設的kickstarts安裝檔案
[root@localhost kickstarts]# cobbler profile edit --name centos-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos-7-x86_64.ks
配置網卡名稱為傳統網卡名稱eth0
[root@localhost kickstarts]# cobbler profile edit --name centos-7-x86_64 --kopts='net.ifnames=0 biosdevname=0'
[root@localhost kickstarts]# cobbler profile report
DHCP Tag : default
Distribution : centos-7-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {'biosdevname': '0', 'net.ifnames': '0'}
Kernel Options (Post Install) : {}
同步
[root@localhost kickstarts]# cobbler sync
task started: 2021-10-13_121906_sync
task started (id=Sync, time=Wed Oct 13 12:19:06 2021)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/centos-7-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/centos-7-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: centos-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos-7-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: centos-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/centos-7-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos-7-x86_64/initrd.img
Writing template files for centos-7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: centos-7-x86_64
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 ***
重新開機服務
[root@localhost kickstarts]# systemctl restart xinetd
[root@localhost kickstarts]# systemctl restart httpd
[root@localhost kickstarts]# systemctl restart cobblerd
pxelinux.0 和menu.c32 這兩個檔案要用系統自帶的,不能用從centos8那邊複制過來的
[root@localhost ~]# cd /var/lib/cobbler/loaders/
[root@localhost loaders]# ls
COPYING.syslinux grub-x86_64.efi menu.c32 README
COPYING.yaboot grub-x86.efi pxelinux.0 yaboot
[root@localhost loaders]# find / -name pxelinux.0
/var/lib/tftpboot/pxelinux.0
/var/lib/cobbler/loaders/pxelinux.0
/usr/share/syslinux/pxelinux.0
[root@localhost loaders]# ll pxelinux.0 /usr/share/syslinux/pxelinux.0
-rw-r--r-- 2 root root 42376 10月 13 04:55 pxelinux.0
-rw-r--r-- 1 root root 26759 10月 30 2018 /usr/share/syslinux/pxelinux.0
[root@localhost loaders]# \cp /usr/share/syslinux/pxelinux.0 .
[root@localhost loaders]# ll pxelinux.0
-rw-r--r-- 2 root root 26759 10月 13 12:44 pxelinux.0
[root@localhost loaders]# find / -name menu.c32
/var/lib/tftpboot/menu.c32
/var/lib/cobbler/loaders/menu.c32
/usr/share/syslinux/menu.c32
[root@localhost loaders]# ll /usr/share/syslinux/menu.c32 menu.c32
-rw-r--r-- 2 root root 26272 10月 13 04:55 menu.c32
-rw-r--r-- 1 root root 55140 10月 30 2018 /usr/share/syslinux/menu.c32
[root@localhost loaders]# \cp /usr/share/syslinux/menu.c32 menu.c32
[root@localhost loaders]# ll /usr/share/syslinux/menu.c32 menu.c32
-rw-r--r-- 2 root root 55140 10月 13 12:45 menu.c32
-rw-r--r-- 1 root root 55140 10月 30 2018 /usr/share/syslinux/menu.c32
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsISPrdEZwZ1Rh5WNXp1bwNjW1ZUba9VZwlHdsATOfd3bkFGazxCMx8VesATMfhHLlN3XnxCMwEzX0xiRGZkRGZ0Xy9GbvNGLpZTY1EmMZVDUSFTU4VFRR9Fd4VGdsYTMfVmepNHLrJXYtJXZ0F2dvwVZnFWbp1zczV2YvJHctM3cv1Ce-cmbw5yM4QjMxMzMmNzN1AzMmdjNxYzXzEjNwcTM0EzLcBTMxIDMy8CXn9Gbi9CXzV2Zh1WavwVbvNmLvR3YxUjLyM3Lc9CX6MHc0RHaiojIsJye.png)
定制安裝
定制安裝步驟:
統計伺服器mac位址 配置cobbler 安裝
在 cobbler 的web界面上配置:
注:賬号與密碼都是cobbler
啟動直接安裝跳過藍屏界面