PEX服务器的部署
一、安装环境
1、注意事项:
保证局域网仅有一个DHCP不建议在生产环境下做这个实验,因为生产环境有路由器建议在VM虚拟机环境仅主机模式下做这个实验。服务器搭建成功之后,需要自动安装系统的机器内存必须≥2G2、配置虚拟机网络环境
如果是在vm虚拟机中做这个实验,建议在仅主机网络下做。做之前先配置一下虚拟机网络环境:
3、安装必备软件
yum -y install vsftpd dhcp tftp syslinux tftp-server xinetd
二、拷贝镜像文件到FTPFU服务器目录
cd /var/ftp/pubmkdir dvdchown ftp:ftp dvdmkdir -p /mnt/cdrommount /dev/sr0 /mnt/cdromcp -rf /mnt/cdrom/* dvd/
三、配置dhcp服务器
yum -y install dhcpvim /etc/dhcp/dhcpd.confallow booting; #允许给为安装的机器分配IPallow bootp;ddns-update-style interim;ignore client-updates;subnet 192.168.187.0 netmask 255.255.255.0 {#ip地址和子网掩码option subnet-mask 255.255.255.0;option domain-name-servers 192.168.187.10; #DNS地址range dynamic-bootp 192.168.187.100 192.168.187.200; #地址池default-lease-time 21600; #IP使用时间max-lease-time 43200; #最大使用时间next-server 192.168.187.10;#客户端获取到下载地址的ipfilename "pxelinux.0"; #引导文件名}systemctl restart dhcpdsystemctl enable dhcpd
四、配置tftp 服务
vim /etc/xinetd.d/tftp# default: off# description: The tftp server serves files using the trivial file transfer \# protocol. The tftp protocol is often used to boot diskless \# workstations, download configuration files to network-aware printers, \# and to start the installation process for some operating systems.service tftp{socket_type = dgramprotocol= udpwait= yesuser= rootserver = /usr/sbin/in.tftpdserver_args = -s /tftpboot #设置默认工作目录disable = no #设置开机自启动per_source = 11cps = 100 2flags = IPv4}
五、创建相关目录并拷贝所需文件
mkdir -p /tftpboot/pxelinux.cfgcp /var/ftp/pub/dvd/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/defaultcp /usr/share/syslinux/pxelinux.0 /tftpboot/chmod 644 /tftpboot/pxelinux.cfg/defaultcp /var/ftp/pub/dvd/isolinux/* /tftpboot/
六、开启相关服务并设置为自动启动
systemctl start vsftpdsystemctl enable vsftpdsystemctl start xinetdsystemctl enable xinetdsystemctl enable dhcpdsystemctl start dhcpd
这样PEX服务器已经好了,但是还做不到无人值守。想要做到我们还必须要有anaconda-ks.cfg
,而且还必须配置kisckstart
七、配置kisckstart 无人值守安装脚本
system-config-kickstartcp ks.cfg /var/ftp/pub/vi /tftpboot/pxelinux.cfg/default把顶部的default vesamenu.c32改成 default linux找到这里,添加KSlabel linuxmenu label ^Install CentOS 7kernel vmlinuzappend initrd=initrd.img ks=ftp://192.168.187.10/pub/ks.cfg
八、KS文件制作
ks.cfg文件制作需要安装system-config-kickstart
yum -y install system-config-kickstart
安装完进入系统的图形化界面,打开终端命令框输入:
system-config-kickstart
就会弹出软件界面
完成后,点击左上角的保存即可。然后放到:
mv /var/ftp/pubftp://192.168.187.10/pub/ks.cfg
以下是我的ks.cfg,建议你自己做一个。
#platform=x86, AMD64, 或 Intel EM64T#version=DEVEL# Install OS instead of upgradeinstall# Keyboard layoutskeyboard 'us'# Root passwordrootpw --iscrypted $1$DPTdrSOK$LK1fyNqiW/dMoJdDOlDRL/# Use network installationurl --url="ftp://192.168.187.10/pub/dvd"# System languagelang zh_CN# System authorization informationauth --useshadow --passalgo=sha512# Use text mode installtext# SELinux configurationselinux --disabled# Do not configure the X Window Systemskipx# Firewall configurationfirewall --disabled# Network informationnetwork --bootproto=static --device=eth0 --gateway=192.168.187.10 --ip=192.168.187.50 --netmask=255.255.255.0# Reboot after installationreboot# System timezonetimezone Africa/Abidjan# System bootloader configurationbootloader --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all --initlabel# Disk partitioning informationpart /boot --fstype="xfs" --size=600part /home --fstype="xfs" --size=20000part swap --fstype="swap" --size=1000part / --fstype="xfs" --grow --size=1%postmkdir /123%end
九、问题解决:Warning:/dev/root/ does not exist
报错 :Warning:/dev/root/ does not exist
原因:就是你的机器内存给的太小了。
解决方法:就是把机器内存提升到2G或以上