변군이글루

[리눅스] Kickstart(킥스타트) 설치_201704 본문

서___리눅스

[리눅스] Kickstart(킥스타트) 설치_201704

변군 변군이글루 2017.04.08 18:59


Kickstart(킥스타트) 설치

Step 1: repository 디렉토리 생성
# mkdir -p /appdata/www/repository/centos/6.9/{isos, os}/x86_64
# mkdir -p /appdata/www/repository/centos/7.3/{isos, os}/x86_64
# mount -t iso9660 -o loop /appdata/www/repository/centos/6/isos/x86_64/CentOS-6.9-x86_64-bin-DVD1.iso /mnt
# cp -fR /mnt/* /appdata/www/repository/centos/6/os/x86_64/.
# umount /mnt

Step 2: TFTP(Trivial File Transfer Protocol) 설치
# yum install -y tftp tftp-server syslinux-tftpboot xinetd
# vi /etc/xinetd.d/tftp
--------------
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
--------------
# service xinetd start
# netstat -nlp | grep 69

Step 4: DHCP(Dynamic Host Configuration Protocol) 설치
# yum install -y dhcp dhcp-devel
# cat /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample >> /etc/dhcp/dhcpd.conf
# vi /etc/dhcp/dhcpd.conf
--------------
Allow booting;
Allow bootp;

default-lease-time 600;
max-lease-time 7200;

ddns-update-style none;

authoritative;

log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.200 192.168.0.210;
  option routers 192.168.0.1;
  default-lease-time 600;
  max-lease-time 7200;
  #### PXE Server IP ###
  next-server 192.168.0.101;
  filename "pxelinux.0";
  server-name "192.168.0.101";
}
--------------
# service dhcpd start
# netstat -nlp | grep 67

Step 5: WEB Server(Apache) 설치
# yum install -y httpd httpd-devel mod_ssl
# vi /etc/httpd/conf/httpd.conf
--------------
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@kss.scbyun.com
    DocumentRoot /appdata/www/
    ServerName kss.scbyun.com
    ErrorLog logs/kss.scbyun.com-error.log
    CustomLog logs/kss.scbyun.com-access.log common
</VirtualHost>
--------------

# service httpd start

Step 6: Kickstart 설정 파일 생성
# mkdir -p /appdata/www/ks
# vi /appdata/www/ks/ks-centos6_x64.cfg
--------------
#platform=x86, AMD64, 또는 Intel EM64T
#version=DEVEL

# Firewall configuration
firewall --enabled --ssh

# Install OS instead of upgrade
install

# Use network installation
#url --url="http://kss.scbyun.com/repository/centos/6/os/x86_64"
url --url="http://192.168.0.101/repository/centos/6/os/x86_64"

# Root password
rootpw --iscrypted $1$rqh4iFsa$qDAcahpUnPvgL8bGZ.vQj/

# System authorization information
auth  --useshadow  --passalgo=sha512

# Use text mode install
text

# System keyboard
keyboard us

# System language
lang ko_KR

# SELinux configuration
selinux --disabled

# Do not configure the X Window System
skipx

# Installation logging level
logging --level=info

# Reboot after installation
reboot

# System timezone
timezone  Asia/Seoul

# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
#network --bootproto=dhcp --device=eth1 --onboot=on
#network --onboot=on --device=eth0 --bootproto=static --ip=10.0.2.15 --netmask=255.255.255.0 --gateway=10.0.2.254 --nameserver=10.0.2.1

# System bootloader configuration
bootloader --location=mbr
bootloader --location=mbr --driveorder=sda --append="nomodeset rhgb crashkernel=auto quiet"

# Partition clearing information
clearpart --all --initlabel

# Disk partitioning information
part /boot --asprimary --fstype="ext4" --grow --maxsize=500 --size=1
part swap --fstype="swap" --grow --maxsize=4096 --size=1
part / --fstype="ext4" --grow --size=1
--------------

Step 7:
# yum install -y syslinux system-config-kickstart
# mkdir -p /var/lib/tftpboot/{pxelinux.cfg,centos6}
# cp /appdata/www/repository/centos/6.9/os/x86_64/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/centos6/
# ln -s /appdata/www/repository/centos/6.9 /appdata/www/repository/centos/6
# ln -s /appdata/www/repository/centos/7.3 /appdata/www/repository/centos/7
# vi /var/lib/tftpboot/pxelinux.cfg/default
--------------
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

MENU TITLE Main Menu

MENU TITLE ########## PXE Boot Menu ##########

LABEL 1
        MENU LABEL ^1) Boot from local drive localboot
        LOCALBOOT 0

LABEL 2
        MENU LABEL ^2) Install CentOS 6 x86_64 Edition
        KERNEL centos6/vmlinuz
        #APPEND initrd=centos6/initrd.img ks=http://kss.scbyun.com/ks/ks-centos6_x64.cfg ksdevice=eth0
        APPEND initrd=centos6/initrd.img ks=http://192.168.0.101/ks/ks-centos6_x64.cfg load_ramdisk=1 ksdevice=link network
--------------

Step 8:
# vi kss-restart.sh
--------------
#!/bin/bash

service xinetd restart
service dhcpd restart
service httpd restart
--------------
# chmod 700 kss-start.sh

 

0 Comments
댓글쓰기 폼