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. c++实现atoi()和itoa()函数(字符串和整数转化)

    (0) c++类型所占的字节和表示范围 c 语言里 类型转换那些事儿(补码 反码) 应届生面试准备之道 最值得学习阅读的10个C语言开源项目代码 一:起因 (1)字符串类型转化为整数型(Integer ...

  2. Hadoop MapReduce编程的一些个人理解

    首先要实现mapreduce就要重写两个函数,一个是map 还有一个是reduce map(key ,value) map函数有两个參数,一个是key,一个是value 假设你的输入类型是TextIn ...

  3. 14.10.2 File Space Management 文件空间管理:

    14.10.2 File Space Management 文件空间管理: 数据文件 你定义在配置文件形成了InnoDB的系统表空间, 文件是逻辑连接形成表空间,没有条带化使用. 你不能定义你的表在表 ...

  4. android优化原理

    时间换时间: 数据的异步载入 分批载入. 开机加速. 时间换空间:  分页. 空间换时间: everything.exe 音乐 图库 在开机启动后, sd卡被挂载 生成数据库. 空间换空间: 8G内存 ...

  5. psl/sql本地与远程连接配置

    一:下载Oracleclient 下载地址:http://www.oracle.com/technetwork/database/features/instant-client/index-09748 ...

  6. 圆角和圆形ImageView

    ※效果 ※代码 /** * 转换图片成圆形 * * @param bitmap * 传入Bitmap对象 * @return */ public Bitmap toRoundBitmap(Bitmap ...

  7. 在命令行获取标准输入序列的反互序列,pep序列和长度信息

    近期对序列文件处理的比較多,时常要看一些核酸序列的反向互补序列,长度.可能的翻译序列. 曾经我常用seqBuider 来查看.假设能在命令行直接查看.想必是极好的. 这是一个perl脚本.只是我把它的 ...

  8. Effective C++_笔记_条款08_别让异常逃离析构函数

    (整理自Effctive C++,转载请注明.整理者:华科小涛@http://www.cnblogs.com/hust-ghtao/) C++并不禁止析构函数吐出异常,但它不鼓励你这样做.考虑如下代码 ...

  9. CWnd中PreCreateWindow、PreSubclassWindow、SubclassWindow的区别

    http://blog.csdn.net/swimmer2000/archive/2007/10/30/1856213.aspx MFC(VC6.0)的CWnd及其子类中,有如下三个函数:     / ...

  10. CListCtrl插入数据避免闪烁

    1.锁定窗口,不进行刷新 m_list.LockWindowUpdate(); 2.设定列表不进行重画 m_list.SetRedraw(FALSE); 3.清空列表,删除历史数据 m_list.De ...