ubuntu14.04 部署nfs服务
安装nfs服务
apt-get install nfs-kernel-server
修改配置文件,共享目录为/var/www,*号可替换为客户端IP地址,*默认为任何部署了nfs客户端的IP可以挂载该目录(默认共享目录仅支持一台客户端挂载)
root@CS151230001:~# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
#/data2/html1/ *(rw,sync,no_root_squash,no_subtree_check)
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/var/www/ *(insecure,rw,sync,no_root_squash,no_subtree_check)
配置固定端口,方便添加防火墙策略,尤其是云服务器
root@CS151230001:~# cat /etc/default/nfs-kernel-server
# Number of servers to start up
RPCNFSDCOUNT=8 # Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0 # Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
RPCMOUNTDOPTS="--manage-gids --port 32767" # Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD="" # Options for rpc.svcgssd.
RPCSVCGSSDOPTS="" # Options for rpc.nfsd.
RPCNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"
root@CS151230001:~# cat /etc/default/nfs-common
# If you do not set values for the NEED_ options, they will be attempted
# autodetected; this should be sufficient for most people. Valid alternatives
# for the NEED_ options are "yes" and "no". # Do you want to start the statd daemon? It is not needed for NFSv4.
NEED_STATD= # Options for rpc.statd.
# Should rpc.statd listen on a specific port? This is especially useful
# when you have a port-based firewall. To use a fixed port, set this
# this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
# For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
STATDOPTS="--port 32765 --outgoing-port 32766" # Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=
重启以下服务
/etc/init.d/rpcbind restart
/etc/init.d/nfs-kernel-server restart
重载配置文件
exportfs -rv
查询监听端口
rpcinfo -p

测试是否共享目录成功
showmount -e 服务器IP地址
参考:
https://blog.csdn.net/yuanhangq220/article/details/82421183
NFS挂载时出现"access denied by server while mounting"的解决方法
1、使用了非法端口,也就是使用了大于1024的端口。
这个错误,可以通过查看日志确认:
[root@local~ /]# cat /var/log/messages | grep mount
Jan 2 12:49:04 localhost mountd[1644]: refused mount request from 192.168.0.100 for /home/nfsshare/ (/home/nfsshare): illegal port 1689
解决办法:
修改配置文件/etc/exports,加入 insecure 选项,重启nfs服务,再尝试挂载。
/home/nfsshare/ *(insecure,rw,async,no_root_squash)
http://www.heminjie.com/system/linux/2998.html
ubuntu14.04 部署nfs服务的更多相关文章
- [原创]ubuntu14.04部署ELK+redis日志分析系统
ubuntu14.04部署ELK+redis日志分析系统 [环境] host1:172.17.0.4 搭建ELK+redis服务 host2:172.17.0.3 搭建logstash+nginx服务 ...
- ubuntu14.04 server ftp 服务安装配置详解
ubuntu14.04 server ftp 服务安装配置详解 cheungmine 2016-01-27 http://wiki.ubuntu.com.cn/Vsftpd 0 安装好vsftpd服务 ...
- day03 部署NFS服务
day03 部署NFS服务 NFS的原理 1.什么是NFS 共享网络文件存储服务器 2.NFS的原理 1.用户访问NFS客户端,将请求转化为函数 2.NFS通过TCP/IP连接服务端 3.NFS服务端 ...
- ubuntu14.04部署kickstart
转自:http://www.mamicode.com/info-detail-1646465.html kickstart用于在内网自动安装系统. 使用pxe安装系统需要安装dhcp,tftp,htt ...
- LINUX 系统下部署 NFS服务
NFS服务 NFS,是Network File System的简写,即网络文件系统.也被称为NFS: NFS允许一个系统在网络上与他人共享目录和文件. NFS通常运行于2049端口. 部署NFS 前提 ...
- Linux部署NFS服务共享文件
NFS(网络文件系统)用于linux共享文件 第1步:配置所需要的环境 使用两台Linux主机 主机名称 操作系统 IP地址 NFS Centos7 192.168.218.139 NFSa Cent ...
- ubuntu12.04配置NFS服务详解
1:安装nfs sudo apt-get install nfs-kernel-server 2:配置服务 sudo vim /etc/exports 在末尾添加 /home/jyg *(rw,syn ...
- 阿里云 Ubuntu14.04 部署 LAMP
1.更新软件源 sudo apt-get update 2.安装Apache sudo apt-get install apache2 3.查看Apache是否安装成功 apache2 –v 如下所示 ...
- CentOS7 部署nfs服务
参考博客 参考博客 https://blog.51cto.com/addam/1576144 错误1: 客户端挂载nfs报错mount: wrong fs type, bad option, bad ...
随机推荐
- 文件上传速度查询方法(watch工具)
由于业务迁移,需要将大量文件拷贝到目标机器上的/mnt目录,在拷贝过程中,想要查看上传的速度,做法如下:[root@mail01 ~]# du -sh /mnt5.6G /mnt[root@mail0 ...
- 了解一下JVM和GC工作机制
题外话:很久没有写博客了,事情颇多,今天空闲下来,学习一下顺便写一下自己的了解,机会总是留给有准备的人,所以平常一定要注意知识的巩固和积累.知识的深度也要有一定的理解,不比别人知道的多,公司干嘛选你? ...
- python3的 基础
]print(list(set(lst))) # 面试题: # a = 10 # b = 20 # a,b = b,a # 10000% # print(b) # 10 # print(a ...
- day31——recv工作原理、高大上版解决粘包方式、基于UDP协议的socket通信
day31 recv工作原理 源码解释: Receive up to buffersize bytes from the socket. 接收来自socket缓冲区的字节数据, For the opt ...
- HTML常用技巧
1. 为网页链接添加快捷键:accesskey 属性 https://zhidao.baidu.com/question/2267343500557447508.html 2. 键盘事件设置快捷键:h ...
- win7远程服务器发生身份验证错误,要求的函数不受支持
远程服务器发生身份验证错误,要求的函数不受支持,远程登录服务器以前都是正常的,今天登录远程桌面就一直是这样的错误.记录一下解决方法. 方法一:卸载补丁KB41037181.打开控制面板,找到“程序和功 ...
- PyTorch工具
以装饰器添加所有代码对应的tensor的信息 https://github.com/zasdfgbnm/TorchSnooper
- dubbo源码阅读之服务目录
服务目录 服务目录对应的接口是Directory,这个接口里主要的方法是 List<Invoker<T>> list(Invocation invocation) throws ...
- input中blur失去焦点事件与点击事件冲突时如何解决
方法一 使用setTimeout $(function(){ $(".cy-name-input input").on({ focus:function() { $(". ...
- css列表滑动防止被底部遮住和适配屏幕长一点的机型处理
1.移动端处理列表滑动的时候,微信底下有自带的返回页面按钮,经常会被遮住,遇到屏幕长一点的,下面会短一大截,以下用此方法可以解决..container{ position:relative; back ...