无人值守自动装机
系統(tǒng)Centos?6.5?x86_64
ip:192.168.1.201
?
測(cè)試所需設(shè)備:(注意自己的dhcp網(wǎng)段修改,還有ip地址)
1.DHCP?服務(wù)器?
2.TFTP?服務(wù)器?
3.KickStart所生成的ks.cfg配置文件?
4.一臺(tái)存放系統(tǒng)安裝文件的服務(wù)器,如?NFS、HTTP?或?FTP?服務(wù)器,本文選擇HTTP進(jìn)行
5.帶有一個(gè)?PXE?支持網(wǎng)卡的將安裝的主機(jī)
?
?
1、安裝相應(yīng)的軟件包
# yum install httpd tftp-server system-config-kickstart dhcpsyslinux -y
掛載CentOS6.5的DVD光盤,并復(fù)制第一張光盤下的所有內(nèi)容到/var/www/html/centos6/
# mkdir?-p?/var/www/html/centos6
# mount?-r /dev/cdrom?/mnt
# cp?-rf?/mnt/*?/var/www/html/centos6
?
2、配置tftp,啟動(dòng)http、tftp服務(wù)
# vim?/etc/xinetd.d/tftp
#?default:?off
#?description:?The?tftp?server?serves?files?using?the?trivial?file?transfer?\
#protocol.The?tftp?protocol?is?often?used?to?boot?diskless?\
#workstations,?download?configuration?files?to?network-aware?printers,?\
#and?to?start?the?installation?process?for?some?operating?systems.
service?tftp
{
socket_type=?dgram
protocol=?udp
wait=?yes
user=?root
server=?/usr/sbin/in.tftpd
server_args=?-s?/tftpboot
disable=?no
per_source=?11
cps=?100?2
flags=?IPv4
}
?
3、配置dhcp
# vim /etc/dhcp/dhcpd.conf
#dhcpd.conf
optiondomain-name "cnlinux.com";
optiondomain-name-servers 114.114.114.114;
default-lease-time86400;
max-lease-time86400;
log-facilitylocal7;
subnet192.168.1.0 netmask 255.255.255.0 {
?? range 192.168.1.240 192.168.1.250;
?? option routers 192.168.1.1;
?? filename "pxelinux.0";
?? next-server 192.168.1.202;
}
?
4、配置支持PXE啟動(dòng)
# mkdir?-p?/tftpboot/pxelinux.cfg
# cp /usr/share/syslinux/pxelinux.0? /tftpboot/
# cd?/mnt/p_w_picpaths/pxeboot/;cp?initrd.img?vmlinuz?/tftpboot
# cp /mnt/isolinux/boot.msg?/tftpboot/
# cp /mnt/isolinux/vesamenu.c32? /tftpboot/
# cp /mnt/isolinux/splash.jpg?/tftpboot/
# cp /mnt/isolinux/isolinux.cfg/tftpboot/pxelinux.cfg/default
# service?dhcpd?restart
# service?xinetd?restart
# service?httpd?restart
# chkconfig?--level?35?httpd?on
# chkconfig?--level?35?dhcpd?on
# chkconfig?--level?35?xinetd?on
?
關(guān)閉selinux
# setenforce 0
# sed -i "s@SELINUX=enforcing@SELINUX=disabled@g"/etc/sysconfig/selinux
?
?
關(guān)閉iptables
# /etc/init.d/iptables stop
# chkconfig iptables off
?
# vim?/tftpboot/pxelinux.cfg/default
default linux
#prompt 1
timeout 600
display boot.msg
menu background splash.jpg
menu title Welcome to CentOS 6.7!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff#00000000
label linux
menu label ^Install or upgrade anexisting system
menu default
kernel vmlinuz
append initrd=initrd.imgks=http://192.168.1.201/centos6/ks.cfg
label vesa
menu label Install system with ^basicvideo driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesanomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
label memtest86
menu label ^Memory test
kernel memtest
append -
?
# vim?/var/www/html/centos6/ks.cfg
install
text
url --url http://192.168.1.201/centos6
lang en_US.UTF-8
keyboard us
network --onboot no --device eth0--bootproto dhcp --noipv6
970823
firewall --disabled
authconfig --enableshadow--passalgo=sha512
selinux --disabled
timezone Asia/Shanghai
bootloader --location=mbr--driveorder=sda --append="crashkernel=auto rhgb quiet"
clearpart --all --initlabel
zerombr yes
part /boot --fstype=ext4 --size=200
part / --fstype=ext4 --grow --size=1
part swap --size=2000
%packages
@core
@server-policy
@workstation-policy
%end
reboot
最后構(gòu)建一臺(tái)服務(wù)器,會(huì)自動(dòng)裝機(jī)。
下圖是在安裝途中的。
下面是安裝成功后 ?自動(dòng)重啟 然后輸入密碼登入的機(jī)器
轉(zhuǎn)載于:https://blog.51cto.com/lantern/1877138
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
- 上一篇: jQuery刻度尺滚动滑块插件
- 下一篇: iOS开发基础知识--碎片27