RHEL系统网络安装(kikstart)
???? 在批量安裝相同配置的LINUX服務(wù)器系統(tǒng)時(shí),可以借助GHOST、再生龍、kikstart等工具通過網(wǎng)絡(luò)來進(jìn)行批量安裝。本文主要講配置紅帽5系(包含RHEL5.1-5.5及CentOS5.1-5.5)操作系統(tǒng)kikstart網(wǎng)絡(luò)安裝服務(wù)器的步驟及配置文件。注:做kikstart的服務(wù)器只能有一個(gè)正常使用的網(wǎng)絡(luò)(雙網(wǎng)卡機(jī)器請(qǐng)拔出一根不使用的網(wǎng)線),在kikstart的網(wǎng)絡(luò)中只能由該服務(wù)器提供DHCP。
?1、???????????配置可用于網(wǎng)絡(luò)啟動(dòng)的DHCP服務(wù)器
安裝包:dhcpd
編譯配置文件:vi /etc/dhcpd.conf
配置范例:
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
class "pxeclients"{
???????match if substring(optionvendor-class-identifier,0,9) = "PXEClient";
???????filename "pxelinux.0";
???????next-server 192.168.1.170;????????????????????? #TFTP服務(wù)器的IP。
}
subnet 192.168.1.0 netmask 255.255.255.0 {
???????option routers 192.168.1.251;?????? ??????????????????? #網(wǎng)關(guān)
???????option subnet-mask 255.255.255.0;?????????????? #子網(wǎng)掩碼。
???????option nis-domain "xt.cn";????????????????????? #NIS域。
???????option domain-name "xt.cn";??????????????????? #域。
???????option domain-name-servers 61.139.2.69;????????? #DNS服務(wù)器。
???????option time-offset -18000;
???????range dynamic-bootp 192.168.1.128 192.168.1.254;? #DHCP可分配的IP地址池。
???????default-lease-time 21600;
???????max-lease-time 43200;
}
?
?????? 開啟DHCP服務(wù)并設(shè)為開機(jī)自動(dòng)啟動(dòng):
service dhcpd restart
chkconfig dhcpd on
?????? 注:可通過servicedhcpd configtest命令查看DHCP配置是否有錯(cuò)。
?
2、???????????配置用于文件傳輸?shù)腡FTP服務(wù)器
安裝包:tftp
開啟服務(wù)并設(shè)為開機(jī)自動(dòng)啟動(dòng):
chkconfig tftp on
service xinetd restart
?????? 拷貝相關(guān)啟動(dòng)文件:
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
mkdir /tftpboot/pxelinux.cfg
mount -o loop RHEL5dvd.iso/mnt
cp /mnt/isolinux/isolinux.cfg/tftpboot/pxelinux.cfg/default
cp /mnt/p_w_picpaths/pxeboot/initrd.img/tftpboot/
cp /mnt/p_w_picpaths/pxeboot/vmlinuz /tftpboot/
cp /mnt/isolinux/*.msg /tftpboot
編輯默認(rèn)啟動(dòng)文件:vi/tftpboot/pxelinux.cfg/default
default local
prompt 1
timeout 600
display boot.msg
F1 boot.msg
。。。。。。。。。。
label memtest86
kernel memtest
append -
label autorhel
kernel vmlinuz
append ks=nfs:192.168.1.170:/export/ks/autorhel.cfg initrd=initrd.img
?????? 編輯啟動(dòng)菜單:vi/tftpboot/boot.msg
^L
^Xsplash.lss
- To install or upgrade in graphical mode,press the ^O01<ENTER>^O07key.
- To install or upgrade in text mode, type:^O01linux text <ENTER>^O07.
- To install or upgrade ,type: ^O01autorhel <ENTER>^O07.
- Use the function keys listed below formore information.
^O0f[F1-Main][F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]^O07
?
注:上邊3個(gè)綠色的“autorhel”必須統(tǒng)一,并且安裝鏡像(ISO文件)也必須更名為“autorhel”。
?
3、???????????配置用于共享安裝腳本的NFS服務(wù)器
編輯配置文件:vi /etc/exports
配置范例:/export *(ro,sync)
配置完過后拷貝安裝介質(zhì)(ISO文件)到/export/文件夾內(nèi),并重命名為autorhel。
注:/export/文件夾內(nèi)的所有內(nèi)容推薦開啟777的權(quán)限。(chmod 777 *)
開啟和設(shè)置自啟動(dòng):
chkconfig nfs on
service nfs restart
?
4、???????????配置用于確定安裝參數(shù)的kickstart文件
Kikstart配置文件確定了操作系統(tǒng)安裝的各項(xiàng)參數(shù),如軟件包的選擇、安全設(shè)置、分區(qū)、密碼等,可以通過system-config-kickstart命令開啟圖形化配置界面,也可以將/root/ anaconda.cfg文件根據(jù)需要修改并重命名為autorhel.cfg并拷貝到/export/ks/文件夾內(nèi),最后直接vi/export/ks/autorhel.cfg并將下文去掉中文注釋拷貝進(jìn)去然后保存。
配置范例(紅帽5.4 x64無序列號(hào)安裝并選擇所有包):
install
nfs --server=192.168.1.170--dir=/export?? #設(shè)置NFS服務(wù)器IP地址和目錄。
lang en_US.UTF-8
keyboard us
key --skip
network --device eth0 --bootproto dhcp
xconfig --startxonboot
firewall --disabled
rootpw --iscrypted $1$NoTGnoGk$gryS4OSJRY2uWrG4.XZCp1? #設(shè)置root密碼為111111,該效驗(yàn)碼由紅帽生成,并含有部分軟件版本信息。
selinux --disabled
authconfig --enableshadow --enablemd5
timezone Asia/Shanghai
bootloader --location=mbr
clearpart --all
part /boot ?--fstype="ext3" --size=100?? ?#設(shè)置boot分區(qū)大小為100M。
part / ?--fstype="ext3" --size=100 --grow? #設(shè)置/分區(qū)大小為100M以上,根據(jù)剩余空間分配。
part swap ?--fstype="swap" --size=1024 ??#設(shè)置swap為1024M。在分區(qū)部分由于涉及到單位換算(1G=1024M)的問題,所以請(qǐng)適當(dāng)分區(qū)!
reboot
%packages
@admin-tools
@base
@chinese-support
@core
@development-libs
@development-tools
@dialup
@editors
@gnome-desktop
@gnome-software-development
@graphical-internet
@graphics
@legacy-software-support
@office
@printing
@text-internet
@web-server
@x-software-development
@base-x
kexec-tools
fipscheck
device-mapper-multipath
sgpio
imake
emacs
libsane-hpaio
mesa-libGLU-devel
xorg-x11-utils
xorg-x11-server-Xnest
xorg-x11-server-Xvfb
?
5、總結(jié):
Kikstart網(wǎng)絡(luò)安裝服務(wù)器能快速方便的部署相同配置的多臺(tái)服務(wù)器。由于是一種通過網(wǎng)絡(luò)安裝操作系統(tǒng)的過程,需要重起服務(wù)器進(jìn)入PXE網(wǎng)卡啟動(dòng),然后輸入autorhel這個(gè)選項(xiàng)并回車,最后還需要確認(rèn)一下刪除硬盤以前所有的數(shù)據(jù)。Kikstart安裝的更多問題可以直接電話或QQ咨詢本人。同時(shí),有需要的朋友可以直接找我定制相應(yīng)的kikstart文件。
?
轉(zhuǎn)載于:https://blog.51cto.com/sclijq/1060171
總結(jié)
以上是生活随笔為你收集整理的RHEL系统网络安装(kikstart)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 批量调整word表格根据窗口调整内容
- 下一篇: 优秀员工与普通员工