為了玩RHEL5 cluster方便安裝,順便玩了一下kickstart大量佈署方式安裝系統
參考文件:
1.鳥哥網站的網友分享篇裡面彥明大的幾篇文章
2.CentOS官網
設定方式如下:
1.DHCP server (如已有可跳過)
# cp /usr/share/doc/dhcp-3.0pl2/dhcpd.conf.sample /etc/dhcpd.conf
# more /etc/dhcpd.conf 內容如下根據自己需求更改
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200; |
#/etc/init.d/dhcpd restart
#chkconfig dhcpd on
2.準備install server (建議與DHCP server放一起,可以再建立yum)
可以使用http,ftp,nfs方式來作,我測試以ftp為主,可以設定帳密來登入:
#yum install vsftpd
#chkconfig vsftpd on
#/etc/init.d/vsftpd restart (預設有開匿名登入,可根據自己需求調整)
#mount -t iso9660 -o loop CentOS.iso /mnt (放光碟或mount ISO)
#mkdir /var/ftp/pub/CentOS (建立資料夾)
#cp -av /mnt/. /var/ftp/pub/CentOS (將安裝資料放到ftp)
#yum install system-config-kickstart (設定kickstart參數的gui)
#system-config-kickstart (設定安裝相關資料)
在GUI畫面下設定完成後選file → save 可存成一個自動安奘的文字檔
我的設定如下
#platform=x86, AMD64, or Intel EM64T # System authorization information auth --useshadow --enablemd5 # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Use graphical install graphical # Firewall configuration firewall --enabled --ssh --trust=eth0 # Run the Setup Agent on first boot #firstboot --enable # System keyboard keyboard us # System language lang zh_TW.UTF-8 #Language modules to install langsupport en_US --default=zh_TW.UTF-8 # Installation logging level logging --level=info # Use network installation url --url=ftp://10.101.20.244/pub/mnt # Network information network --bootproto=dhcp --device=eth0 --onboot=on # Reboot after installation reboot #Root password rootpw --iscrypted $1$FZr8YqVs$W4ykp.eMFp97IIkE8xIvn. # SELinux configuration selinux --disabled # System timezone timezone Asia/Taipei # Install OS instead of upgrade install # X Window System configuration information xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600 --startxonboot # Disk partitioning information part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100 part swap --bytes-per-inode=4096 --fstype="swap" --size=2048 part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1 %packages @chinese-support @office @editors @text-internet @gnome-desktop @dialup @core @base @games @base-x @graphics @printing @sound-and-video @graphical-internet device-mapper-multipath xorg-x11-server-Xnest libsane-hpaio -sysreport |
將此檔案跟開機光碟燒在一起,也可以放在ftp上
3.安裝:
放入做好之開機光碟,開機
執行:
linux ks=/cdrom
or
linux ks=ftp://10.101.20.244/pub/ks.cfg
(將檔案放在ftp上)
這樣應該會自己安裝好嚕
kickstart檔案內容可參考:http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-kickstart2-file.html