【Azure 存储服务】如何把开启NFS 3.0协议的Azure Blob挂载在Linux VM中呢?(NFS: Network File System 网络文件系统)
问题描述
如何把开启NFS协议的Azure Blob挂载到Linux虚拟机中呢?
【答案】:可以使用 NFS 3.0 协议从基于 Linux 的 Azure 虚拟机 (VM) 或在本地运行的 Linux 系统,在 Blob 存储中装载容器
操作步骤
参考官方文档(Mount Blob storage by using the Network File System (NFS) 3.0 protocol: https://docs.microsoft.com/en-us/azure/storage/blobs/network-file-system-protocol-support-how-to)可以成功的让 NFS 3.0的Blob Mount到VM中。

准备条件:
1) 开启NFS的Azure Storage Account
2) Linux 虚拟机(本示例中使用的为 UbuntuServer 18.04-LTS)
3) Storage Account与Linux 处于同一虚拟网络中,并且在Storage Account中设置允许访问的子网。
注意事项:
1)在创建Storage Account的时候要先开启ADLS Gen 2.0 (即Enable Hierarchical namespace 和 Enable network file system v3)

2) 使用PuTTy,SSH登录到VM后,需要使用用root权限执行mount命令。 使用 sudo -i 切换到root目录中。同时,如果没有安装nfs helper会提示bad option消息。只需使用 sudo apt install nfs-common 安装nfs helper。

3)最终,使用正确的 Storage Account 和 Container 名称替换下面指令中的信息。
mkdir -p /mnt/test mount -o sec=sys,vers=3,nolock,proto=tcp <storage-account-name>.blob.core.chinacloudapi.cn:/<storage-account-name>/<container-name> /mnt/test #1: Replace the <storage-account-name> placeholder that appears in this command with the name of your storage account. #2:Replace the <container-name> placeholder with the name of your container.

