323 views
Liunx-服务安装

Kickstart自动安装系统(Centos6)

server:192.168.77.62 routes:192.168.77.2

1、kickstart安装平台,包括的完整架构为:Kickstart+DHCP+NFS(http)+TFTP+PXE

2、安装相关软件

[code]

yum install dhcp* nfs* tftp* syslinux syslinux-devel -y

[/code]

3、配置相关服务

TFTP:

[code]

vim /etc/xinetd.d/tftp

service tftp

{

disable = no

socket_type = dgram

protocol = udp

wait = yes

user = root

server = /usr/sbin/in.tftpd

server_args = -u nobody -s /tftpboot

per_source = 11

cps = 100 2

flags = IPv4

}

[/code]

只需要把disable = yes改成disable = no即可。

NFS:

[code]

mkdir   -p   /centosinstall

nohup cp  -rf   /mnt/*  /centosinstall

echo “/centosinstall    *(rw,sync)” >> /etc/exports

[/code]

DHCP:

[code]

vim /etc/dhcp/dhcpd.conf

ddns-update-style interim;

ignore client-updates;

next-server 192.168.77.62;

filename “pxelinux.0”;

allow booting;

allow bootp;

subnet 192.168.77.0 netmask 255.255.255.0 {

# — default gateway

option routers 192.168.77.2;

option subnet-mask 255.255.255.0;

range dynamic-bootp 192.168.77.100 192.168.77.200;

host ns {

hardware ethernet 00:1a:a0:2b:38:81;

fixed-address 192.168.77.101;}

}

[/code]

4、配置相关文件

[code]

mount     /dev/cdrom    /mnt

ln -s /var/lib/tftpboot /

cp /usr/share/syslinux/pxelinux.0 /tftpboot

cp  /mnt/images/pxeboot/{vmlinuz,initrd.img} /tftpboot

mkdir  -p  /tftpboot/pxelinux.cfg

cp  /mnt/isolinux/isolinux.cfg   /tftpboot/pxelinux.cfg/default

[/code]

vim /tftpboot/pxelinux.cfg/default

[code]

default linux

prompt 1

timeout 10

display boot.msg

F1 boot.msg

F2 options.msg

F3 general.msg

F4 param.msg

F5 rescue.msg

label linux

kernel vmlinuz

append ks=nfs:192.168.77.62:/centosinstall/ks.cfg ksdevice=eth0 initrd=initrd.img

label text

kernel vmlinuz

append initrd=initrd.img text

label ks

kernel vmlinuz

append ks initrd=initrd.img

label local

localboot 1

label memtest86

kernel memtest

append –

[/code]

mv /root/anaconda-ks.cfg /centosinstall/ks.cfg

vim /centosinstall/ks.cfg

[code]

# Kickstart file automatically generated by anaconda.

install

text

nfs –server=192.168.77.62 –dir=/centosinstall

key –skip

lang zh_CN.UTF-8

keyboard us

network –device eth0 –bootproto=dhcp –noipv6

rootpw 123456

firewall –disabled

authconfig –enableshadow –enablemd5

selinux –disabled

timezone Asia/Shanghai

bootloader –location=mbr –driveorder=sda –append=”rhgb quiet”

zerombr

clearpart –all –initlabel

part /boot –fstype=ext4 –size=200

part swap –size=2000

part / –fstype=ext4 –grow –size=200

reboot

%packages

@base

@core

@chinese-support

[/code]

启动各项服务:

service xinetd  restart

service nfs restart

service dhcpd restart

iptables -F

5、开启一台什么都没装的机器,但是改机器必须要和192.168.77.62这台服务器的网络互通,插上网线即可

Leave a Reply

影子专属博客 赣ICP备17013143号