5.4.2.2. 오프라인 최적화 (기술 프리뷰)
기술 프리뷰 기능은 Red Hat 프로덕션 서비스 수준 계약(SLA)에서 지원되지 않으며 기능적으로 완전하지 않을 수 있으며 Red Hat은 해당 기능을 프로덕션용으로 사용하지 않는 것이 좋습니다. 이러한 기능을 사용하면 향후 제품 기능을 조기에 이용할 수 있어 개발 과정에서 고객이 기능을 테스트하고 피드백을 제공할 수 있습니다. 자세한 내용은 Red Hat 기술 프리뷰 기능에 대한 지원 범위를 참조하십시오.
균형이 맞지 않는 기본 OSD가 있는 경우 osdmaptool 에 빌드된 오프라인 Cryostat로 업데이트할 수 있습니다.
최상의 결과를 보장하기 위해 읽기 밸런서를 실행하기 전에 용량 밸런서를 실행하는 것이 좋습니다.
읽기 밸런서를 사용하여 클러스터의 균형을 조정하려면 절차의 단계를 따르십시오.
사전 요구 사항
시작하기 전에 다음 사전 요구 사항이 있는지 확인하십시오.
- 실행 중이고 용량 균형을 이루는 Red Hat Ceph Storage 클러스터입니다.
읽기 밸런서를 실행하기 전에 용량 밸런서를 실행하여 최적의 결과를 보장하기 전에 각 OSD의 용량의 균형을 조정합니다. 다음 단계를 사용하여 용량의 균형을 조정합니다.
osdmap의 최신 사본을 가져옵니다.
[ceph: root@host01 /]# ceph osd getmap -o mapupmap 밸런서를 실행합니다.
[ceph: root@host01 /]# osdmaptool map --upmap out.txtfile out.txt에는 제안된 솔루션이 포함되어 있습니다.
이 절차의 명령은 클러스터에 변경 사항을 적용하기 위해 실행되는 일반 Ceph CLI 명령입니다.
out.txt 파일에 권장 사항이 있는 경우 다음 명령을 실행합니다.
[ceph: root@host01 /]# source out.txt
프로세스
각 풀에 사용할 수 있는
read_balance_score를 확인합니다.[ceph: root@host01 /]# ceph osd pool ls detailread_balance_score가 1보다 큰 경우 풀에서 기본 OSD의 균형이 해제되었습니다.동종 클러스터의 경우 최적의 점수는 [Ceil{( PGs/Number of OSDs)}/( PGs/Number of OSDs)]/[ ( PGs/Number of OSDs)/(CPU 수의 PGs/Number)]입니다. 예를 들어 32개의 PG와 10개의 OSD가 있는 풀이 있는 경우 ( PGs/Number of OSDs) = 32/10 = 3.2입니다. 따라서 모든 장치가 동일한 경우 최적 점수는 4/3.2 = 1.25인 최적 점수가 3.2의 경우 ( PG/Number of OSDs)로 나뉩니다. 64 PG가 있는 동일한 시스템에 다른 풀이 있는 경우 최적의 점수는 7/6.4 =1.09375입니다.
출력 예:
$ ceph osd pool ls detail pool 1 '.mgr' replicated size 3 min_size 1 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode on last_change 17 flags hashpspool stripe_width 0 pg_num_max 32 pg_num_min 1 application mgr read_balance_score 3.00 pool 2 'cephfs.a.meta' replicated size 3 min_size 1 crush_rule 0 object_hash rjenkins pg_num 16 pgp_num 16 autoscale_mode on last_change 55 lfor 0/0/25 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 16 recovery_priority 5 application cephfs read_balance_score 1.50 pool 3 'cephfs.a.data' replicated size 3 min_size 1 crush_rule 0 object_hash rjenkins pg_num 128 pgp_num 128 autoscale_mode on last_change 27 lfor 0/0/25 flags hashpspool,bulk stripe_width 0 application cephfs read_balance_score 1.31osdmap의 최신 사본을 가져옵니다.[ceph: root@host01 /]# ceph osd getmap -o om출력 예:
got osdmap epoch 56Cryostat를 실행합니다.
file
out.txt에는 제안된 솔루션이 포함되어 있습니다.[ceph: root@host01 /]# osdmaptool om --read out.txt --read-pool _POOL_NAME_ [--vstart]출력 예:
$ osdmaptool om --read out.txt --read-pool cephfs.a.meta ./bin/osdmaptool: osdmap file 'om' writing upmap command output to: out.txt ---------- BEFORE ------------ osd.0 | primary affinity: 1 | number of prims: 4 osd.1 | primary affinity: 1 | number of prims: 8 osd.2 | primary affinity: 1 | number of prims: 4 read_balance_score of 'cephfs.a.meta': 1.5 ---------- AFTER ------------ osd.0 | primary affinity: 1 | number of prims: 5 osd.1 | primary affinity: 1 | number of prims: 6 osd.2 | primary affinity: 1 | number of prims: 5 read_balance_score of 'cephfs.a.meta': 1.13 num changes: 2file
out.txt에는 제안된 솔루션이 포함되어 있습니다.이 절차의 명령은 클러스터에 변경 사항을 적용하기 위해 실행되는 일반 Ceph CLI 명령입니다. vstart 클러스터에서 작업하는 경우 CLI 명령이
./bin/ 접두사로 포맷되도록--vstart매개변수를 전달할 수 있습니다.[ceph: root@host01 /]# source out.txt출력 예:
$ cat out.txt ceph osd pg-upmap-primary 2.3 0 ceph osd pg-upmap-primary 2.4 2 $ source out.txt change primary for pg 2.3 to osd.0 change primary for pg 2.4 to osd.2참고ceph osd pg-upmap-primary명령을 처음 실행하는 경우 다음과 같이 경고가 표시될 수 있습니다.Error EPERM: min_compat_client luminous < reef, which is required for pg-upmap-primary. Try 'ceph osd set-require-min-compat-client reef' before using the new interface이 경우 권장 명령
ceph osd set-require-min-compat-client reef를 실행하고 클러스터의 min-compact-client를 조정합니다.
배치 그룹(PG) 수가 변경되거나 클러스터에서 OSD가 추가되거나 제거된 경우 이러한 작업이 풀에 읽기 밸런서 효과에 상당한 영향을 미칠 수 있으므로 점수를 다시 확인하고 밸런서를 다시 실행하는 것이 좋습니다.