Ceph OSD 관리
Disk 준비
아래 중 하나에 해당하는 Disk를 준비해야합니다.
- Raw devices (파티션 또는 파일 시스템이 없는 디바이스)
- Raw partitions (파일 시스템이 없는 파티션)
- LVM Logical Volumes (파일 시스템이 없는 논리적 볼륨)
Block
모드로 사용가능한 PV(다른 StorageClass에 의해 프로비저닝 됨)
Raw device를 사용하는 경우
sudo dd if=/dev/zero of=/dev/<device> bs=1M count=100 oflag=direct,dsync
Logical Volume(LV)를 사용하는 경우
Data 흐름
- Pool
- 클라이언트가 인식하는 추상화된 저장공간입니다.
- Pool은 Placement Group(PG)들로 나뉩니다.
- 하나의 PG는 하나의 Pool에만 속합니다.
- CRUSH 알고리즘
- PG를 OSD에 할당합니다.(primary OSD와 secondary OSDs로 구성)
- Object를 PG 중 하나에 할당합니다.
- CRUSH 맵
- Bucket 계층 구조, OSD 리스트, Pool 내에서 데이터를 복제 규칙을 정의한 맵입니다.
- OSD가 추가되면
host
Bucket에 자동으로 추가됩니다. - 기본적으로
root
-host
-osd
구조가 주어집니다. root
-region
-zone
-datacenter
-room
-pod
-pdu
-row
-rack
-chassis
-host
-osd
구조로 확장 가능합니다.
kubectl rook-ceph ceph osd tree
OSD 추가하기
- https://rook.io/docs/rook/latest/CRDs/Cluster/ceph-cluster-crd
- https://rook.io/docs/rook/v1.12/CRDs/specification/#ceph.rook.io/v1.StorageScopeSpec
apiVersion: ceph.rook.io/v1
kind: CephCluster
spec:
placement:
all: {}
osd: {}
storage:
useAllNodes: false
useAllDevices: false
placement
all
osd
nodeAffinity
podAffinity
podAntiAffinity
tolerations
topologySpreadConstraints
storage
useAllNodes: <bool>
: 모든 노드에서 장치를 감지할지 여부입니다.nodes: []
name: <nodeName>
resources: {}
: OSD의 resources 설정입니다.- deviceSelection
- 임베딩 되어있습니다.
- deviceSelection
- 임베딩 되어있습니다.
- nodes.deviceSelection이 우선순위가 더 높습니다.
config: <config>
- 전체 장치에 적용될 설정입니다.
- devices.config가 우선순위가 더 높습니다.
storageClassDeviceSets: []
onlyApplyOSDPlacement: <bool>
- PV가 아닌 장치를 사용하는 경우
.spec.placement.osd
와.spec.placement.all
의 병합 여부입니다. - PV 장치를 사용하는 경우
storageClassDeviceSets
에 정의된 placement와.spec.placement.all
의 병합 여부입니다.
- PV가 아닌 장치를 사용하는 경우
- deviceSelection
useAllDevices: <bool>
deviceFilter: <deviceRegex>
devicePathFilter: <devicePathRegex>
devices: []
name: <device|devicePath>
config: <config>
volumeClaimTemplates: []