将二进制文件上载到Openstack Swift时出错

将二进制文件上载到Openstack Swift时出错,openstack,openstack-swift,Openstack,Openstack Swift,我正试图上传一个二进制文件,我必须打开堆栈Swift。此文件的大小为129MB。我正在使用Python客户端上载: swift_client = swiftclient.Connection(preauthurl=swift_public_auth_url,preauthtoken=swift_access_token,auth_version="2.0",insecure=True,tenant_name="admin") with open("/path/to/file/file.ckpt"

我正试图上传一个二进制文件,我必须打开堆栈Swift。此文件的大小为129MB。我正在使用Python客户端上载:

swift_client = swiftclient.Connection(preauthurl=swift_public_auth_url,preauthtoken=swift_access_token,auth_version="2.0",insecure=True,tenant_name="admin")
with open("/path/to/file/file.ckpt", 'r') as read_file:
    swift_client.put_object(swift_container_name, 'file.ckpt', contents= read_file.read(),content_type='text/plain')
    print "done"
这会引发以下错误:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1824, in put_object
    response_dict=response_dict)
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1673, in _retry
    service_token=self.service_token, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1322, in put_object
    raise ClientException.from_response(resp, 'Object PUT failed', body)
swiftclient.exceptions.ClientException: Object PUT failed: https://abc.xyz/swift/v1/AUTH_123456789abcdefghijklmn/container/file.ckpt 413 Request Entity Too Large  [first 60 chars of response] <html>
<head><title>413 Request Entity Too Large</title></h
回溯(最近一次呼叫最后一次):
文件“”,第2行,在
文件“/usr/local/lib/python2.7/dist packages/swiftclient/client.py”,第1824行,在put_对象中
响应(dict=响应(dict)
文件“/usr/local/lib/python2.7/dist-packages/swiftclient/client.py”,第1673行,在
服务令牌=自助服务令牌,**kwargs)
文件“/usr/local/lib/python2.7/dist packages/swiftclient/client.py”,第1322行,在put_对象中
从_响应引发客户端异常(响应“对象放置失败”,正文)
swiftclient.exceptions.ClientException:对象放置失败:https://abc.xyz/swift/v1/AUTH_123456789abcdefghijklmn/container/file.ckpt 413请求实体太大[响应的前60个字符]

413请求实体太大发现问题是由于我的Nginx代理服务器上的配置造成的。通过增加客户端的最大大小来修复它。详情如下: