CentOS 6.5 PXE自动化部署系统

拓扑图如下:

步骤:

1、  安装http服务,上传ISO文件

[root@UCS-1 ~]# yum install httpd –y

[root@UCS-1 ~]# chkconfig --add httpd

[root@UCS-1 ~]# chkconfig --level 35 httpd on

[root@UCS-1 ~]# /etc/init.d/httpd start

[root@UCS-1 ~]# mkdir -p /var/www/html/os/6

[root@UCS-1 ~]# mount /dev/cdrom /mnt

[root@UCS-1 ~]# cd /mnt

[root@UCS-1 mnt]# cp -r * /var/www/html/os/6

[root@UCS-1 ~]#  yum install tftp-server –y

[root@UCS-1 mnt]# cp /var/www/html/os/6/isolinux/boot.msg /var/lib/tftpboot/

[root@UCS-1 mnt]# cp /var/www/html/os/6/images/pxeboot/initrd.img /var/lib/tftpboot/

[root@UCS-1 mnt]# cp /var/www/html/os/6/images/pxeboot/vmlinuz /var/lib/tftpboot/

[root@UCS-1 html]# cp /var/www/html/os/6/isolinux/splash.jpg /var/lib/tftpboot/

[root@UCS-1 html]# cp /var/www/html/os/6/isolinux/vesamenu.c32 /var/lib/tftpboot/

[root@UCS-1 mnt]# yum -y install syslinux

[root@UCS-1 mnt]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

[root@UCS-1 mnt]# mkdir /var/lib/tftpboot/pxelinux.cfg

[root@UCS-1mnt]#cp /var/www/html/os/6/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default

2、  修改tftp配置文件

[root@UCS-1 mnt]# vi /etc/xinetd.d/tftp

service tftp

{

socket_type             = dgram

protocol                = udp

wait                    = yes

user                    = root

server                  = /usr/sbin/in.tftpd

server_args             = -s /var/lib/tftpboot

disable                 = no(原来yes修改成为no)

per_source              = 11

cps                     = 100 2

flags                   = IPv4

}

[root@UCS-1 mnt]# chkconfig xinetd on

[root@UCS-1 mnt]# chkconfig --level 35 xinetd on

[root@UCS-1 mnt]# yum -y install dhcp

[root@UCS-1 mnt]# vi /etc/dhcp/dhcpd.conf

3、  安装dhcp服务

[root@UCS-1 mnt]# vi /etc/dhcp/dhcpd.conf

ddns-update-style interim;

ignore client-updates;

allow booting;

allow bootp;

subnet 192.168.8.0 netmask 255.255.255.0{

range 192.168.8.110 192.168.8.120;

option routers 192.168.8.254;

option broadcast-address 192.168.8.255;

default-lease-time 600;

max-lease-time 7200;

next-server 192.168.8.254;

filename "pxelinux.0";

} [root@UCS-1 mnt]# /etc/init.d/dhcpd start

4、  安装system-config-kickstart.noarch

[root@UCS-1 mnt]# yum install system-config-kickstart.noarch -y

5、  进入图形界面执行[root@UCS-1 mnt]# /etc/init.d/dhcpd start

6、  生成ks.cfg文件

#platform=x87, AMD64, 或 Intel EM64T

#version=DEVEL

# Firewall configuration

firewall --disabled

# Install OS instead of upgrade

install

# Use network installation

url --url="http://192.168.8.254/os/6"

#repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100(注释掉,否则启动从光盘安装)

# Root password

rootpw --iscrypted $1$EuW9dIZG$Vclkz/TcHRuoiBqYdPvTD0

# System authorization information

auth  --useshadow  --passalgo=sha512

# Use text mode install

text

# System keyboard

keyboard us

# System language

lang zh_CN

# 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/Shanghai

# Network information

network  --bootproto=dhcp --device=eth0 --onboot=on

network  --bootproto=dhcp --device=eth1 --onboot=on

# System bootloader configuration

bootloader --append="crashkernel=auto rhgb quiet" --location=mbr --driveorder="sda"

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all

# Disk partitioning information

part / --fstype="ext4" --grow --size=1

%packages

@base

@basic-desktop

@chinese-support

@core

@debugging

@desktop-debugging

@desktop-platform

@development

@directory-client

@fonts

@general-desktop

@graphical-admin-tools

@input-methods

@internet-applications

@internet-browser

@java-platform

@legacy-x

@network-file-system-client

@office-suite

@print-client

@remote-desktop-clients

@server-platform

@server-policy

@workstation-policy

@x11

abrt-gui

certmonger

device-mapper-persistent-data

genisoimage

jpackage-utils

krb5-workstation

libXmu

mtools

  • oddjob

pam_krb5

pax

samba-winbind

sgpio

systemtap-client

wodim

%end

7、  修改PXE引导文件的ks.cfg,修改如下部分

[root@UCS-1 html]# vi /var/lib/tftpboot/pxelinux.cfg/default

timeout 60 # 修改等待时间为6秒

display boot.msg

menu background splash.jpg

menu title Welcome to CentOS 6.5!

menu color border 0 #ffffffff #00000000

menu color sel 7 #ffffffff #ff000000

menu color title 0 #ffffffff #00000000

menu color tabmsg 0 #ffffffff #00000000

menu color unsel 0 #ffffffff #00000000

menu color hotsel 0 #ff000000 #ffffffff

menu color hotkey 7 #ffffffff #ff000000

menu color scrollbar 0 #ffffffff #00000000