如果遇见错误,可以参考文档后面的常见错误部分,在本次的实验中,就先后遇见了 Access denied by server while mounting 和 mount: /mnt/test: bad option;错误。
| Error | Cause / resolution |
|---|---|
Access denied by server while mounting |
Ensure that your client is running within a supported subnet. See the Supported network locations. |
No such file or directory |
Make sure to type the mount command and it's parameters directly into the terminal. If you copy and paste any part of this command into the terminal from another application, hidden characters in the pasted information might cause this error to appear. This error also might appear if the account isn't enabled for NFS 3.0. |
Permision denied |
The default mode of a newly created NFS v3 container is 0750. Non-root users do not have access to the volume. If access from non-root users is required, root user must change the mode to 0755. Sample command: sudo chmod 0755 /mnt/<newcontainer> |
EINVAL ("Invalid argument") |
This error can appear when a client attempts to:
|
EROFS ("Read-only file system") |
This error can appear when a client attempts to:
|
NFS3ERR_IO/EIO ("Input/output error") |
This error can appear when a client attempts to read, write, or set attributes on blobs that are stored in the archive access tier. |
OperationNotSupportedOnSymLink error |
This error can be returned during a write operation via a Blob or Azure Data Lake Storage Gen2 API. Using these APIs to write or delete symbolic links that are created by using NFS 3.0 is not allowed. Make sure to use the NFS v3 endpoint to work with symbolic links. |
mount: /mnt/test: bad option; |
Install the nfs helper program using sudo apt install nfs-common. |
参考文档
Mount Blob storage by using the Network File System (NFS) 3.0 protocol:https://docs.microsoft.com/en-us/azure/storage/blobs/network-file-system-protocol-support-how-to
【Azure 存储服务】如何把开启NFS 3.0协议的Azure Blob挂载在Linux VM中呢?(NFS: Network File System 网络文件系统)的更多相关文章
- NFS - Network File System网络文件系统
NFS(Network File System/网络文件系统): 设置Linux系统之间的文件共享(Linux与Windows中间文件共享采用SAMBA服务): NFS只是一种文件系统,本身没有传输功 ...
- nfs 是Network File System 网络文件系统
NFS的基本原刚是容许不同的客户端及服务通过一组PRC分享相同的文件系统,它是独立于操作系统,容许不同硬件及操作系统的系统共同进行文件的分享.NFS在文件传送过程中依赖于RPC协议.远程过程调用Rem ...
- 玩转Windows Azure存储服务——网盘
存储服务是除了计算服务之外最重要的云服务之一.说到云存储,大家可以想到很多产品,例如:AWS S3,Google Drive,百度云盘...而在Windows Azure中,存储服务却是在默默无闻的工 ...
- 解读 Windows Azure 存储服务的账单 – 带宽、事务数量,以及容量
经常有人询问我们,如何估算 Windows Azure 存储服务的成本,以便了解如何更好地构建一个经济有效的应用程序.本文我们将从带宽.事务数量,以及容量这三种存储成本的角度探讨这一问题. 在使用 W ...
- 【Azure 存储服务】代码版 Azure Storage Blob 生成 SAS (Shared Access Signature: 共享访问签名)
问题描述 在使用Azure存储服务,为了有效的保护Storage的Access Keys.可以使用另一种授权方式访问资源(Shared Access Signature: 共享访问签名), 它的好处可 ...
- NFS(Network File System)服务配置和使用
Sun公司开发NFS (Network File System)之初就是为了在不同linux/Unix系统之间共享文件或者文件夹.可以在本地通过网络挂载远程主机的共享文件,和远程主机交互.NFS共享存 ...
- Centos7——NFS(Network File System)服务
NFS(Network File System)即网络文件系统,允许计算机之间通过网络共享资源:在NFS客户端即可NFS服务端所共享的目录挂载到本地,此时即可像读写本地目录一样读写远程计算机的目录与文 ...
- NFS(Network File System)即网络文件系统 (转)
第1章 NFS介绍 1.1 NFS服务内容的概述 □ RPC服务知识概念介绍说明,以及RPC服务存在价值(必须理解掌握) □ NFS服务工作原理讲解(必须理解掌握) □ NFS共享文件系统使用原理讲解 ...
- CentOS7.5搭建NFS(Network File System)
NFS(Network File System)即网络文件系统,是由Sun公司开发的一种通过网络方式共享文件系统的通用共享解决方案.可以将远程Linux系统上的文件共享资源挂载到本地主机(Linux客 ...
随机推荐
- 对象赋值在PHP中到底是不是引用?
之前的文章中,我们说过变量赋值的问题,其中有一个问题是对象在进行变量赋值的时候,直接就是引用赋值.那么到底真实情况是怎样呢? 之前变量赋值的文章 PHP的变量赋值 对象引用测试 在继续深入的学习PHP ...
- pycharm向GitHub提交代码
设置为自动add commit代码 push代码 查看github,看到提交记录
- python学习笔记(十四)python实现发邮件
import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart u ...
- python序列类型及一些操作
序列分类 1.按存放的数据类型分类: 容器类型(能存放不同类型的数据):list.tuple.coolections.deque 扁平序列(只能存放一种类型的数据):str.bytes.bytearr ...
- YbtOJ#482-爬上山顶【凸壳,链表】
正题 题目链接:https://www.ybtoj.com.cn/contest/116/problem/2 题目大意 \(n\)个点,\(x\)坐标递增,第\(i\)个点向第\(j\)个点连边. 开 ...
- C# 显示、隐藏窗口对应的任务栏
WPF中全屏窗口,会自动隐藏任务栏. 那非全屏窗口如何隐藏任务栏?甚至有没有一种场景,隐藏任务后自定义一套系统任务栏来显示? 以下会分阶段讲述一些概念 1. 主屏任务栏 任务栏,其实也是一个窗口,主屏 ...
- P4544 [USACO10NOV]Buying Feed G
part 1 暴力 不难发现有一个 $\mathcal O(K^2n)$ 的基础 dp: $$f_{i,j+l}=\min(f_{i,j+l},f_{i-1,j}+(x_i-x_{i-1})\time ...
- C++学习笔记:09 函数模板与类模板
课程<C++语言程序设计进阶>清华大学 郑莉老师) 引入 考虑一个求绝对值函数myabs,对于int,double,float等数据类型需要重载多次,编写多个函数体.函数体逻辑代码完全一致 ...
- vue3 element-plus 配置json快速生成table列表组件,提升生产力近500%(已在公司使用,持续优化中)
️本文为博客园首发文章,未获授权禁止转载 大家好,我是aehyok,一个住在深圳城市的佛系码农♀️,如果你喜欢我的文章,可以通过点赞帮我聚集灵力️. 个人github仓库地址: https:gith ...
- 舌头算法的C++实现
观察生活,我们不难发现,吃饭的时候,有时候左边的东西会到右边来,这是为什么呢?就是舌头的作用了. 下面的代码将模拟舌头的运动: #include <iostream> #include & ...