zoukankan      html  css  js  c++  java
  • PXE+HTTP+TFTP+Kickstart实现无人值守部署centos6.10

    在联网的状态下安装所需软件:

    Shell> yum install dhcp httpd tftp-server xinetd syslinux system-config-kickstart

    采用HTTP协议部署PXE环境

    Shell> mkdir /var/www/html/Centos-6.10

    挂载有软件包的磁盘到指定路径

    Shell>mount /dev/sr0 /var/www/html/Centos-6.10

    删除httpd的欢迎页

    Shell> rm -f /etc/httpd/conf.d/welcome.conf

    启动httpd服务,设置开机自启

    Shell> service httpd start

    Shell> chkconfig --add httpd

    Shell> chkconfig httpd on

    编辑xinetd服务配置文件,将tftp服务托管给xinetd

    Shell> vim /etc/xinetd.d/tftp

    disable        =no

    设置xinetd服务的开机自启

    Shell> service xinetd start

    Shell> chkconfig --add xinetd

    Shell>chkconfig xinetd on

    将系统启动所需文件拷贝到指定路径下

    Shell>cp /usr/share/syslinux/pxelinux.0  /var/lib/tftpboot/

    Shell> mkdir /var/lib/tftpboot/pxelinux.cfg

    Shell>cp /var/www/html/Centos-7.2/isolinux/*  /var/lib/tftpboot/

    Shell>cp /var/lib/tftpboot/isolinux.cfg  /var/lib/tftpboot/pxelinux.cfg/default

    编辑dhcp服务的配置文件

    Shell>cat /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample >> /etc/dhcp/dhcpd.conf

    Shell> vim /etc/dhcp/dhcpd.conf

     

     

     

    编辑配置文件,指明安装系统需要加载的文件从哪里获取,注意一定要写对路径。

    Shell> vim /var/lib/tftpboot/pxelinux.cfg/default

         

     

    启动kickstart工具,用来生成ks.cfg文件

    Shell> system-config-kickstart

    启动kickstart后,会出现图形化界面,按照需求选择相应选项

     

     

    生成后的ks.cfg文件先保存在你所熟知的路径下,然后编辑该文件

    打开/root/anaconda-ks.cfg

    Shell> cat /root/anaconda-ks.cfg

    .....前面省略

    %packages

    @base

    @chinese-support

    @core

    @debugging

    @basic-desktop

    ......后面省略,//%pacha ges 后的部分记录系统安装时的软件包的安装情

    况,复制下来全部复制到 ks.cfg 文件后面。

    Shell>cat ks.cfg

    ......

    # Partition clearing information

    clearpart --none

    key --skip //跳过输入序列号环节

    ...... 中间省略

    %packages //这里及以后的内容是从/root/anaconda-ks.cfg 复制来的

    @office

    @editors

    @text-internet

    @gnome-desktop

    @dialup

    ......

    将ks.cfg文件编辑完成后,拷贝到/var/www/html/路径下,否则无法通过HTTP协议抓取到该文件

     

    Shell>重启xinetdhttpddhcpd服务

  • 相关阅读:
    【原】费马小定理(Fermat little theorem)详解
    【原】水库抽样详解
    【原】模幂运算(Modular Exponentiation)算法
    【原】 POJ 3630 Phone List Trie树 解题报告
    【Joke】你可以去当程序员了
    【原】 POJ 3750 小孩报数问题 Joseph相关问题详解 解题报告
    【原】 POJ 3748 位操作 解题报告
    react 性能优化
    修改jsp文件,访问时没有变化。可能是修改了系统的时间,,,郁闷呢
    在Windows 7 下使用Visual Studio 2010 编写自动申请管理员权限运行的程序
  • 原文地址:https://www.cnblogs.com/new-journey/p/10517991.html
Copyright © 2011-2022 走看看