label linux

menu label ^Install or upgrade an existing system

menu default

kernel vmlinuz

append initrd=initrd.img ks=http://192.168.8.254/ks.cfg 指定ks.cfg文件目录

label vesa

menu label Install system with ^basic video driver

kernel vmlinuz

append initrd=initrd.img xdriver=vesa nomodeset

label rescue

menu label ^Rescue installed system

注意部分:如果是多个网卡的话,还要打开路由功能

基于HTTP和TFTP的PXE批量自动化安装Linux系统的更多相关文章

  1. PXE批量部署安装Linux系统

    PXE介绍 1)Preboot Excution Environment 预启动执行环境 2)Intel公司研发 3)基于Client/Server的网络模式,支持远程主机通过网络从远端服务器下载映 ...

  2. centos7/rhel7下配置PXE+Kickstart自动安装linux系统

    应用场景:临时安装一个系统或者批量安装linux系统,无需人工介入选择下一步,减少在安装系统上的时间浪费,提高工作效率. DHCP + TFTP + Syslinux + FTP + Kickstar ...

  3. Kicstart+pxe搭建自动化安装Linux 整理了一下

    一直想把 有道云得笔记整理一下传上来  都是自己亲测过 ,先来这篇吧  : 二小时安装 100台Linux  system  其实Winddows 也可以这样搞  只是方法    组件不同  原理一样 ...

  4. 制作iso镜像U盘自动化安装linux系统

    自制光盘引导自动化安装 首先我们要明白都需要哪些文件,我们列举下 ①需要一个文件夹来存放文件,将来把这个目录打包成iso ②准备kickstart文件(ks.cfg) ③准备启动文件启动菜单 差不多也 ...

  5. (转)Cobbler无人值守批量安装Linux系统

    本文目录: 1.1 pxe安装系统 1.2 cobbler基本介绍 1.3 安装和配置cobbler 1.3.1 安装cobbler 1.3.2 配置dhcp和tftp 1.4 cobbler从本地光 ...

  6. 基于PXE网络启动的Linux系统自动化安装

      在实际工作中,传统纯手动安装操作系统的方式是有一定的局限性的,例如:现在大多数的服务器都不自带光驱,若要安装系统需要外接光驱插入光盘,整个安装过程中需要人工交互确认,手动设置每一个安装设置项,人必 ...

  7. 搭建PXE实现自动化安装系统

    一.PXE工作原理 Ø  Client向PXE Server上的DHCP发送IP地址请求消息,DHCP检测Client是否合法(主要是检测Client的网卡MAC地址),如果合法则返回Client的I ...

  8. Cobbler自动化安装部署系统

    自动化安装部署 https://www.cnblogs.com/nulige/p/6796593.html PXE+Kickstart工作原理 pxe+kickstart工作流程 网卡上的pxe芯片有 ...

  9. PXE无人值守实现批量化自动安装Linux系统

    设想一个场景:假如让你给1000台服务器装系统,你会怎么做?跑去每一台服务器给它安装系统吗?显然不会.. 一.概括 通过网络引导系统的做法可以不必从硬盘.软盘或CD-ROM硬盘,而是完全通过网络来引导 ...

随机推荐

  1. Cookie 路径在本机测试及服务器部署,在浏览器处理方式上的不同

    Table of Contents 1 问题场景 2 解决过程 2.1 cookie是否设置成功 2.2 cookie是否上传到服务器 3 总结 1 问题场景 最近在学用Python进行web开发,写 ...

  2. xml总结图--(来自传智播客视频资料)

  3. QtWebkit中如何将网页内容转为图片

    原地址:http://www.cnblogs.com/baizx/archive/2010/07/31/1789573.html 如何将webkit中的渲染结果也就是网页画面转换为图片   用抓图软件 ...

  4. linux中段错误的处理

    在 Linux环境下做C语言项目,由于是在一个原有项目基础之上进行二次开发,而且项目工程庞大复杂,出现了不少问题,其中遇到最多.花费时间最长的问题就是著名的“段错误”(Segmentation Fau ...

  5. 如何在SourceInsight中选中匹配的大括号中的内容

    如何在SourceInsight中选中匹配的大括号中的内容 要分析的代码很长,多个for,if等分析嵌套在一起,代码有点乱,找到了这个分支的头,却不知道尾在哪,找到了尾却不知道哪是开头,在网上找了一下 ...

  6. HDU 4669 Mutiples on a circle (DP , 统计)

    转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents    by---cxlove 题意:给出一个环,每个点是一个数字,取一个子串,使 ...

  7. hbase memstorelab

    关于MemStore的补充 在通过HStore.add向store中加入�一个kv时,首先把数据写入到memstore中.这一点没有什么说明: publiclongadd(finalKeyValue ...

  8. 九度OJ 1065 输出梯形 (模拟)

    题目1065:输出梯形 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:3745 解决:2043 题目描写叙述: 输入一个高度h.输出一个高为h.上底边为h的梯形. 输入: 一个整数h(1& ...

  9. 如何使用Reaver破解Wi-Fi网络的WPA密码

    via: http://lifehacker.com/5873407/how-to-crack-a-wi+fi-networks-wpa-password-with-reaver 译者:Mr小眼儿 本 ...

  10. boa-0.94.13:Hello CGI

    CGI是什么 CGI全称是CommonGateway Interface,简称CGI,中文名叫做通用网关接口. CGI程序就是符合CGI接口规范的程序,相对于WebServer来说也叫外部程序. CG ...