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 ...
随机推荐
- python 浅拷贝和深拷贝(9)
何谓浅拷贝/深拷贝,说得直白一点,其实就是数据拷贝,两者到底有什么区别呢?听着就挺迷糊的,python开发项目的时候说不定你就能碰上这样的坑~~ 一.普通的变量赋值 我们平常使用的变量赋值就是 ...
- Linux中buff/cache内存占用过高解决办法
在Linux系统中,我们经常用free命令来查看系统内存的使用状态.在一个centos7的系统上,free命令的显示内容大概是这样一个状态: 这个命令几乎是每一个使用过Linux的人必会的命令,但越是 ...
- 爬虫请求库之selenium
一.介绍 selenium最初是一个自动化测试工具,而爬虫中使用它主要是为了解决requests无法直接执行JavaScript代码的问题 selenium本质是通过驱动浏览器,完全模拟浏览器的操作, ...
- 编写第一个Linux环境下程序的编译,下载记录
跟着韦东山学习Linux: 今天系统系统性的学了代码的编译下载,条记录一下: 一,代码:001_led_on.S,就把下面代码编译后Bin文件下载进2440处理器. /* * 点亮LED1: gpf4 ...
- as3效率优化
1.改进算法无论对于那一种程序,好的算法总是非常重要的,而且能够极大地提高程序性能,所以任何性能的优化第一步就是从算法或者说程序逻辑的优化开始,检查自己的程序是否有多余的运算,是否在没有必要的时候做了 ...
- net core quartz调度 warp打包 nssm部署到windowsservice
介绍下一款vue.js实现的基于core2.1 quartz.net调度框架,独立部署不依赖数据库,只需要实现不同业务接口,配置调度时间即可 github:https://github.com/cq- ...
- FreeMarker 教程整理
Freemarker新手教程 http://blog.csdn.net/qq_23994787/article/details/77506980 FreeMarker教程整理 http://blo ...
- 流程activiti的组和用户的使用
一.数据表增加用户和分组 1.建立用户 2.建立组 3.建立用户和组的关联关系 二.新建测试流程 1.流程整体 2.设置“部门经理”任务的属性,填写组的ID 3.设置“总经理”任务的属性,填写组的ID ...
- 大数据相关技术原理资料整理(hdfs, spark, hbase, kafka, zookeeper, redis, hive, flink, k8s, OpenTSDB, InfluxDB, yarn)
hdfs: hdfs官方文档 深入理解HDFS的架构和原理 https://blog.csdn.net/kezhong_wxl/article/details/76573901 HDFS原理解析(总体 ...
- 【转载】C#中List集合使用Remove方法移除指定的对象
在C#的List集合操作中,有时候需要将特定的对象或者元素移除出List集合序列中,此时可使用到List集合的Remove方法,Remove方法的方法签名为bool Remove(T item),it ...