7.2.6 测试S3 接口
1 安装需要的依赖包
apt-get install python-boto
2 新建python脚本:s3test.py
import boto
import boto.s3.connection
access_key = 'I0PJDPCIYZ665MW88W9R'
secret_key = 'dxaXZ8U90SXydYzyS5ivamEP20hkLSUViiaR+ZDA'
conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key,
host = '{hostname}', port = {port},
is_secure=False, calling_format = boto.s3.connection.OrdinaryCallingFormat(),
)
bucket = conn.create_bucket('my-new-bucket')
for bucket in conn.get_all_buckets():
print "{name}".format(
name = bucket.name,
created = bucket.creation_date,
)
3 运行和输出
运行脚本
python s3test.py
输出
my-new-bucket 2017-04-10T03:21:03.502Z
7.2.7 RGW相关
1、rgw配置完成后pool设置
...
default.rgw.buckets.index
default.rgw.buckets.data
...
index-pool可以建议放在纯ssd节点上,datapool放在hdd节点。
2、给 bucket 索引进行分片
在允许 bucket 中有大量对象时,能够有助于防止出现性能瓶颈。设置一个 bucket 的最大分片数,它的默认值为 0 ,这意味着 bucket 索引分片功能在默认情况下情况下是关闭的。如下将分片数设为4096:
rgw_override_bucket_index_max_shards = 4096