我已经在 Ubuntu 14.04 64x 上设置了 LeoFS 1.22。我已经在另一台机器(OSx)上安装了 s3cmd。我可以通过 localhost 访问存储桶,但不能从另一个节点访问。
调试输出:ls
myuser: s3cmd ls
2016-07-18 22:03 s3://my-bucket
=> 成功。
但是,如果我尝试使用 s3cmd -la 检索内容,它会失败。附件是 s3cmd 的调试输出。它将一些地址解析为亚马逊。但是,我将代理设置为 s3cmd --configure 的一部分。它显然有效,否则 s3cmd -ls 将无法获取存储桶列表。但我无法检索存储桶内容。
存储桶设置的 access_key 与我在客户端中使用的相同。
leofs get-buckets 显示:
root@int1-mule-leofs:~# leofs-adm get-buckets
cluster id | bucket | owner | permissions | created at
-------------+--------------------+--------+------------------+---------------------------
leofs_1 | my-bucket | company | Me(full_control) | 2016-07-19 10:03:08 +1200
我创建了存储桶: leofs-adm add-bucket my-bucket b45bd725c1fab76da992
查看 ~/.s3cfg 显示:[默认] access_key = b45bd725c1fab76da992
我的 /private/etc/hosts (OSx 将主机配置放在此处)文件如下所示:
s3cmd -la -d 的调试输出
s3cmd la -d
DEBUG: s3cmd version 1.6.1
DEBUG: ConfigParser: Reading file '/Users/myuser/.s3cfg'
DEBUG: ConfigParser: access_key->b4...17_chars...2
DEBUG: ConfigParser: access_token->
DEBUG: ConfigParser: add_encoding_exts->
DEBUG: ConfigParser: add_headers->
DEBUG: ConfigParser: bucket_location->US
DEBUG: ConfigParser: ca_certs_file->
DEBUG: ConfigParser: cache_file->
DEBUG: ConfigParser: check_ssl_certificate->True
DEBUG: ConfigParser: check_ssl_hostname->True
DEBUG: ConfigParser: cloudfront_host->cloudfront.amazonaws.com
DEBUG: ConfigParser: default_mime_type->binary/octet-stream
DEBUG: ConfigParser: delay_updates->False
DEBUG: ConfigParser: delete_after->False
DEBUG: ConfigParser: delete_after_fetch->False
DEBUG: ConfigParser: delete_removed->False
DEBUG: ConfigParser: dry_run->False
DEBUG: ConfigParser: enable_multipart->True
DEBUG: ConfigParser: encoding->UTF-8
DEBUG: ConfigParser: encrypt->False
DEBUG: ConfigParser: expiry_date->
DEBUG: ConfigParser: expiry_days->
DEBUG: ConfigParser: expiry_prefix->
DEBUG: ConfigParser: follow_symlinks->False
DEBUG: ConfigParser: force->False
DEBUG: ConfigParser: get_continue->False
DEBUG: ConfigParser: gpg_command->/usr/local/bin/gpg
DEBUG: ConfigParser: gpg_decrypt->%(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
DEBUG: ConfigParser: gpg_encrypt->%(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
DEBUG: ConfigParser: gpg_passphrase->...-3_chars...
DEBUG: ConfigParser: guess_mime_type->True
DEBUG: ConfigParser: host_base->s3.amazonaws.com
DEBUG: ConfigParser: host_bucket->%(bucket)s.s3.amazonaws.com
DEBUG: ConfigParser: human_readable_sizes->False
DEBUG: ConfigParser: invalidate_default_index_on_cf->False
DEBUG: ConfigParser: invalidate_default_index_root_on_cf->True
DEBUG: ConfigParser: invalidate_on_cf->False
DEBUG: ConfigParser: kms_key->
DEBUG: ConfigParser: limitrate->0
DEBUG: ConfigParser: list_md5->False
DEBUG: ConfigParser: log_target_prefix->
DEBUG: ConfigParser: long_listing->False
DEBUG: ConfigParser: max_delete->-1
DEBUG: ConfigParser: mime_type->
DEBUG: ConfigParser: multipart_chunk_size_mb->15
DEBUG: ConfigParser: multipart_max_chunks->10000
DEBUG: ConfigParser: preserve_attrs->True
DEBUG: ConfigParser: progress_meter->True
DEBUG: ConfigParser: proxy_host->leofs.mycompany.co.nz
DEBUG: ConfigParser: proxy_port->8080
DEBUG: ConfigParser: put_continue->False
DEBUG: ConfigParser: recursive->False
DEBUG: ConfigParser: recv_chunk->65536
DEBUG: ConfigParser: reduced_redundancy->False
DEBUG: ConfigParser: requester_pays->False
DEBUG: ConfigParser: restore_days->1
DEBUG: ConfigParser: secret_key->4b...37_chars...1
DEBUG: ConfigParser: send_chunk->65536
DEBUG: ConfigParser: server_side_encryption->False
DEBUG: ConfigParser: signature_v2->False
DEBUG: ConfigParser: simpledb_host->sdb.amazonaws.com
DEBUG: ConfigParser: skip_existing->False
DEBUG: ConfigParser: socket_timeout->300
DEBUG: ConfigParser: stats->False
DEBUG: ConfigParser: stop_on_error->False
DEBUG: ConfigParser: storage_class->
DEBUG: ConfigParser: urlencoding_mode->normal
DEBUG: ConfigParser: use_https->False
DEBUG: ConfigParser: use_mime_magic->True
DEBUG: ConfigParser: verbosity->WARNING
DEBUG: ConfigParser: website_endpoint->http://%(bucket)s.s3-website-%(location)s.amazonaws.com/
DEBUG: ConfigParser: website_error->
DEBUG: ConfigParser: website_index->index.html
DEBUG: Updating Config.Config cache_file ->
DEBUG: Updating Config.Config follow_symlinks -> False
DEBUG: Updating Config.Config verbosity -> 10
DEBUG: Unicodising 'la' using UTF-8
DEBUG: Command: la
DEBUG: CreateRequest: resource[uri]=/
DEBUG: Using signature v2
DEBUG: SignHeaders: 'GET\n\n\n\nx-amz-date:Tue, 19 Jul 2016 02:00:23 +0000\n/'
DEBUG: Processing request, please wait...
DEBUG: get_hostname(None): s3.amazonaws.com
DEBUG: ConnMan.get(): creating new connection: proxy://leofs.mycompany.co.nz:8080
DEBUG: proxied HTTPConnection(leofs.mycompany.co.nz, 8080)
DEBUG: get_hostname(None): s3.amazonaws.com
DEBUG: format_uri(): http://s3.amazonaws.com/
DEBUG: Sending request method_string='GET', uri='http://s3.amazonaws.com/', headers={'Authorization': 'AWS b45bd725c1fab76da992:kBJdcK6noSjywJKeWc9PvS8DFaA=', 'x-amz-date': 'Tue, 19 Jul 2016 02:00:23 +0000'}, body=(0 bytes)
DEBUG: Response: {'status': 200, 'headers': {'date': 'Tue, 19 Jul 2016 02:00:22 GMT', 'connection': 'keep-alive', 'content-type': 'application/xml', 'content-length': '317', 'server': 'LeoFS'}, 'reason': 'OK', 'data': '<?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01"><Owner><ID>LeoFS</ID><DisplayName>webfile</DisplayName></Owner><Buckets><Bucket><Name>my-bucket</Name><CreationDate>2016-07-18T22:03:08.000Z</CreationDate></Bucket></Buckets></ListAllMyBucketsResult>'}
DEBUG: ConnMan.put(): closing proxy connection (keep-alive not yet supported)
DEBUG: Bucket 's3://my-bucket':
DEBUG: CreateRequest: resource[uri]=/
DEBUG: Using signature v4
DEBUG: get_hostname(my-bucket): my-bucket.s3.amazonaws.com
DEBUG: canonical_headers = host:my-bucket.s3.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20160719T020023Z
DEBUG: Canonical Request:
GET
/
delimiter=%2F
host:my-bucket.s3.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20160719T020023Z
host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
----------------------
DEBUG: signature-v4 headers: {'x-amz-content-sha256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': 'AWS4-HMAC-SHA256 Credential=b45bd725c1fab76da992/20160719/US/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=b8611e21d26cb1dfdb36f406daf813dd8b9853865eac54cf2a39f2d73bebad95', 'x-amz-date': '20160719T020023Z'}
DEBUG: Processing request, please wait...
DEBUG: get_hostname(my-bucket): my-bucket.s3.amazonaws.com
DEBUG: ConnMan.get(): creating new connection: proxy://leofs.mycompany.co.nz:8080
DEBUG: proxied HTTPConnection(leofs.mycompany.co.nz, 8080)
DEBUG: get_hostname(my-bucket): my-bucket.s3.amazonaws.com
DEBUG: format_uri(): http://my-bucket.s3.amazonaws.com/?delimiter=/
DEBUG: Sending request method_string='GET', uri='http://my-bucket.s3.amazonaws.com/?delimiter=/', headers={'x-amz-content-sha256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': 'AWS4-HMAC-SHA256 Credential=b45bd725c1fab76da992/20160719/US/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=b8611e21d26cb1dfdb36f406daf813dd8b9853865eac54cf2a39f2d73bebad95', 'x-amz-date': '20160719T020023Z'}, body=(0 bytes)
DEBUG: Response: {'status': 403, 'headers': {'date': 'Tue, 19 Jul 2016 02:00:22 GMT', 'connection': 'keep-alive', 'content-length': '173', 'server': 'LeoFS'}, 'reason': 'Forbidden', 'data': '<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access Denied</Message><Resource>my-bucket/</Resource><RequestId></RequestId></Error>'}
DEBUG: ConnMan.put(): closing proxy connection (keep-alive not yet supported)
DEBUG: S3Error: 403 (Forbidden)
DEBUG: HttpHeader: date: Tue, 19 Jul 2016 02:00:22 GMT
DEBUG: HttpHeader: connection: keep-alive
DEBUG: HttpHeader: content-length: 173
DEBUG: HttpHeader: server: LeoFS
DEBUG: ErrorXML: Code: 'AccessDenied'
DEBUG: ErrorXML: Message: 'Access Denied'
DEBUG: ErrorXML: Resource: 'my-bucket/'
DEBUG: ErrorXML: RequestId: None
ERROR: Access to bucket 'my-bucket' was denied
ERROR: S3 error: 403 (AccessDenied): Access Denied