|
Foreword
Because the need to focus on the deployment of CentOS to build Hadoop-based big data platform in the wave of x86 servers, usually contact SLES (SUSE Linux Enterprise Server) and more has been achieved using a CD or PXE-based network automation installation Autoyast way (follow-up will share specific method ). This is mainly achieved by learning Kickstart easiest way to automate the installation CD CentOS, and most online tutorial is not fully applicable to its environment, this article will not go into Kickstart concepts, details refer to further reading.
Kickstart Linux is one of the most versatile automated installation method
Preparing the Environment
Custom Systems
CentOS-6.4-x86_64
Installation package
Proxy Internet Tips: export http_proxy = ip: port
yum -y install createrepo mkisofs
Production Process
Directory Structure
CentOS mirror copy of the original content, without any streamlining
mkdir / mnt / centos
mount / dev / sr0 / mnt / centos
mkdir / tmp / iso
cp -r / mnt / centos / * / tmp / iso
Increase Kickstart configuration file
File paths and installation can be freely defined
cd / tmp / iso / isolinux
# Modify the boot, watch portions 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
Kickstart configuration file manually increase #
vi ks.cfg
#Kickstart File automatically generated by anaconda.
# Version = DEVEL
#Install OS instead of upgrade
# Indicates the installation, not an upgrade
install
#Use Text mode install
# Text mode installation
text
#Use Network installation
# Use network installation
#url --url = ftp: // ip / centos
#Local Installation Use CDROM installation media
# Use the installation CD-ROM
cdrom
#Installation Number configuration
# If the RedHat system, will be asked to enter the key, here, is configured to skip, it will stop if you do not configure the installation where the user enters key requirements
#key -skip
#System Language
# Locales
#lang en_US.UTF-8
lang zh_CN.UTF-8
#System Keyboard
# Keyboard Type
keyboard us
#Network Information
# Network configuration
#network --device eth0 --bootproto dhcp --onboot yes
#Root Password
#root password
rootpw chinaums
#Firewall Configuration
# Disable the firewall
firewall --disabled
#SELinux Configuration
# Disable selinux
selinux --disabled
#Run The Setup Agent on first boot
# Disable When you first start the system settings wizard
firstboot --disable
#System Authorization information
# Configure user authentication, useshadow indicates local authentication, - passalgo the password encryption algorithm
authconfig --enableshadow --passalgo = sha512
#System Timezone
# Set the zone to Shanghai
timezone --isUtc Asia / Shanghai
#System Bootloader configuration
Parameters specified bootloader installation location #, followed by the specified drive sorting, indicating the operating system is installed, passed to the kernel
bootloader --location = mbr --driveorder = sda --append = "crashkernel = auto rhgb quiet"
#Clear The Master Boot Record
# Clear MBR boot record
zerombr yes
#Partition Clearing information
# Erase all data on the hard disk
clearpart --all --initlabel
#Disk Partitioning information
# Custom Partitioning
# Create a 200M size of the partition mounted / boot type as ext4
part / boot --fstype = ext4 --size = 200 --ondisk = sda
# 20000M create a SWAP partition size
part swap --size = 20000 --ondisk = sda
# Create / directory
part / --fstype = ext4 --grow --size = 1 --ondisk = sda
#Reboot After installation
# Set the restart after the completion of
reboot --eject
#This Packages is for CentOS 6.4
# Custom packages to CentOS 6.4
% Packages
@base
@core
@ Chinese-support
# Increase the installation after running the script
% Post
#config service
# Custom Service
service NetworkManager stop
chkconfig NetworkManager off
#eject cdrom
# Installation eject the disc
#eject
#reboot
# After the restart execution
#reboot -f
# End Automated Deployment
% End
Generate dependencies and ISO files
Note that the accuracy of the path and command
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 / |
|
|
|