码迷,mamicode.com
首页 > 其他好文 > 详细

Azure 上为Liunx VM 挂载File类型的存储。

时间:2016-05-26 18:34:13      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:

1. Create a storage account in Azure, copy the storage account endpoint URL (with postfix of "file.core.chinacloudapi.cn") and storage access key to a temp file.

2. Download and install Azure CLI: https://www.azure.cn/documentation/articles/xplat-cli-install (REBOOT PC after installation).

3. Download and install latest Node.JS: https://nodejs.org/en/#download (Optional, in some case, Azure CLI may encounter problem)

4. Connect to the storage account and create sub-folders by Azure CLI.: https://www.azure.cn/documentation/articles/xplat-cli-connect  

4.1 open Azure CLI (CMD or PowerShell on Windows, Shell on Linux).  

4.2 for US Azure - Connect to Azure: azure login, then follow the instruction to login.     
for China Azure - Connect to Azure: azure login -e AzureChinaCloud -u username -p password  

4.3 Create share first: azure storage share create <nameofshare> -a <storage Accountname> -k <storage account access Key>  

4.4 Create folder for share: azure storage directory create --share <nameofshare> -p <nameofsharefolder> -a <storageAccountname> -k <storage account access Key>  

4.5 (optional for test), upload local file to the folder just created: azure storage file upload ‘c:\a.a‘ <nameofshare> <nameofsharefolder>

5. Mount to Linux server: https://www.azure.cn/documentation/articles/storage-how-to-use-files-linux (note: on that page, there are instruction for different Linux versions).
command for reference: host~$ sudo mount -t cifs //ACCOUNTNAME.file.core.windows.net/myshare /mnt/mountpoint -o vers=3.0,user=<StorageAccountName>,password=<StorageaccountAccessKey>,dir_mode=0777,file_mode=0777

5. Using utility like WinSCP connect to the linux server and check the mountpoint to verify the folder and file is there.

Azure 上为Liunx VM 挂载File类型的存储。

标签:

原文地址:http://www.cnblogs.com/markgao/p/5532064.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!