专题:NFSv4 file server
Network File System (NFS) is a file system protocol that allows client machines to access network attached filesystems. The newest version is version 4.
<A> Kernel requirements:
NFS server support is not required for NFS clients, and NFS client support is not required for NFS servers. Dnotify support is only required for NFSv4. NFSv3 is only required for compatibility with legacy clients e.g.
File systems --->
[*] Dnotify support
[*] Network File Systems --->
<*> NFS client support
<*> NFS client support for NFS version
<*> NFS client support for NFS version
[*] NFS client support for NFSv4.
<*> NFS server support
[*] NFS server support for NFS version
[*] NFS server support for NFS version
[*] NFSv4. server support for Parallel NFS (pNFS)
<B> Install "net-fs/nfs-utils"(Gentoo) or "nfs-utils.x86_64"(RedHat)
After installation, set the "rpcbind" and "nfs" service start with your OS:
root # rc-update add nfs default && rc-update add rpcbind default
OR
root # systemctl enable nfs.service && systemctl enable rpcbind.service
<C> Virtual root
The filesystems to be exported must be made available under a single directory. This directory is known as the virtual root directory, and it is required for NFSv4:
root #mkdir /export
#The dir_name "/export" can be changed it to any other.
Create directories in the virtual root directory for the filesystems that are to be exported:
root #mkdir /export/distfiles
Write to "/etc/fstab"
/PATH/TO/distfiles /export/distfiles none bind
<D> Exports
The filesystems to be made accessible for clients are specified in /etc/exports. This file consists of the directories to be exported, the clients allowed to access those directories, and a list options for each client:
/export 10.1.0.0/(sync,rw,insecure,no_subtree_check,crossmnt,fsid=root)
/export/distfiles *(sync,ro,insecure,no_subtree_check)
The following table briefly describes the client options used in the configuration above:
insecure The server will require that client requests originate on unprivileged ports (those above ). This option is required when mounting exported directories from OS X. The default is to use privileged ports.
rw The client will have read and write access to the exported directory. The default is to allow read-only access.
sync The server must wait until filesystem changes are committed to storage before responding to further client requests. This is the default.
no_subtree_check The server will not verify the requests from clients(wether it's in the appropriate filesystem or has the correct permissions). This is the default in NFSv4.
crossmnt The server will reveal filesystems that are mounted under the virtual root directory that would otherwise be hidden when a client mounts the virtual root directory.
fsid=root This option is required to uniquely identify the virtual root directory.
If changes are made to /etc/exports after the NFS server has started, execute the following command:
root #exportfs -rv
OR
root #/etc/init.d/nfs reload
OR
root #systemctl reload nfs.service
<E> Daemon
The NFS daemon is configured via /etc/conf.d/nfs:
# /etc/conf.d/nfs
# Options to pass to rpc.nfsd
OPTS_RPC_NFSD="8 -N 2 -V 3 -V 4 -p 8888"
The option 8 is the number of NFS server threads to start.The option -N 2 disables NFS version 2, while options -V 3 and -V 4 enable NFS versions 3 and 4, The option -p 8888 change listening port from the default 2049 to 8888.
<F> Client Service
To be able to mount exported directories, start the NFS client:
root # service rpcbind start
OR
root # systemctl start rpcbind
<G> Mount on Client
root # mount [-t nfs] 113.114.115.116:/ /mnt #"-t nfs" argument is not necessary
<H>Troubeshooting
The system may become unresponsive during shutdown when the NFS client attempts to unmount exported directories after udev has stopped. To prevent this, a local.d script(Gentoo) can be used to forcibly unmount the exported directories during shutdown:
#write in "/etc/local.d/NFS_umount.stop"
/bin/umount -a -f -t nfs
Remember to add "x" permission:
chmod +x NFS_umount.stop
Verify which NFS daemons are running:
Gentoo > rpcinfo -p
program vers proto port service
tcp portmapper
udp portmapper
udp status
tcp status
udp mountd
tcp mountd
tcp nfs
tcp nfs
udp nfs
udp nfs
udp nlockmgr
List the exported directories from the NFS server:
Gentoo > exportfs -v
/export 10.1.7.0/(rw,wdelay,crossmnt,insecure,root_squash,no_subtree_check,fsid=,sec=sys,rw,insecure,root_squash,no_all_squash)
List the established connections:
Gentoo > ss -tuanp | grep
udp UNCONN *: *:*
udp UNCONN ::: :::*
tcp LISTEN *: *:*
tcp LISTEN ::: :::*
专题:NFSv4 file server的更多相关文章
- How to setup vsftpd FTP file Server on Redhat 7 Linux
Forward from: https://linuxconfig.org/how-to-setup-vsftpd-ftp-file-server-on-redhat-7-linux How to s ...
- java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file Server/Request
Linux服务器上,将本地编译好的文件上传后,Tomcat启动时报错: Exception in thread "Thread-2" java.lang.ClassFormatEr ...
- Creating a simple static file server with Rewrite--reference
Today, I’d like to take a quick moment to demonstrate how to make a simple file server using Rewrite ...
- Http File Server小工具
一般情况下,在做一些测试(比如下载服务)的时候需要提供一个http文件下载服务. 下面这个轻量级的工具HFS可以在本地提供http服务: 官网地址传送门:Http File Server
- deno学习四 docker 运行官方的一个http file server
github 上已经有人搞了一个deno 的docker 镜像,是基于源码编译的,挺好的 所以结合官方的http server demo 使用docker 运行 环境准备 docker-compose ...
- [.NET] 使用HttpClient操作HFS (HTTP File Server)
前言 本篇文章介绍如何使用HttpClient操作HFS (HTTP File Server),为自己留个纪录也希望能帮助到有需要的开发人员.关于HTTP File Server的介绍.安装.设定,可 ...
- HFS ~ Http File Server
HFS ~ Http File Server官网:https://www.rejetto.com/hfs/ 官方下载地址:https://www.rejetto.com/hfs/hfs.exe
- flash as3 socket安全服务网关(socket policy file server)
关键字: SecurityErrorEvent socket as3 flash有着自己的一套安全处理模式,在socket方面,我这样的菜鸟无法理解他的好处:一句话,不怀好意的人如果想用flash写一 ...
- GPO - File Server Management
Creating disk space usage quotas: File Screening Generate Storage Report, including file edit audit. ...
随机推荐
- 运维 05 Shell基本命令
Shell基本命令 前言 前面咱们已经成功安装了Linux系统--centos7,那么现在跟着超哥奔向Linux的大门. Linux命令行的组成结构 [root@oldboy_python ~]# ...
- Ubuntu16.04搜狗拼音输入法候选栏无法显示中文(英文乱码)
输入中文时,若候选栏显示英文乱码.无法显示中文,如下图所示,可按如下方式处理: cd ~/.config rm -rf SogouPY* sogou* 然后注销重新登录即可.
- Python删除列表中的空格
list1 = ['122','2333','3444',' ','422',' ',' ','54',' '] list1=[x.strip() for x in list1 if x.strip( ...
- 通过rocketmq思考一下mq的设计取舍
1. RocketMQ路由中心NameServer 2. RocketMQ消息发送 3. RocketMQ消息存储 4. RocketMQ消息消费 5. 消息过滤FiterServer 6. Rock ...
- python面试题之docstring是什么?
Docstring是一种文档字符串,用于解释构造的作用.我们在函数.类或方法中将它放在首位来描述其作用.我们用三个单引号或双引号来声明docstring. >>> def sayhi ...
- 4154: [Ipsc2015]Generating Synergy
Description 给定一棵以1为根的有根树,初始所有节点颜色为1,每次将距离节点a不超过l的a的子节点染成c,或询问点a的颜色 区间修改单点查询kdtree #include<iostre ...
- ASP.NET MVC 学习笔记之TempData、HttpContext和HttpContextBase杂谈
TempData本质上是Session 但是有一点不同的是,TempData被赋值之后,一旦被Action访问一次之后,马上就会清空. System.Web.HttpContext 和System.W ...
- VMware虚拟机提示找不到vmnetbridge.dl文件的解决办法
把vmware workstation删了重装,估计是异地安装包在安装时候出现的问题. 先把安装包拷贝到本地,然后控制面板上把已有的vmware workstation删除. 最后重新安装VMware ...
- docker 部署 mysql8 的 docker-compose 文件编写
version: '3.4' services: mysql: container_name: platform.mysql. deploy: resources: limits: memory: 3 ...
- poj 2752 kmp的next数组
题目大意: 求一个字符串中某一个既是前缀又是后缀的前缀的结尾下标: 基本思路: 从_next[len]开始找_next[_next[len]],再找_next[_next[_next[len]]],一 ...