sudo radosgw-admin metadata get user:tuanzi > user.md.json vi user.md.json #to add ssd-placement {
"key": "user:tuanzi",
"ver": {
"tag": "__gHSAD0K7rEZcQ2m3qT_RWk",
"ver":
},
"mtime": "2017-02-27 06:48:17.488750Z",
"data": {
"user_id": "tuanzi",
"display_name": "tuanzi",
"email": "",
"suspended": ,
"max_buckets": ,
"auid": ,
"subusers": [],
"keys": [
{
"user": "tuanzi",
"access_key": "xxx",
"secret_key": "xxx"
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "ssd-placement",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"max_size_kb": -,
"max_objects": -
},
"user_quota": {
"enabled": false,
"max_size_kb": -,
"max_objects": -
},
"temp_url_keys": [],
"attrs": [
{
"key": "user.rgw.idtag",
"val": ""
},
{
"key": "user.rgw.manifest",
"val": ""
}
]
}
} sudo radosgw-admin metadata put user:tuanzi <user.md.json
$ radosgw-admin region get > region.conf.json
$ cat region.conf.json
{ "name": "default",
"api_name": "",
"is_master": "true",
"endpoints": [],
"master_zone": "",
"zones": [
{ "name": "default",
"endpoints": [],
"log_meta": "false",
"log_data": "false"}],
"placement_targets": [
{ "name": "default-placement",
"tags": []}],
"default_placement": "default-placement"} #<edit region config, add a new placement target> { "name": "default",
"api_name": "",
"is_master": "true",
"endpoints": [],
"master_zone": "",
"zones": [
{ "name": "default",
"endpoints": [],
"log_meta": "false",
"log_data": "false"}],
"placement_targets": [
{ "name": "default-placement",
"tags": []},
{ "name": "ssd-placement",
"tags": []}],
"default_placement": "default-placement"} $ radosgw-admin region set < region.conf.json
sudo radosgw-admin zone get --rgw-zone=default >zone.json #先创建在SSD设备上的default.rgw.buckets.data.ssd pool vi zone.json # add ssd-placement
{
"id": "3d240698-79c4-4af0-abab-6b83b340a538",
"name": "default",
"domain_root": "default.rgw.data.root",
"control_pool": "default.rgw.control",
"gc_pool": "default.rgw.gc",
"log_pool": "default.rgw.log",
"intent_log_pool": "default.rgw.intent-log",
"usage_log_pool": "default.rgw.usage",
"user_keys_pool": "default.rgw.users.keys",
"user_email_pool": "default.rgw.users.email",
"user_swift_pool": "default.rgw.users.swift",
"user_uid_pool": "default.rgw.users.uid",
"system_key": {
"access_key": "",
"secret_key": ""
},
"placement_pools": [
{
"key": "default-placement",
"val": {
"index_pool": "default.rgw.buckets.index",
"data_pool": "default.rgw.buckets.data",
"data_extra_pool": "default.rgw.buckets.non-ec",
"index_type":
}
},
{
"key": "ssd-placement",
"val": {
"index_pool": "default.rgw.buckets.index",
"data_pool": "default.rgw.buckets.data.ssd",
"data_extra_pool": "default.rgw.buckets.non-ec",
"index_type":
}
}
],
"metadata_heap": "default.rgw.meta",
"realm_id": ""
} sudo radosgw-admin zone set --rgw-zone=default --infile zone.json
设置以上规则后,再创建的bucket 放置规则是新的ssd-placement规则了。
http://cephnotes.ksperis.com/blog/2014/11/28/placement-pools-on-rados-gw
https://blog.widodh.nl/2013/11/changing-the-region-of-a-rgw-bucket/