Cobbler是一個快速安裝Linux系統的網絡安裝服務套件,集成了PXE、DHCP、DNS/Kickstart服務管理和yum倉庫管理工具,通過PXE網絡引導安裝,配置簡單。
部署准備:
關閉防火牆:service iptablesstop
關閉selinux:setenforce 0
安裝epel源:rpm -ivh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
1、安裝相關軟件
[root@localhost ~]# yum install -y cobbler tftp dhcp httpdcman pykickstart
2、配置tftp-server和rsync
[root@localhost ~]# vi /etc/xinetd.d/tftp
disable = no #開啟
[root@localhost ~]# vi /etc/xinetd.d/rsync
disable = no
[root@localhost ~]# /etc/init.d/xinetd restart
3、配置DHCP
[root@localhost ~]# vi /etc/dhcp/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
range dynamic-bootp192.168.0.200 192.168.0.210;
optionbroadcast-address 192.168.0.254;
option routers192.168.0.1;
optiondomain-name-servers 192.168.0.1;
default-lease-time600;
max-lease-time 7200;
filename "pxelinux.0";
next-server192.168.0.202;
}
[root@localhost ~]# /etc/init.d/dhcpd restart
4、執行檢查,修改提示問題
1>.修改/etc/cobbler/settings裡cobbler server地址
2>.修改/etc/cobbler/settings裡next_server地址
3>.執行cobbler get-loaders,下載loader程序
4>.提示沒有安裝debmirror,如果不是debian類的系統可忽略
5>.修改cobbler用戶默認密碼,然後替換/etc/cobbler/settings中的密碼
生成密碼:openssl passwd -1-salt '1234.com' '123.com'
#1234.com是干擾碼,用於加在密文中。123.com是安裝新系統root密碼
替換密文:default_password_crypted:"$1$1234.com$P8CiR10xiKXSQKJwofdsh0"
6>.執行cobbler sync命令,讓cobbler接管服務,應用配置
[root@localhost ~]# /etc/init.d/cobblerd restart
5、修改cobbler配置文件讓cobbler來管理相關服務
[root@localhost ~]# vi /etc/cobbler/settings
manage_dhcp: 1
manage_tftpd: 1
manage_rsync: 1
pxe_just_once: 1
6、導入CentOS系統
先可以掛載iso鏡像,從光驅中導入cobbler:
[root@localhost ~]# mount -o loop RHEL-server-6.0-i386-dvd.iso /media
[root@localhost ~]# cobbler import -path=/media --name=rhel6
7、通過cobbler list查看現在的鏡像,通過測試機開機設置網絡啟動,實現無人值守安裝