YUM仓库服务与PXE网络装机
YUM仓库服务与PXE网络装机
技能展示
学会部署YUM软件仓库
学会使用YUM工具管理软件包
学会实现无人值守自动装机
简介
重点
部署YUM软件仓库
PXE远程安装的部署
Kickstart无人值守安装
理论讲解
部署YUM软件仓库
一.YUM仓库
1.安装程序的方式
1)rpm
无法帮助用户查找软件依赖关系
安装程序复杂
2)YUM
通过管理RPM数据库实现安装rpm包类型的程序
Yum能够帮助用户自动查找依赖关系
安装程序简单方便
3)yum仓库优势
减少公用带宽资源占用
灵活方便.简单
2.yum仓库的类型
1)本地yum仓库
通过Linux系统安装光盘使用
2)ftp的yum仓库
通过ftp服务器访问网络中的yum仓库
3)网络源
通过https或者http协议访问互联网yum源安装程序
阿里云源
163源网易
搜狐源
3. 配置yum源
1)配置本地yum源
[[email protected] ~]# cat /etc/yum.repos.d/local.repo
[local] 声明
name=centos 仓库名字
baseurl=file:///mnt 仓库位置
enable=1 开启yum功能
gpgcheck=0 关闭程序完整验证
查看yum源是否能用
[[email protected] ~]# yum list
查看有多少个程序包
[[email protected] ~]# yum list | wc -l
测试访问
2)配置ftp源
3)下载网络源
Wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
4)yum仓库的基本应用
1)清空yum缓存
[[email protected] ~]# yum clean all
2)查询软件包
[[email protected] ~]# yum info httpd
3)安装apache程序
[[email protected] ~]# yum -y install httpd
4)更新apache程序
[[email protected] ~]# yum update httpd
5)卸载apache程序
[[email protected] ~]# yum remove httpd
6)查找程序包
[[email protected] ~]# yum search httpd
二.PXE装机
1.pxe的作用和特定
1)pex的作用
预启动配置协议
批量安装Linux系统或者驱动程序
2)pxe的特定
加快系统安装速度
避免配置出错误的可能性
减轻管理员工作量
2. 安装Linux系统方式
1)光盘
需要使用光驱
2)U盘
刻录引导光盘
3)网络装机
使用PXE协议实现
3.PXE装机依赖的服务和使用注意事项
1)PXE装机依赖服务
Vftpd:传输系统使用
tftp:传输引导菜单使用
dhcp:客户端动态配置IP地址
2)PXE装机注意事项
计算机最好是同品牌
计算机型号相同
避免驱动不兼容
4.安装ftp和Linux引导程序
1)安装ftp服务
[[email protected] ~]# yum -y install vsftpd
2)安装引导文件
Cp -r /mnt/* /var/ftp/pub
3)安装引导文件
[[email protected] ~]# yum -y install syslinux
5.配置tftp服务器上传镜像和内核
1)安装引导程序
[[email protected] ~]# yum -y install syslinux
2)安装tftp服务器启动服务设置开机自动启动
[[email protected] ~]# yum -y install tftp-server
[[email protected] ~]# systemctl start tftp
[[email protected] ~]# systemctl enable tftp
3)修改tftp服务器配置文件
[[email protected] ~]# vim /etc/xinetd.d/tftp
disable = no 开启tftp
4)移动引导程序到tftp根目录
[[email protected] ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
5)移动Linux内核和镜像到tftp根目录
[[email protected] ~]# cp /mnt/isolinux/vmlinuz /var/lib/tftpboot/
[[email protected] ~]# cp /mnt/isolinux/initrd.img /var/lib/tftpboot
6.配置dhcp服务器
1)安装dhcp服务器
[[email protected] ~]# yum -y install dhcp
2)修改dhcp主配置文件
[[email protected] ~]# vim /etc/dhcp/dhcp.conf
3)启动dhcp服务设置开机自动启动
[[email protected] ~]# systemctl start dhcpd
[[email protected] ~]# systemctl enable dhcpd
7.配置Linux系统引导菜单
1)创建linux引导菜单存储文件
[[email protected] ~]# mkdir -p /var/lib/tftpboot/pxelinux.cfg
2)修改Linux引导菜单半自动化安装
[[email protected] ~]# vim /var/lib/tftpboot/pxelinux.cfg/default
8.配置无人值守安装Linux
1)调整PXE服务器图形化启动
[[email protected] ~]# systemctl set-default graphical.target
2)安装无人值守程序
3)复制无人值守安装脚本到ftp根目录
4)修改引导菜单支持无人值守安装
操作完成,感谢观看,拜拜ヾ(•ω•`)o