您的位置:首页 > 其它

Window Azure 之Azure Storage文件共享存储

2015-08-24 19:27 465 查看
今天就简单讲一下如何在Azure Storage账号创建文件共享,并挂载在Azure VM上。(顺便吐槽一下,中国Azure官方文档能不能翻译好一下,直译global azure 一回事,技术文档的校验完全没做好)
我们先在Azure上创建一个测试vm,具体可以参考:http://gshao.blog.51cto.com/3512873/1344846
1. 在Azure 上创建一个Storage账号;



2.登陆window azure powershell,配置下文件共享;
输入:
Get-AzurePublishSettingsFile -Environment AzureChinaCloud
mport-AzurePublishSettingsFile “****.publishsettings”(配置文件的路径)



配置存储账号上下文
$ctx=New-AzureStorageContext –StorageAccountName account-name –StorageAccountKey account-key -environment "AzureChinaCloud"(中国区才要加这个,global不用)
创建共享文件夹
$s=New-AzureStorageShare sharefiles(共享文件夹名) -Context $ctx



可以用命令查看file的情况:
输入:Get-AzureStorageFile –Share $s



3.在Azure VM挂载文件共享;
在powershell输入:
cmdkey /add:<storage-account-name>.file.core.windows.net /user:<storage-account-name> /pass:<storage-account-key>
这个是为了保存凭据,以便重启vm不会导致文件共享的登陆凭据丢失



添加文件共享存储:
net use z: \\ <storage-account>.file.core.chinacloudapi.cn\共享文件夹名 /u:<storage-account> <storage-account-key>






嗯,猜一下这个文件夹大概多少存储空间呢。答案是5TB



但是我蛮奇怪,中国azure的说法
(原话是
共享:文件存储共享是在 Azure 中的 SMB 2.1 文件共享。必须在父共享中创建所有目录和文件。一个帐户可以包含无限数量的共享,一个共享可以存储无限数量的文件,直至达到存储帐户的容量限制。


具体可以看一下中国Azure关于文件共享存储链接:http://www.windowsazure.cn/documentation/articles/storage-dotnet-how-to-use-files
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息