NFS服务搭建使用
需求:由于线上业务有一些数据存在了Redis数据库和mysql数据库中了,导致了数据较大迁移起来比较麻烦,所以准备搭建NFS来做WEB的共享磁盘,存储这些数据。
服务端搭建:
查看本机关于nfs的包
[root@vm-10-112-38-104 ]# yum search nfs
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: 10.127.91.220:8050
* epel: 10.183.91.217:8050
* extras: 10.127.91.220:8050
* le-pkgs: 10.183.91.217:8050
* updates: 10.127.91.220:8050
base | 3.0 kB 00:00
epel | 3.0 kB 00:00
epel/primary_db | 14 MB 00:00
extras | 2.9 kB 00:00
le-pkgs | 2.9 kB 00:00
le-pkgs/primary_db | 17 kB 00:00
updates | 2.9 kB 00:00
updates/primary_db | 8.2 MB 00:00
================================================================================== N/S Matched: nfs ==================================================================================
nfs-ganesha.x86_64 : NFS Server running in user space
nfs-ganesha-nullfs.x86_64 : The NFS-GANESHA's NULLFS Stackable FSAL
nfs-ganesha-proxy.x86_64 : The NFS-GANESHA's PROXY FSAL
nfs-ganesha-utils.x86_64 : The NFS-GANESHA's util scripts
nfs-ganesha-vfs.x86_64 : The NFS-GANESHA's VFS FSAL
nfs-utils.x86_64 : NFS utilities and supporting clients and daemons for the kernel NFS server
nfs-utils-lib-devel.i686 : Development files for the nfs-utils-lib library
nfs-utils-lib-devel.x86_64 : Development files for the nfs-utils-lib library
nfs4-acl-tools.x86_64 : The nfs4 ACL tools
nfsometer.noarch : NFS Performance Framework Tool
pcp-pmda-nfsclient.x86_64 : Performance Co-Pilot (PCP) metrics for NFS Clients
perl-File-NFSLock.noarch : Perl module to do NFS (or not) locking
sblim-cmpi-nfsv3.i686 : SBLIM nfsv3 instrumentation
sblim-cmpi-nfsv3.x86_64 : SBLIM nfsv3 instrumentation
sblim-cmpi-nfsv3-test.x86_64 : SBLIM Nfsv3 Instrumentation Testcases
sblim-cmpi-nfsv4.i686 : SBLIM nfsv4 instrumentation
sblim-cmpi-nfsv4.x86_64 : SBLIM nfsv4 instrumentation
sblim-cmpi-nfsv4-test.x86_64 : SBLIM Nfsv4 Instrumentation Testcases
fedfs-utils-devel.i686 : Development files for the FedFS NFS plug-in
fedfs-utils-devel.x86_64 : Development files for the FedFS NFS plug-in
fedfs-utils-lib.i686 : The FedFS NFS plug-in run-time library
fedfs-utils-lib.x86_64 : The FedFS NFS plug-in run-time library
funionfs.x86_64 : Union filesystem in userspace
nfs-ganesha-mount-9P.x86_64 : a 9p mount helper
nfs-utils-lib.x86_64 : Network File System Support Library
nfs-utils-lib.i686 : Network File System Support Library
pcp-pmda-slurm.x86_64 : Performance Co-Pilot (PCP) metrics for NFS Clients Name and summary matches only, use "search all" for everything.
[root@vm-10-112-38-104]#
yum 安装,启动 (有错误,是因为rpcbind服务没启动)
[root@vm-10-112-38-104 ]#yum install nfs-utils-* -y
[root@vm-10-112-38-104 ]# /etc/init.d/nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
[FAILED]
Starting NFS mountd: [FAILED]
Starting NFS daemon:
先启动rpcbind服务
[root@vm-10-112-38-104 ]# /etc/init.d/rpcbind restart
Stopping rpcbind: [FAILED]
Starting rpcbind: [ OK ]
[root@vm-10-112-38-104 ]# /etc/init.d/rpcbind restart
启动NFS服务
[root@vm-10-112-38-104 ~]# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
Starting RPC idmapd: [ OK ]
更改配置文件: 共享/nfs目录,rw读写权限,sync时时同步,no_root_squash root用户有所有权限,no_subtree_check如果卷的一部分被输出,从客户端发出请求文件的一个常规的调用子目录检查验证卷的相应部分。如果是整个卷输出,禁止这个检查可以加速传输。
[root@vm-10-112-38-104 ~]# vi /etc/exports /nfs *(rw,sync,no_root_squash,no_subtree_check)
客户端测试:
挂载到本地目录:
[root@vm-10-129-93-51 ~]# mkdir /nfs
[root@vm-10-129-93-51 ~]#
[root@vm-10-129-93-51 ~]#
[root@vm-10-129-93-51 ~]#
[root@vm-10-129-93-51 ~]#
[root@vm-10-129-93-51 ~]#
[root@vm-10-129-93-51 ~]# mount -t nfs 10.112.38.104:/nfs /nfs
[root@vm-10-129-93-51 ~]#
写入/etc/fstab ,开机自动加载
echo "10.112.x.x:/nfs /nfs nfs defaults 0 0" >> /etc/fstab
NFS服务搭建使用的更多相关文章
- Linux下网络文件系统NFS服务搭建易错点总结
一.环境准备: 1 [root@czh ~]# cat /etc/redhat-release 2 CentOS release 6.7 (Final) 3 [root@czh ~]# uname - ...
- NFS服务搭建与配置
启动NFS SERVER之前,首先要启动RPC服务(CentOS5.8下为portmap服务,CentOS6.6下为rpcbind服务,下同),否则NFS SERVER就无法向RPC服务注册了.另外, ...
- Llinux,NFS服务搭建(文件共享)
NFS配置文件权限参数说明(/etc/exports) 1.rw :表示可读写权限. 2.ro :表示只读权限. 3.sync :请求或写入数据时,数据同步写入到NFS Server的硬盘后才返回.( ...
- linux服务搭建----NFS服务搭建
nfs 服务 //配置脚本 /etc/exports //服务器 发布目录 1> 确定需要发布的目录(想要共享的目录) 例如: 想发 ...
- Linux之NFS服务搭建及autofs服务搭建
NFS 网络文件系统,英文Network File System(NFS),是由SUN公司研制的UNIX表示层协议(presentation layer protocol),能使使用者访问网络上别处的 ...
- Linux搭建NFS服务
一.NFS服务简单介绍 NFS(Network File System)即网络文件系统,是FreeBSD支持的文件系统中的一种,它允许网络中的计算机之间通过TCP/IP网络共享资源.在NFS的应用中, ...
- Ubuntu下NFS,TFTP服务搭建
环境:Ubuntu 一. 搭建NFS服务器 (1)安装: sudo apt-get install nfs-kernel-server #安装NFS服务器端 sudo apt-get instal ...
- NFS服务自动搭建及挂载脚本
一.写脚本的动机 由于最近老是搭建NFS,虽然不复杂,但是很繁琐.安装服务.修改配置文件.手动挂载.写入开机自动挂载等于是就写了一个脚本 二.脚本说明及审明 作用:该脚本主要实现NFS自动安装,客户端 ...
- ubuntu 16.04 nfs服务的搭建
nfs服务是实现Linux和Linux之间的文件共享,nfs服务的搭建比较简单. 现在介绍如何在ubuntu16.04系统中搭建nfs服务,ubuntu的搭建比红帽的还要简单. 1.安装nfs服务 s ...
随机推荐
- linux下pip错误 ImportError: No module named 'pip_internal'
wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate sudo python get-pip.py
- windows10下“sqlplus / as sysdba”执行提示无权限解决办法
ORA_DBA:是ORACLE 的特有用户,是超级管理员权限,建成DBA 它具有管理数据库的最高权限. 注明:需要以管理员身份运行cmd,不然第4步会失败(点开始,输入cmd,右键以管理员身份运行) ...
- Oracle_11g桌面版 中解决被锁定的scott 教学数据库的方法
Oracle 11g中修改被锁定的用户:scott 在安装完Oracle10g和创建完oracle数据库之后,想用数据库自带的用户scott登录,看看连接是否成功. 在cmd命令中,用“sqlplus ...
- 初学者:__init__.py文件的作用
__init__.py 文件的作用及意义 __init__.py文件是一个包必须的文件,即使它是空的,但也是必须的,如果没有这个文件,python将不会把该文件夹当做一个package,而仅仅是一个d ...
- java枚举常见用法
用法一:常量 在JDK1.5 之前,我们定义常量都是: public static fianl.... .现在好了,有了枚举,可以把相关的常量分组到一个枚举类型里,而且枚举提供了比常量更多的方法. p ...
- 用JavaScript动态实现单元格合并
不太想描述,大家自行理解吧,这样可能记忆会深一点儿- <script type="text/javascript"> function mergeCells(){ va ...
- Go语言中的运算符
## 1 概述Go语言提供了,算术,关系,逻辑,位,指针,赋值运算符.本篇整体说明一下. ## 2 算术运算 * \+ 相加* \- 相减* \* 相乘* / 相除* % 求余* ++ 自增* \-\ ...
- 记一次 Android 客户端(CJYYKT)的逆向
主角: 描述: 湖南省教育局推的一款大学生 App,需要每个学生看完里面的一个课程的视频,共 8 章,每章 10 - 23 个视频(连续播放大约 24 小时),每个视频每隔不定时间就会弹出一个选择题答 ...
- POJ2431_Expedition_KEY
题目传送门 由题目可得,在一条路上有N个加油站,在距离终点a[i](细节)的位置上,你需要通过长度为L的路,油箱的容量是无限的,但是初始只有P点油,经过每个加油站时可以选择加b[i]的油,问最少加油几 ...
- hive 优化
参考: http://www.csdn.net/article/2015-01-13/2823530 http://www.cnblogs.com/smartloli/p/4288493.html h ...