The purpose of this test is to map a RadosGw Bucket to a specific Ceph pool. For exemple, if using a fast pool with ssd and a low pool for archive…

1
2
   standard_bucket datas  --> .rgw.buckets        (default pool)
specific_bucket datas --> .rgw.buckets.custom

First, we create a pool .rgw.buckets.custom, with, for example, some specific parameters (different size and different ruleset in crushmap) :

1
2
3
4
5
6
7
8
$ ceph osd pool create .rgw.buckets.custom 64 64
pool '.rgw.buckets.custom' created $ ceph osd pool set .rgw.buckets.custom size 2
set pool 59 size to 2 $ ceph osd pool set .rgw.buckets.custom crush_ruleset 6
set pool 59 crush_ruleset to 6

Then, we need to configure a specific placement_targets in region map and zone. For next step, you need to have a running config of rados-gw…

1
2
$ radosgw-admin region get > region.conf.json
$ vim region.conf.json # Add an entry in placement_targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{ "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": "custom-placement",
"tags": []}],
"default_placement": "default-placement"}
1
2
$ radosgw-admin region set < region.conf.json
....
1
2
$ radosgw-admin zone get > zone.conf.json
$ vim zone.conf.json # Add an entry in placement_pools with key "custom-placement"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ "domain_root": ".rgw",
"control_pool": ".rgw.control",
"gc_pool": ".rgw.gc",
"log_pool": ".log",
"intent_log_pool": ".intent-log",
"usage_log_pool": ".usage",
"user_keys_pool": ".users",
"user_email_pool": ".users.email",
"user_swift_pool": ".users.swift",
"user_uid_pool": ".users.uid",
"system_key": { "access_key": "",
"secret_key": ""},
"placement_pools": [
{ "key": "default-placement",
"val": { "index_pool": ".rgw.buckets.index",
"data_pool": ".rgw.buckets",
"data_extra_pool": ".rgw.buckets.extra"}},
{ "key": "custom-placement",
"val": { "index_pool": ".rgw.buckets.index",
"data_pool": ".rgw.buckets.custom",
"data_extra_pool": ".rgw.buckets.extra"}}]}
1
2
3
$ radosgw-admin zone set <zone.conf.json
2014-11-25 18:03:23.894153 7f728c0f2780 0 couldn't find old data placement pools config, setting up new ones for the zone
.....
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$ radosgw-admin regionmap update
{ "regions": [
{ "key": "default",
"val": { "name": "default",
"api_name": "",
"is_master": "true",
"endpoints": [],
"master_zone": "",
"zones": [
{ "name": "default",
"endpoints": [],
"log_meta": "false",
"log_data": "false"}],
"placement_targets": [
{ "name": "custom-placement",
"tags": []},
{ "name": "default-placement",
"tags": []}],
"default_placement": "default-placement"}}],
"master_region": "default",
"bucket_quota": { "enabled": false,
"max_size_kb": -1,
"max_objects": -1},
"user_quota": { "enabled": false,
"max_size_kb": -1,
"max_objects": -1}} $ /etc/init.d/radosgw reload
Reloading ...

To configure s3cmd for RadosGW you can have a look here : http://lollyrock.com/articles/s3cmd-with-radosgw/

Now we can test bucket creation :

1
2
3
4
5
6
7
8
9
$ s3cmd mb s3://custombucket --bucket-location=custom-placement
Bucket 'custombucket' created $ touch "file_on_custom_pool" $ s3cmd put file_on_custom_pool s3://custombucket
WARNING: Module python-magic is not available. Guessing MIME types based on file extensions.
file_on_custom_pool -> s3://custombucket/file_on_custom_pool [1 of 1]
0 of 0 0% in 0s 0.00 B/s done

Verify :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ radosgw-admin bucket stats --bucket=custombucket
{ "bucket": "custombucket",
"pool": ".rgw.buckets.custom",
"index_pool": ".rgw.buckets.index",
"id": "default.240909.1",
"marker": "default.240909.1",
"owner": "testuser",
"ver": 1,
"master_ver": 0,
"mtime": 1417016078,
"max_marker": "",
"usage": {},
"bucket_quota": { "enabled": false,
"max_size_kb": -1,
"max_objects": -1}}

Pool var is set on “.rgw.buckets.custom”.

1
2
$ rados -p .rgw.buckets.custom ls
default.241071.1_file_on_custom_pool

It’s here !

Data placement pool is define in this order :

  1. from the request (“bucket location”)
  2. from user (“default_placement” : see with radosgw-admin metadata get user:<uid>)
  3. from region map (“default_placement”)

