主頁(yè) > 知識(shí)庫(kù) > 利用Kickstart自動(dòng)化安裝CentOS的教程

利用Kickstart自動(dòng)化安裝CentOS的教程

熱門標(biāo)簽:北京地圖標(biāo)注平臺(tái)注冊(cè)入駐 臨沂語(yǔ)音電話機(jī)器人公司 用什么軟件做地圖標(biāo)注 長(zhǎng)沙呼叫中心外呼系統(tǒng)穩(wěn)定嗎 騰沖銷售外呼管理系統(tǒng)服務(wù) 洛陽(yáng)外呼增值業(yè)務(wù)線路解決方案 昆明crm外呼系統(tǒng)價(jià)格 電銷機(jī)器人自動(dòng)撥號(hào)信息 400電話申請(qǐng)安裝

前言

因?yàn)樾枰诶顺钡膞86服務(wù)器中集中部署CentOS搭建基于Hadoop的大數(shù)據(jù)平臺(tái),平時(shí)接觸SLES(SuSE Linux Enterprise Server)較多并且已經(jīng)實(shí)現(xiàn)基于Autoyast方式使用光盤或者PXE網(wǎng)絡(luò)自動(dòng)化安裝(后續(xù)會(huì)分享具體實(shí)現(xiàn)方法)。這次主要通過學(xué)習(xí)Kisckstart實(shí)現(xiàn)最簡(jiǎn)單的光盤方式自動(dòng)化安裝CentOS,而網(wǎng)上的大多數(shù)教程并不完全適用于自身的環(huán)境,本文將不再贅述Kickstart相關(guān)概念,細(xì)節(jié)可參考擴(kuò)展閱讀。

    Kickstart是最為通用的Linux自動(dòng)化安裝方法之一

環(huán)境準(zhǔn)備
定制系統(tǒng)

    CentOS-6.4-x86_64

官方下載地址 - http://wiki.centos.org/Download
安裝軟件包

    代理上網(wǎng)小技巧,export http_proxy=ip:port

   

復(fù)制代碼
代碼如下:
yum -y install createrepo mkisofs

制作流程
目錄結(jié)構(gòu)

    拷貝CentOS原始鏡像內(nèi)容,不做任何精簡(jiǎn)

   

復(fù)制代碼
代碼如下:
mkdir /mnt/centos
mount /dev/sr0 /mnt/centos
mkdir /tmp/iso
cp -r /mnt/centos/* /tmp/iso

增加Kickstart配置文件

    文件路徑和安裝方式可自由定義

   

復(fù)制代碼
代碼如下:
cd /tmp/iso/isolinux
#修改引導(dǎo),注意ks=部分
vi isolinux.cfg
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg
#手動(dòng)增加Kickstart配置文件
vi ks.cfg/p> p> #Kickstart file automatically generated by anaconda.
#version=DEVEL
#Install OS instead of upgrade
#表示是安裝,而不是升級(jí)
install
#Use text mode install
#文本方式安裝
text
#Use network installation
#使用網(wǎng)絡(luò)安裝
#url --url=ftp://ip/centos
#Local installation Use CDROM installation media
#使用光盤安裝
cdrom
#Installation Number configuration
#如果是RedHat的系統(tǒng),會(huì)要求輸入key,這里配置為跳過,如果不配置安裝時(shí)會(huì)停在那里要求用戶輸入key
#key –skip
#System language
#語(yǔ)言環(huán)境
#lang en_US.UTF-8
lang zh_CN.UTF-8
#System keyboard
#鍵盤類型
keyboard us
#Network information
#網(wǎng)絡(luò)配置
#network --device eth0 --bootproto dhcp --onboot yes
#Root password
#root密碼
rootpw chinaums
#Firewall configuration
#禁用防火墻
firewall --disabled
#SELinux configuration
#禁用selinux
selinux --disabled
#Run the Setup Agent on first boot
#禁用第一次啟動(dòng)時(shí)設(shè)置系統(tǒng)的向?qū)?br /> firstboot --disable
#System authorization information
#用戶認(rèn)證配置,useshadow表示使用本地認(rèn)證,--passalgo表示密碼加密算法
authconfig --enableshadow --passalgo=sha512
#System timezone
#設(shè)置時(shí)區(qū)為上海
timezone --isUtc Asia/Shanghai
#System bootloader configuration
#指明bootloader的安裝位置,指明驅(qū)動(dòng)器的排序,指明操作系統(tǒng)安裝完成之后,向內(nèi)核傳遞的參數(shù)
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
#Clear the Master Boot Record
#清除MBR引導(dǎo)記錄
zerombr yes
#Partition clearing information
#清除硬盤上的所有數(shù)據(jù)
clearpart --all --initlabel
#Disk partitioning information
#自定義分區(qū)
#創(chuàng)建一個(gè)200M大小的分區(qū)掛載/boot類型為ext4
part /boot --fstype=ext4 --size=200 --ondisk=sda
#創(chuàng)建一個(gè)20000M大小的SWAP分區(qū)
part swap --size=20000 --ondisk=sda
#創(chuàng)建/目錄
part / --fstype=ext4 --grow --size=1 --ondisk=sda
#Reboot after installation
#設(shè)置完成之后重啟
reboot --eject
#This packages is for CentOS 6.4
#為CentOS 6.4定制的軟件包
%packages
@base
@core
@chinese-support
#增加安裝后運(yùn)行腳本
%post
#config service
#自定義服務(wù)
service NetworkManager stop
chkconfig NetworkManager off
#eject cdrom
#安裝完成彈出光碟
#eject
#reboot
#執(zhí)行完畢后重啟
#reboot -f
#結(jié)束自動(dòng)化部署
%end

生成依賴關(guān)系和ISO文件

    注意路徑和命令的準(zhǔn)確性

   

復(fù)制代碼
代碼如下:
cd /tmp/iso
createrepo -g repodata/*comps.xml .
mkisofs -o /tmp/CentOS-6.4_64_auto.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -joliet-long -R -J -v -T /tmp/iso/

標(biāo)簽:南充 通化 遼寧 昌都 三亞 涼山 濰坊 汕頭

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《利用Kickstart自動(dòng)化安裝CentOS的教程》,本文關(guān)鍵詞  利用,Kickstart,自動(dòng)化,安裝,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《利用Kickstart自動(dòng)化安裝CentOS的教程》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于利用Kickstart自動(dòng)化安裝CentOS的教程的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章