CentOS7.9系统搭建NFS服务器作为BMC镜像iso媒体服务器

【问题】

服务器安装操作系统时,挂载本地镜像文件,可能会存在网络问题,导致镜像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控制,重启服务器

 

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

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

来碗排骨汤

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值