Placement_pools on Rados-GW的更多相关文章

  1. RADOS工作原理

    转:http://www.csdn.net/article/2014-04-08/2819192-ceph-swift-on-openstack-m/2 Ceph的工作原理及流程 本节将对Ceph的工 ...

  2. “Ceph浅析”系列之五——Ceph的工作原理及流程

    本文将对Ceph的工作原理和若干关键工作流程进行扼要介绍.如前所述,由于Ceph的功能实现本质上依托于RADOS,因而,此处的介绍事实上也是针对RADOS进行.对于上层的部分,特别是RADOS GW和 ...

  3. Ceph浅析”系列之四——Ceph的结构

    本文将从逻辑结构的角度对Ceph进行分析. Ceph系统的层次结构 Ceph存储系统的逻辑层次结构如下图所示[1]. Ceph系统逻辑层次结构 自下向上,可以将Ceph系统分为四个层次: (1)基础存 ...

  4. 001.Ceph简介概述

    一 Ceph简介 Red Hat Ceph是一个分布式的数据对象存储,系统设计旨在性能.可靠性和可扩展性上能够提供优秀的存储服务.分布式对象存储是存储的未来,因为它们适应非结构化数据,并且客户端可以同 ...

  5. Ceph与Gluster之开源存储的对比

    一.Ceph与Gluster之开源存储的对比 一.Ceph与Gluster的原理对比 Ceph和Gluster是Red Hat旗下的成熟的开源存储产品,Ceph与Gluster在原理上有着本质上的不同 ...

  6. Ceph分布式存储-原理介绍及简单部署

    1)Ceph简单概述Ceph是一个分布式存储系统,诞生于2004年,最早致力于开发下一代高性能分布式文件系统的项目.Ceph源码下载:http://ceph.com/download/.随着云计算的发 ...

  7. ceph 部署步骤和原理理解

    1.ceph的官方源在国外,网速比较慢,此处添加ceph源为阿里源(每个节点上均执行) vim /etc/yum.repos.d/ceph.repo [Ceph] name=Ceph packages ...

  8. Ceph rgws客户端验证

    修改/etc/ceph/ceph.conf文件,加入rados gw监听的端口 [client.rgw.rgws] rgw_frontends = "civetweb port=80&quo ...

  9. Ceph学习之路(一)之ceph初识

    一.元数据和元数据管理 (1)元数据 在学习Ceph之前,需要了解元数据的概念.元数据又称为中介数据.中继数据,为描述数据的数据.主要描述数据属性的信息,用来支持如指示存储位置.历史数据.资源查找.文 ...

  10. 分布式存储系统 Ceph

    你了解Ceph吗? Ceph是一种分布式存储系统,它可以将多台服务器组成一个超大集群,把这些机器中的磁盘资源整合到一块儿,形成一个大的资源池(PB级别),然后按需分配给应用使用. 那么你知道Ceph的 ...

随机推荐

  1. Linux运维工程师学习成长路线

    不过大家的留言都很精彩,希望大家也可以去留言区逛一逛~~ 好在这不是最后一期送书,之前已经有了好多活动,小编一定继续为大家多送些福利. 希望大家可以一如既往的关注脚本之家,支持爱你们的小编,共同进步! ...

  2. python 如何在某.py文件中调用其他.py内的函数

    A.py的文件需要调用B.py文件内的test函数 同一目录下: A.py #!/usr/bin/env python # -*- coding: utf- -*- def test(): ''' 测 ...

  3. IIS下网站对options请求直接返回404

    什么是options请求 options请求为发送非简单跨域请求前的预检请求,若该请求未正常返回,浏览器会阻止后续的请求发送. 一般情况下,有三种方式会导致浏览器发起预检请求 1.请求的方法不是GET ...

  4. python 基础学习笔记(2)---字符串功能函数

    **上一篇写到了,基本的数据类型,今天重点来讲一下字符串的功能函数**回顾一下上篇的内容:一.int 整型,在python 3 中与long型合并 可以达到 -9223372036854775808- ...

  5. WIFI密码破解全攻略

    开篇介绍 目前无线网络加密技术日益成熟.以前的wep加密方式日渐淘汰,因为这种加密方式非常容易破解,当然现在还是有不少使用这种加密方式无线网络.现在大部分的无线网络都是使用wpa/wpa2方式来加密的 ...

  6. HDU XXXX:求[L,R]的素数数量(数位DP)

    Problem G Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/131072K (Java/Other) Total S ...

  7. java打印1000内的质数并用表格输出

    <table width='500' border='1'><% int c=1; for(int i=2;i<=1000;i++){ int n=0; for(int j=2 ...

  8. 我是这样理解--SVM,不需要繁杂公式的那种!(附代码)

    1. 讲讲SVM 1.1 一个关于SVM的童话故事 支持向量机(Support Vector Machine,SVM)是众多监督学习方法中十分出色的一种,几乎所有讲述经典机器学习方法的教材都会介绍.关 ...

  9. dbo是默认用户也是架构

    dbo是默认用户也是架构 dbo作为架构是为了更好的与2000兼容, 在2000中DataBaseName.dbo.TableName解释为:数据库名.用户名.表名, 在2005中DataBaseNa ...

  10. TF项目实战(基于SSD目标检测)——人脸检测1

    SSD实战——人脸检测 Tensorflow 一 .人脸检测的困难: 1. 姿态问题 2.不同种族人, 3.光照 遮挡 带眼睛 4.视角不同 5. 不同尺度 二. 数据集介绍以及转化VOC: 1. F ...