FastDFS--storage文件上传和下载问题

>>> ret = client.upload_by_filename('/home/python/Desktop/1.jpg')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/python/.virtualenvs/meiduo/lib/python3.5/site-packages/fdfs_client/client.py", line 90, in upload_by_filename
store_serv = tc.tracker_query_storage_stor_without_group()
File "/home/python/.virtualenvs/meiduo/lib/python3.5/site-packages/fdfs_client/tracker_client.py", line 381, in tracker_query_storage_stor_without_group
raise DataError('[-] Error: %d, %s' % (th.status, os.strerror(th.status)))
fdfs_client.exceptions.DataError: [-] Error: 2, No such file or directory

 

出现此类问题的原因是因为storage启动时设置的IP或端口和python中链接文件(如:client.conf)中的IP地址不一致所导致的

解决方案:

将本机地址设置为固定IP后将本机IP和storage启动时设置的IP以及端口和python中链接文件(如:client.conf)中的IP地址保持一致

上一篇:FastDFS上传下载原理解析


下一篇:docker 搭建fastdfs 并实现上传下载