服务器数据迁移前准备文档,准备工作

本文档详细介绍了如何在Linux系统中启用并配置NFS文件系统。首先通过`yum install -y nfs-utils`安装NFS服务,然后在`/etc/exports`文件中添加共享配置 `/data*(rw,no_root_squash,insecure)`。接着启动NFS服务并检查其状态,确保服务正常运行。同时,还启用了rpcbind服务并确认其状态。最后,设置NFS服务在开机时启动。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

启用 NFS 文件系统: [root@test ~]# yum install -y nfs-utils

将 /data 文件夹设置共享。在 /etc/exports文件中添加 /data *(rw,no_root_squash,insecure): [root@test ~]# vi /etc/exports

#若mountd端口大于1024,则需要加入'insecure':

/data *(rw,no_root_squash,insecure)

说明

请严格按照/etc/exports文件格式进行配置,您可执行man 5 exports命令查看具体的格式要求。

如果配置错误,会导致客户端中挂载文件系统失败。

启动 NFS 服务: [root@test ~]# systemctl start nfs.service

检查 NFS 服务显示如下状态,表示服务已正常: [root@test ~]# systemctl status nfs.service

â— nfs-server.service - NFS server and services

Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)

Active: active (exited) since Thu 2018-12-06 15:47:03 CST; 58s ago

Process: 10641 ExecStartPost=/bin/sh -c if systemctl -q is-active gssproxy; then systemctl restart gssproxy ; fi (code=exited, status=0/SUCCESS)

Process: 10623 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)

Process: 10621 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)

Main PID: 10623 (code=exited, status=0/SUCCESS)

CGroup: /system.slice/nfs-server.service

Dec 06 15:47:03 test systemd[1]: Starting NFS server and s...

Dec 06 15:47:03 test systemd[1]: Started NFS server and se...

Hint: Some lines were ellipsized, use -l to show in full.

添加开机启动: [root@test ~]# systemctl enable nfs.service

检查 rpcbind 服务显示如下状态,表示服务已正常: [root@test ~]# systemctl status rpcbind.service

â— rpcbind.service - RPC bind service

Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)

Active: active (running) since Thu 2018-12-06 15:47:03 CST; 7min ago

Main PID: 10598 (rpcbind)

CGroup: /system.slice/rpcbind.service

└─10598 /sbin/rpcbind -w

Dec 06 15:47:03 test systemd[1]: Starting RPC bind service...

Dec 06 15:47:03 test systemd[1]: Started RPC bind service.

Hint: Some lines were ellipsized, use -l to show in full.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值