为了满足同时安装上百台linux,而且不需要人工干预。这就需要PXE来通过网线自动安装linux
1.搭建yum源来下载必要的工具,yum源的配置见点击打开链接。
2.下载syslinux,dhcp,http,tftp-server。
[root@localhost etc]# yum -y install syslinux dhcp httpd tftp-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package syslinux-4.05-12.el7.x86_64 already installed and latest version
Package 12:dhcp-4.2.5-42.el7.centos.x86_64 already installed and latest version
Package httpd-2.4.6-40.el7.centos.x86_64 already installed and latest version
Package tftp-server-5.2-12.el7.x86_64 already installed and latest version
Nothing to do
因为我是安装好了,所以报告Nothing to do 。那没安装的就执行那个命令
yum -y install syslinux dhcp httpd tftp-server
3.下载自动安装kickstart工具命令
yum -y install system-config-kickstart
同样,我也安装过了,才报告Nothing to do
[root@localhost ~]# yum -y install system-config-kickstart
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package system-config-kickstart-2.9.2-4.el7.noarch already installed and latest version
Nothing to do
4.搭建一个http的安装源。
进入/var/www/html ,并创建一个目录CentOS用来挂载镜像
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
CentOS ks.cfg
[root@localhost html]# mount /dev/sr0 /var/www/html/CentOS
注意:没那个CentOS目录的先创建一个目录。(那个ks.cfg先不用管,下步再教如何生成)。
命令是 mkdir /var/www/html/CentOS 。然后再挂载(sr0是镜像,也可以写成其他的镜像之类的)。
再执行以下命令