CentOS7.0-PXE批量部署


CentOS7.0-Kickstart無人值守安裝linux

 

方法:FTP+TFTP+DHCP+Kickstart+PXEvim

PXE服務器:CentOS7.0-192.168.25.1服務器

 

1.搭建yum倉庫socket

[root@max ~]# vim /etc/yum.repos.d/serverl.repoide

[base]url

name=serverspa

baseurl=file:///mntrest

gnabled=1server

gpgcheck=0blog

[root@max ~]# mount /dev/cdrom /mnt

 

2.配置ftp:

[root@max ~]# yum install vsftpd  –y

[root@max ~]# systemctl restart vsftpd.service ;systemctl enable vsftpd.service

 

3.配置tftp:

[root@max ~]# yum install tftp tftp-server xinetd -y

[root@max ~]# vim /etc/xinetd.d/tftp

service tftp

{

        socket_type             = dgram

        protocol                = udp

        wait                    = yes

        user                    = root

        server                  = /usr/sbin/in.tftpd

        server_args             = -s /tftpboot

        disable                 = no

        per_source              = 11

        cps                     = 100 2

        flags                   = IPv4

}

[root@max ~]# systemctl restart xinetd.service ; systemctl restart tftp.service ; systemctl enable tftp.service   

 

4.安裝dhcp,修改配置文件及開啓服務:

[root@max ~]# yum install dhcp  –y

[root@max ~]# cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak

[root@max ~]# cp /usr/share/doc/dhcp*/dhcpd.conf.example dhcpd.conf

[root@max ~]# vim /etc/dhcp/dhcpd.conf

vim /etc/dhcp/dhcpd.conf

subnet 192.168.25.0 netmask 255.255.255.0 {

        range 192.168.25.100 192.168.25.200;

        next-server 192.168.25.1;

        filename "pxelinux.0";

}

[root@max ~]# systemctl restart dhcpd ;systemctl enable dhcpd

 

準備工做完成,咱們開始配置Kickstart

[root@max ~]# mkdir /tftpboot

[root@max ~]# mkdir /tftpboot/pxelinux.cfg

[root@max ~]# cp /usr/share/syslinux/pxelinux.0 /tftpboot/

----若是找不到syslinux目錄,須要安裝包syslinux

[root@max ~]# cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

[root@max ~]# cp /mnt/p_w_picpaths/pxeboot/initrd.img /tftpboot/

[root@max ~]# cp /mnt/p_w_picpaths/pxeboot/vmlinuz /tftpboot/

[root@max ~]# chmod 644 /tftpboot/pxelinux.cfg/default

[root@max ~]# vim /tftpboot/pxelinux.cfg/default

 

wKioL1kj5k6yjHXlAAAjPLB0M1A097.png

wKioL1kj5k-yAdX0AAANfUr8TBU760.png


[root@max ~]# yum install system-config-kickstart.noarch –y

[root@max ~]# system-config-kickstart

wKiom1kj6M-zxn3RAABoBbWDddg309.png

wKiom1kj6M_zJMRdAABQcEXt_FA011.png

wKioL1kj6NDQ2IXYAABiqBfs6zQ979.png

wKiom1kj6NDQn6LWAABBLbIkE-Y407.png

wKioL1kj6NCgxd4vAABgypiAnOU099.png

wKioL1kj6NGxxeLpAABOD-ybRcM356.png

wKiom1kj6NGzyxRKAAAwF31et2w897.png

wKiom1kj6NKxqTc9AABvo-_DBO4396.png

wKioL1kj6NKim2RMAABJdTklCw4341.png

wKioL1kj6NKRN5DKAABN8Wm9kXM641.png

wKiom1kj6NPwI-rvAABYlpdzmCc977.png

wKioL1kj6NTRDryKAACNoGRaxU0331.png

[root@max ~]#cp ks.cfg  /var/ftp

從新掛載CentOS7.0安裝光盤到/var/ftp/pub目錄下,開始執行另外一臺機器的無人值守安裝

[root@max ~]# umount /dev/cdrom     //原來掛載到/mnt下的

[root@max ~]# mount /dev/cdrom /var/ftp/pub

[root@max ~]# iptables -F

[root@max ~]# setenforce 0

[root@max ~]# systemctl stop firewall

相關文章
相關標籤/搜索