PXE批量部署 Linux 系统

  • 2019-04-21
  • 125
  • 0
                  <span>标签:<a href='http://www.mamicode.com/so/1/%e6%9c%8d%e5%8a%a1%e5%99%a8' title='服务器'>服务器</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/pxe' title='pxe'>pxe</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/https' title='https'>https</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/kickstart' title='kickstart'>kickstart</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/%e9%83%a8%e7%bd%b2' title='部署'>部署</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/web' title='web'>web</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/x86' title='x86'>x86</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/%e4%ba%a4%e6%b5%81' title='交流'>交流</a>&nbsp;&nbsp;&nbsp;<a href='http://www.mamicode.com/so/1/dir' title='dir'>dir</a>&nbsp;&nbsp;&nbsp;</p>实验场景描述:<br/>1、准备环境:<br/>配置httpd服务,关闭系统策略<br/>2、配置应答文件<br/>通过system-config-kickstart  配置应答文件<br/>3、指定应答文件<br/>客户端指定应答文件<br/>具体如下所示;若描述有误欢迎拍砖交流:QQ:45223208</p> <p>一、准备服务器环节<br/>1、安装httpd服务<br/>yum  install httpd -y  <br/>如图所示<br/><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4632583ef.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <pre><code>        2、启动httpd服务             systemctl  start httpd             systemctl  enable httpd</code></pre> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46328ebda.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <pre><code>3、修改系统相关策略 关闭防火墙和selinux策略         systemctl  stop  firewalld            sed  -ir  ‘[email protected]^(SELINUX)=.*@[email protected]‘  /etc/selinux/config</code></pre> <p>如图所示<br/><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4632d3129.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p>4、创建系统目录和镜像  /var/www/html/centos/6/os/x64_64   -pv<br/><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb463321f33.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" />   <br/>5、挂载系统镜像<br/>mount /dev/sr0 /var/www/html/centos/6/os/x86_64<br/><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46338a91d.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /><br/>二、配置应答文件<br/>1、通过system-config-kickstart  生成应答文件,如图所示<br/><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4633dce78.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb463427166.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46346315c.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4634adcac.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46350dd9a.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4635919c4.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4635da119.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46362114c.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46368ee26.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4636df918.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p>最后post-install script 中增加脚本测试验证<br/>useradd  yang &amp;&gt; /dev/null<br/>echo  centos | passwd --stdin  yang<br/>将生成的应答文件命名ks.cfg,并传到web服务器的根目录 /ksdir/ks.cfg</p> <p>三、在部署机器指定应答文件,并配置相关信息,如图所示<br/><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46372a470.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p>4、安装过程</p> <p><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb46376f3e2.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" /></p> <p>5、大功告成,进入系统,验证脚本<br/><img src="https://ctoclubs.com/wp-content/uploads/2019/04/20190420_5cbb4637d953a.png" alt3="PXE批量部署 Linux 系统" alt="PXE批量部署 Linux 系统" />

PXE批量部署 Linux 系统

标签:服务器   pxe   https   kickstart   部署   web   x86   交流   dir   

原文地址:https://blog.51cto.com/stalman/2381947

评论

还没有任何评论,你来说两句吧