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. docker 获取镜像

    之前提到过,Docker Hub 上有大量的高质量的镜像可以用,这里我们就说一下怎么获取这些镜像. 从 Docker 镜像仓库获取镜像的命令是 docker pull.其命令格式为: docker p ...

  2. APP系统架构设计初探

    一,图片体验的优化. 在手机上显示图片,速度是一个非常重要的体验点,试想,如果您打开一个网站,发现里面的图片一直显示失败或者是x,稍微做得好一点的,可能是一个不消失的loading或者是菊花等等,但不 ...

  3. 齐治运维堡垒机后台存在命令执行漏洞(CNVD-2019-17294)分析

    基本信息 引用:https://www.cnvd.org.cn/flaw/show/CNVD-2019-17294 补丁信息:该漏洞的修复补丁已于2019年6月25日发布.如果客户尚未修复该补丁,可联 ...

  4. 提升布局性能____Re-using Layouts with <include/>

    可以再一个布局中通过"include"和"merge"元素进行复用其他的布局元素. 比如如下一个布局: <FrameLayout xmlns:androi ...

  5. KETTLE数据上传

    1.     KETTLE简介 一种ETL工具,ETL,是英文Extract-Transform-Load的缩写,用来描述将数据从来源端经过抽取(extract).转换(transform).加载(l ...

  6. PipelineDB Install and Test

    Installation Prerequisites: CentOS Linux release 7.2.1511 (Core) Download [root@citus1 ~]# wget http ...

  7. 【朝花夕拾】Android自定义View篇之(十一)View的滑动,弹性滑动与自定义PagerView

    前言 由于手机屏幕尺寸有限,但是又经常需要在屏幕中显示大量的内容,这就使得必须有部分内容显示,部分内容隐藏.这就需要用一个Android中很重要的概念——滑动.滑动,顾名思义就是view从一个地方移动 ...

  8. .net学习笔记之访问数据库

    .net中访问数据库的两中方法 第一种是通过SqlHelper帮助类来访问数据库, 使用的是ADO.net技术. using System.Data; using System.Data.SqlCli ...

  9. Python连载24-函数list&read&seek

    一. 函数list (1)定义:用打开的文件作为参数,把文件内的每一行内容作为一个元素 (2)格式:list(文件) (3)例子: with open(r"test01.txt", ...

  10. 月薪12k的零基础自学前端必备手册

    随着互联网的深入发展,前端开发工程师一跃成为市场上非常抢手的人才.很多同学,包括以前做UI的.Java的.或者对于IT完全零基础的同学都想学习前端.下图是网上流传甚广的一张前端学习思维导图,很多初学者 ...