無dhcp環境應用kickstart

來源:互聯網
上載者:User

標籤:linux kickstart

伺服器配置基本不會用dhcp來分配IP,而且在生產環境中配置dhcp和pxe可能導致一些意外的自動重裝。

因此,可能需要在無dhcp和pxe的環境中應用kickstart,測試了一下,可以通過以下的方法來實現


編輯kickstart配置,不過多描述,可以在安裝好的系統root目錄中找到anaconda.cfg,在此基礎上稍加編輯即可。主要需要注意以下幾點

1、因為沒有dhcp環境,所以IP將在啟動安裝之前設定,此處不能設定network。靜態地址和dhcp都不合適(靜態地址k出來都是同一個IP);

2、安裝源指定為本地yum源,http、ftp都可以;

3、anaconda的分區資訊是被注釋掉的,記得重新開啟;

4、一些固定格式的內容需要取消,比如硬碟可能固定為sda,網卡可能固定為eth0,盡量避免。

以下是精簡的kickstart樣本設定檔。

# Kickstart file automatically generated by anaconda.#version=DEVELinstalltextlang en_US.UTF-8keyboard us#network --bootproto dhcp --hostname localhost.localdomainurl --url http://172.x.x.x/yum/centos/x86_64/6.4rootpw  --iscrypted $6$s7PpNjSEDPHDq2aw$g/UMGRhVV9wcOj19QYWPXSZO1RCKEVEZdXJyZiEGARM.NAGw1EF2e3Sf.lFtPrg8J1S7FCGYl4vR4qlFqcSWk.firewall --disabledzerombrrebootskipxauthconfig --enableshadow --passalgo=sha512selinux --disabledtimezone --utc Asia/Shanghaibootloader --location=mbr --append="crashkernel=auto rhgb quiet"# The following is the partition information you requested# Note that any partitions you deleted are not expressed# here so unless you clear all partitions first, this is# not guaranteed to workclearpart --allpart /boot --fstype=ext4 --size=200part pv.01 --size=3000 --grow volgroup vgs pv.01logvol / --fstype=ext4 --name=lv_root --vgname=vgs --size=1000 --growlogvol swap --name=lv_swap --vgname=vgs --size=1000 --maxsize=2000repo --name="CentOS64" --baseurl=http://172.x.x.x/yum/centos/x86_64/6.4%packages@base#@console-internet#@core#@debugging#@directory-client#@hardware-monitoring#@java-platform#@large-systems#@network-file-system-client#@performance#@perl-runtime#@server-platform#@server-policy#pax#oddjob#sgpio#device-mapper-persistent-data#samba-winbind#certmonger#pam_krb5#krb5-workstation#perl-DBD-SQLite%end%post --log /root/ks-post.logrm -f /etc/yum.repos.d/*.repowget http://172.30.0.19/yum/repo/centos64.repo -O /etc/yum.repos.d/centos64.repochkconfig abrt-ccpp offchkconfig abrtd offchkconfig atd offchkconfig auditd offchkconfig blk-availability offchkconfig lvm2-monitor offchkconfig mdmonitor off%end


通過光碟片引導,在啟動介面,按tab鍵,輸入安裝命令,指定固定IP、掩碼、網關、DNS,以及kickstart設定檔,這裡的網路設定將被設定到安裝好的系統中。

initrd=initrd.img ks=http://172.x.x.x/test.cfg noipv6 ip=172.x.x.x netmask=x.x.x.x gateway=172.x.x.x dns=172.x.x.x


坐等系統安裝完畢。



本文出自 “foolishfish” 部落格,請務必保留此出處http://foolishfish.blog.51cto.com/3822001/1536534

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.