【问题】

服务器安装操作系统时,挂载本地镜像文件,可能会存在网络问题,导致镜像iso文件加载很慢

【解决办法】

  1. 使用与要安装操作系统的服务器1同网段的另一台服务器2搭建NFS,作为iso镜像媒体服务器
  2. 在BMC中启用远程媒体,挂载NFS类型的镜像服务器,地址为服务器2的IP并指定路径

【详细步骤】

一、搭建NFS服务器

——以CentOS 7.9为例进行操作

检查防火墙和SELinux

检查防火墙

systemctl status firewalld

[root@CentOS7 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

如未关闭使用如下命令进行关闭

systemctl stop firewalld
systemctl disable firewalld

检查SELinux

cat /etc/selinux/config

[root@CentOS7 ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

若未关闭禁用,使用如下命令:

setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config

安装 NFS 和 RPC

yum install -y nfs-utils rpcbind

配置exports

创建共享目录文件夹

mkdir -p /nfs/isos

配置NFS(全部客户端可挂载)

echo "/nfs/isos *(rw,sync,no_root_squash)" >> /etc/exports

加入开机自启动

systemctl enable rpcbind && systemctl start rpcbind
systemctl enable nfs && systemctl restart nfs

使NFS配置生效

exportfs -r

查看服务状态

systemctl status rpcbind
systemctl status nfs

rpcinfo -p ,如果显示rpc 服务器注册的端口列表(端口:111),则启动成功。

 rpcinfo -p

 NFS服务器搭建完成

二、BMC配置媒体服务器

——以海光TU526服务器为例

登录BMC,设置选择”媒体重定向设置“

 选择”一般设置“

 开启”远程媒体支持“,挂载CD/DVD,输入镜像服务器地址(NFS服务器IP),输入共享路径"/nfs/isos",共享类型选择”nfs“,点击保存,如下图:

 上传镜像文件到NFS服务器的共享目录/nfs/isos中

 BMC选择”进行重定向“-点击”远程镜像“

 选择需要安装的镜像,点击开始重定向选中的镜像文件

 启动远程KVM控制,重启服务器

 

重启后选择对应启动项进行系统安装

Logo

技术共进,成长同行——讯飞AI开发者社区