尝试创建文件共享时出错:无法建立新连接:[Errno -2]名称或服务未知" [英] ERROR when trying to create a file share: Failed to establish a new connection: [Errno -2] Name or service not known'
问题描述
我在Ubuntu 16.04中使用Python 3.6,用于创建文件共享的python sdk是:
I'm using Python 3.6 in Ubuntu 16.04, the python sdk I'm using for creating file share is:
azure-storage-file == 1.4.0
azure-storage-file==1.4.0
我按照文档操作,并在存储帐户中创建文件共享,如下所示:
I follow the document and create a file share in my storage account as follow:
azure.storage.file FileService
from azure.storage.file import FileService
'*****' '***'
file_service = FileService(account_name='*****', account_key='***')
'***' )
但是,我总是收到此错误:
However, I always receive this error:
urllib3.exceptions.MaxRetryError:HTTPSConnectionPool(host ='*****.file.core.windows.net',port = 443):URL超过最大重试次数:/****?restype = share(由NewConnectionError('< urllib3.connection.VerifiedHTTPSConnection object at 0x7f348a87c588>引起的: 无法建立新的连接:[Errno -2]名称或服务未知',))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='*****.file.core.windows.net', port=443): Max retries exceeded with url: /****?restype=share (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f348a87c588>: Failed to establish a new connection: [Errno -2] Name or service not known',))
推荐答案
utadamai,我试图在相同的环境下创建文件共享,并遵循此操作 教程, nd,我能够创建文件共享.您可以测试与端口445的连接性吗?您可以使用azure cli(选择Powershell来 测试连接性):
utadamai, I tried to create a files share with the same environments and following this tutorial, and I was able to create a file share. Could you test connectivity to port 445 ? You can use azure cli(choosing Powershell to test connectivity):
Test-NetConnection -ComputerName <your-storage-account-name>.file.core.windows.net -Port 445
如果成功,您应该得到以下结果:
If it is successful, you should get the below result:
ComputerName : <storage-account-host-name> RemoteAddress : <storage-account-ip-address> RemotePort : 445 InterfaceAlias : <your-network-interface> SourceAddress : <your-ip-address> TcpTestSucceeded : True
这篇关于尝试创建文件共享时出错:无法建立新连接:[Errno -2]名称或服务未知"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!