GlusterFS 配置及使用 二 :Windows挂载GlusterFS

前言:GlusterFS服务器搭建完成后,Client可以采用NFS、GlusterFS、Samba方式提供给客户端,NFS、Samba方式适用于Windows、Linux

 

一、安装GlusterFS和rpcbind(他是一个RPC服务,主要是在nfs共享时候负责通知客户端,服务器的nfs端口号的。简单理解rpc就是一个中介服务。)

yum install -y glusterfs-server samba rpcbind

systemctl start glusterd.service

systemctl enable glusterd.service

systemctl start rpcbind                                               // rpcbind 用于以nfs方式挂载

systemctl enable rpcbind

systemctl status rpcbind

 

二、开启卷glusterFS volume的nfs服务,如下:

gluster volume list

gluster volume set gvz00 nfs.disable off

gluster volume info gvz00

=====================================================================

一、windows client端操作

1、cmd 下 mount 192.168.120.128:/gv1 Z:

成功挂载,打开我的点脑,你即可在你网络位置看到 Z:盘了

解释:gv1为共享的目录、Z为挂载的网络盘符

2、取消挂载:

直接在 我的电脑 里面鼠标点击取消映射网络驱动器 Z:

或者: win+R->cmd

输入: umount X:

(umount -a 取消所有网络驱动器)

 

3、修改windows对nfs分区只读属性

Windows NFS客户端使用mount命令挂载NFS服务之后,文件系统对Win只读,无法写入文件,无法新建文件夹,此时使用mount命令可以查看到如下状态:

可以看到UID=-2由于在存储设备上共享出来的NFS文件系统归属于root权限,并且无法修改该所属用户,而Windows通过UID=-2的用户去写,肯定写不进去。

解决办法就是让Win在挂载NFS的时候将UID和GID改成0即可:打开注册表:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default,增加两项:AnonymousUid,AnonymousGid,如图:

重新启动计算机,重新mount即可。此时就能在win7下对nfs文件系统进行读写操作了,跟本地磁盘一样。

查看mount属性,如下:

mount命令在win下的具体用法如下:

 

 打开网络磁盘、默认多了个.trashcan、这个文件默认linux是没有的、这是Gluster的回收站、这是3.7版本的功能

Trashcan 

暂时保存删除的数据,可指定删除的时间段,避免误删文件

 

 

二、如果windows出现 Network Error -53报错,需检查windows到GlusterFS服务器2049端口是否可达,rpcbind服务是否正常

C:\Users\fooadmin>mount -o anon 10.10.10.10:/share/ z:
Network Error - 53

Type 'NET HELPMSG 53' for more information.

三、windows默认未打开NFS读写权限 ,打开读写权限参考文章尾部 IBM Support 网站步骤

Open a command prompt with administrative rights. Run the following command:
For IBM Docs: 
umount –f W:
umount –f Y:
For Document Format Conversion:
umount –f W:
umount –f Y:Copier
Run:
nfsadmin client stop
Open Regedit and navigate to the following branch:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default
In the main window, right-click and select New > DWORD 32-bit Value. Set the name as AnonymousGID.
Right-click and select New > DWORD 32-bit Value again. Set the name as AnonymousUID.
Double-click on AnonymousGID and AnonymousUID, set the value as 0 and the base as Decimal respectively.
Click OK.
Close Regedit.
In the command prompt, run:
nfsadmin client start
Close the Windows Powershell Console.
Open a command prompt.
Run the following command in a command prompt (not Powershell) to set the NFS configuration:
nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i

 

Windows挂载Gluster复制卷

https://www.cnblogs.com/w787815/p/6888950.html

Windows_Server_2008_配置NFS服务器

https://wenku.baidu.com/view/c986f0bf5901020207409ce6.html

Windows_Server_2008_配置NFS服务器  IBM Support网站

https://www.ibm.com/support/knowledgecenter/en/SSFHJY_2.0.0/deploy/mount_the_nfs_share_on_windows_servers.html

 

Linux共享文件夹目录三种方法-NFS远程挂载,GlusterFS共享存储和samba共享目

https://www.freehao123.com/linux-gongxiang-nfs-guazai-glusterfs-s/

 

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以为您解答关于使用CentOS 7虚拟机搭建GlusterFS文件系统并挂载使用的问题。 GlusterFS是一种开源分布式文件系统,它可以将多个存储设备汇聚在一起,形成一个高可用性、高扩展性的存储池。在CentOS 7上,您可以使用以下步骤搭建GlusterFS文件系统并挂载使用: 1. 在两个或多个CentOS 7虚拟机中安装GlusterFS软件包,您可以使用以下命令: ``` yum install -y centos-release-gluster yum install -y glusterfs-server ``` 2. 在其中一个节点上创建一个GlusterFS卷,您可以使用以下命令: ``` gluster volume create <volume-name> <node1>:<brick-path> <node2>:<brick-path> ... ``` 其中,`<volume-name>`是卷的名称,`<nodeX>`是节点的IP地址或主机名,`<brick-path>`是卷中节点上的磁盘路径。 3. 启动GlusterFS卷,您可以使用以下命令: ``` gluster volume start <volume-name> ``` 4. 在客户端节点上安装GlusterFS软件包,您可以使用以下命令: ``` yum install -y centos-release-gluster yum install -y glusterfs-client ``` 5. 在客户端节点上挂载GlusterFS卷,您可以使用以下命令: ``` mount -t glusterfs <node1>:<volume-name> <mount-point> ``` 其中,`<node1>`是任意一个GlusterFS节点的IP地址或主机名,`<volume-name>`是卷的名称,`<mount-point>`是挂载点路径。 现在您已经成功搭建了GlusterFS文件系统并在客户端节点上挂载了该文件系统。您可以通过在任意一个节点上写入文件来测试该文件系统的功能。请注意,您需要在所有节点上启动GlusterFS卷,以确保该卷的高可用性和高扩展性。 希望这些步骤能够为您提供帮助。如果您有任何疑问或需要进一步的帮助,请随时告诉我。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值