第三课 ceph基础学习-CrushMap和RDB高级功能
文章目录
第一节 CrushMap调整
1.1 CrushMap简介
- CRUSH 算法通过计算数据存储位置来确定如何存储和检索。 CRUSH 授权 Ceph 客户端直接连接 OSD ,而非通过一个中央服务器或代理。数据存储、检索算法的使用,使 Ceph 避免了单点故障、性能瓶颈、和伸缩的物理限制。
- 通过CRUSH的算法把数据落在不同的OSD上。把一组OSD组合起来,CRUSH决定数据怎么分布。
- ceph提供很多种的bucket,最小的节点是osd。
osd (or device)
host # 主机
chassis # 机架
rack # 机柜
row
pdu
pod
room
datacenter # 数据中心
zone # 区域
region # 亚洲、欧洲等
root # 最顶级root 最高
- 通过命令行看
# crush map规则查看
ceph osd crush tree
ceph osd tree
# 查看具体规则
ceph osd crush dump
{
"devices": [ # 设备 osd
{
"id": 0,
"name": "osd.0",
"class": "hdd"
},
{
"id": 1,
"name": "osd.1",
"class": "hdd"
},
{
"id": 2,
"name": "osd.2",
"class": "hdd"
}
],
"types": [ # 类型的定义 加入不同的bucket进行数据分布
{
"type_id": 0,
"name": "osd"
},
{
"type_id": 1,
"name": "host"
},
{
"type_id": 2,
"name": "chassis"
},
{
"type_id": 3,
"name": "rack"
},
{
"type_id": 4,
"name": "row"
},
{
"type_id": 5,
"name": "pdu"
},
{
"type_id": 6,
"name": "pod"
},
{
"type_id": 7,
"name": "room"
},
{
"type_id": 8,
"name": "datacenter"
},
{
"type_id": 9,
"name": "zone"
},
{
"type_id": 10,
"name": "region"
},
{
"type_id": 11,
"name": "root"
}
],
"buckets": [ # 数据的组织形式
{
"id": -1,
"name": "default",
"type_id": 11,
"type_name": "root",
"weight": 1926,
"alg": "straw2",
"hash": "rjenkins1",
"items": [ # 三个host对应id -3 -5 -7
{
"id": -3,
"weight": 642,
"pos": 0
},
{
"id": -5,
"weight": 642,
"pos": 1
},
{
"id": -7,
"weight": 642,
"pos": 2
}
]
},
{
"id": -2,
"name": "default~hdd",
"type_id"