s3cmd新建桶,报错403如何解决!!!

一、/root/.s3cfg文件中access_key和secret_key与自己服务器的key不匹配导致

  • 这时我们在客户端查看
[root@client1 /]# radosgw-admin user create --uid="testuser" --display-name="First User"

{
    "user_id": "testuser",
    "display_name": "First User",
    "email": "",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [],
    "keys": [
        {
            "user": "testuser",
            "access_key": "RAU8280JGIHIJDP57HNY",
            "secret_key": "MOxvIWhvxmLVTlwss4OXDMACa7hlNa1DHO3EI1fq"
        }
    ],
    "swift_keys": [],
    "caps": [],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "check_on_raw": false,
        "max_size": -1,
        "max_size_kb": 0,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "check_on_raw": false,
        "max_size": -1,
        "max_size_kb": 0,
        "max_objects": -1
    },
    "temp_url_keys": [],
    "type": "rgw",
    "mfa_ids": []
}

  •  将文件中的access_key和secret_key值修改为上方标记内容
[root@client1 /]# vim /root/.s3cfg

[default]
access_key = RAU8280JGIHIJDP57HNY
secret_key = MOxvIWhvxmLVTlwss4OXDMACa7hlNa1DHO3EI1fq 
host_base = 192.168.10.200:7480
host_bucket = 192.168.10.200:7480/%(bucket)
cloudfront_host = 192.168.10.200:7480
use_https = False

  • 新建桶
[root@client1 /]# s3cmd mb s3://test_bucket

成功了!!!

Bucket 's3://test_bucket/' created

二、 有延迟,服务器之间没有反应过来

  • 我们在服务端重置key
[root@node1 ceph]ceph-deploy forgetkeys
  •  客户端创建rgw
​[root@node1 ceph]# ceph-deploy rgw create node1
[root@node1 ceph]# lsof -i:7480


COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
radosgw 15932 ceph   40u  IPv4  64489      0t0  TCP *:7480 (LISTEN)
  •  在客户端查看
[root@client1 /]# radosgw-admin user create --uid="testuser" --display-name="First User"

{
    "user_id": "testuser",
    "display_name": "First User",
    "email": "",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [],
    "keys": [
        {
            "user": "testuser",
            "access_key": "RAU8280JGIHIJDP57HNY",
            "secret_key": "MOxvIWhvxmLVTlwss4OXDMACa7hlNa1DHO3EI1fq"
        }
    ],
    "swift_keys": [],
    "caps": [],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "check_on_raw": false,
        "max_size": -1,
        "max_size_kb": 0,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "check_on_raw": false,
        "max_size": -1,
        "max_size_kb": 0,
        "max_objects": -1
    },
    "temp_url_keys": [],
    "type": "rgw",
    "mfa_ids": []
}

  •  将文件中的access_key和secret_key值修改为上方标记内容
[root@client1 /]# vim /root/.s3cfg

[default]
access_key = RAU8280JGIHIJDP57HNY
secret_key = MOxvIWhvxmLVTlwss4OXDMACa7hlNa1DHO3EI1fq 
host_base = 192.168.10.200:7480
host_bucket = 192.168.10.200:7480/%(bucket)
cloudfront_host = 192.168.10.200:7480
use_https = False

  • 新建桶
[root@client1 /]# s3cmd mb s3://test_bucket

成功了!!!

Bucket 's3://test_bucket/' created

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值