目录
1.kickstart自动安装脚本制作
克隆一台7.9,名称为node1
配置好可用ip
关闭vmware的dhcp功能
安装图形化生成kickstart自动安装脚本的工具
[root@nginx ~]# yum install system-config-kickstart -y
启动图形制作工具
[root@nginx ~]# system-config-kickstart
安装httpd
[root@nginx ~]#yum install httpd -y
[root@nginx ~]#systemctl enable --now httpd
[root@nginx ~]#ln -s /rhel7/ /var/www/html/
[root@nginx ~]#vim ks.cfg
%packages
@base
httpd
%end
[root@nginx ~]#ksvalidator ks.cfg #检查是否有语法错误
测试网站是否可以访问
2.搭建dhcp服务并测试kickstart
[root@nginx ~]#yum install dhcp -y
[root@nginx ~]#\cp -f /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf
[root@nginx ~]#vim /etc/dhcp/dhcpd.conf
[root@nginx ~]#systemctl enable --now dhcpd #开启dhcp服务
3.搭建pxe网络安装环境实现服务器自动部署
安装pxelinx
[root@nginx ~]# yum install syslinux.x86_64
[root@nginx ~]# yum install tftp-server.x86_64 -y
[root@nginx ~]# rpm -ql tftp-server
[root@nginx ~]# systemctl enable --now tftp
[root@nginx ~]# cp /rhel7/isolinux/* /var/lib/tftpboot/
[root@nginx ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@nginx ~]# cd /var/lib/tftpboot/
[root@nginx ~]# mkdir pxelinux.cfg
[root@nginx ~]# cp isolinux.cfg pxelinux.cfg/default
[root@nginx ~]# vim /etc/dhcp/dhcpd.conf
[root@nginx ~]# cat /var/lib/tftpboot/pxelinux.cfg/default
[root@nginx ~]# systemctl restart dhcpd
[root@nginx ~]# vim /etc/dhcp/dhcpd.conf
[root@nginx ~]# vim /var/lib/tftpboot/pxelinux.cfg/default
打开电源时进入固件
选择Network boot from Inter E1000置顶,保存退出
再选择硬件安装