Mapas de Metadados

Conteúdo da documentação

Abrir tabela de conteúdo

Mapas de Metadados

O Ceph mantém mapas para representar a topologia do cluster, sendo 5 tipos diferentes de mapas existentes:

1- Monitor Map:
Armazena o fsid do cluster, a posição, o nome do endereço e a porta de cada monitor. Também indica a época atual, quando o mapa foi criado e a última vez que foi alterado. Para visualizar um mapa do monitor, basta executar o comando:
epoch 1
fsid d5fde8a5-ad7e-4a96-8c23-f232c65a2828
last_changed 2022-07-27T12:46:03.496974+0000
created 2022-07-27T12:46:03.496974+0000
min_mon_release 15 (octopus)
0: [v2:192.168.122.240:3300/0,v1:192.168.122.240:6789/0] mon.vm1
1: [v2:192.168.122.241:3300/0,v1:192.168.122.241:6789/0] mon.vm2
2: [v2:192.168.122.242:3300/0,v1:192.168.122.242:6789/0] mon.vm3

2- OSD Map:
Contém o fsid do cluster, quando o mapa foi criado e modificado pela última vez, uma lista de pools, tamanhos de réplicas, números de PGs, uma lista de OSDs e seus status. Para visualizar um mapa OSD, basta executar o comando:

~# ceph osd dump
epoch 521
fsid d5fde8a5-ad7e-4a96-8c23-f232c65a2828
created 2022-07-27T12:46:08.513211+0000
modified 2022-09-13T19:50:43.606946+0000
flags sortbitwise,recovery_deletes,purged_snapdirs,pglog_hardlimit
crush_version 19
full_ratio 0.95
backfillfull_ratio 0.9
nearfull_ratio 0.85
require_min_compat_client jewel
min_compat_client jewel
require_osd_release octopus
pool 1 'device_health_metrics' replicated size 3 min_size 1 ... application mgr_devicehealth
pool 2 '.rgw.root' replicated size 3 min_size 1 ... application rgw
pool 3 'default.rgw.log' replicated size 3 min_size 1 ... application rgw
pool 4 'default.rgw.control' replicated size 3 min_size 1 ... application rgw
pool 5 'default.rgw.meta' replicated size 3 min_size 1 ... application rgw
pool 6 'metadata-ec' replicated size 3 min_size 1 ... stripe_width 0
pool 7 'acs-primary-storage' replicated size 3 min_size 1 ... stripe_width 0
max_osd 5
osd.0 up in weight 1 up_from 466 up_thru ... exists,up 8b6fadd9-0ca5-4b83-9f5e-b42397d8f555
osd.1 up in weight 1 up_from 466 up_thru ... exists,up 99818b4e-696c-4325-9d52-617a1960b76e
osd.2 up in weight 1 up_from 463 up_thru ... exists,up 9886b73e-6833-4654-a288-0d45eb2b9e1a
osd.3 up in weight 1 up_from 469 up_thru ... exists,up 20ed5c5f-0db6-4e05-8793-ecc39793e5fd
osd.4 up in weight 1 up_from 474 up_thru ... exists,up 01bad136-6797-4a2f-819c-5f620318444f

3- PG Map:
Contém a versão do PG, seu registro de data e hora, a última época do mapa OSD, as proporções completas e detalhes de cada grupo de posicionamento, como PG ID, Up Set, Ativo, estado do PG e estatísticas de uso de dados para cada pool. Para visualizar esse mapa, basta executar o comando:

~# ceph pg dump
dumped all
version 260764
stamp 2022-09-15T12:05:12.462623+0000
last_osdmap_epoch 0
last_pg_scan 0
PG_STAT OBJECTS MISSING_ON_PRIMARY DEGRADED MISPLACED UNFOUND BYTES OMAP_BYTES* OMAP_KEYS*
LOG DISK_LOG STATE STATE_STAMP VERSION REPORTED UP UP_PRIMARY ACTING ACTING_PRIMARY
LAST_SCRUB SCRUB_STAMP LAST_DEEP_SCRUB DEEP_SCRUB_STAMP SNAPTRIMQ_LEN
...
7 25131 0 0 0 0 105205893449 74 8 76095 76095
6 0 0 0 0 0 0 0 0 0 0
5 2 0 0 0 0 393 0 0 4 4
4 8 0 0 0 0 0 0 0 159 159
3 207 0 0 0 0 3520 0 0 97968 97968
2 4 0 0 0 0 1289 0 0 8 8
1 0 0 0 0 0 0 0 0 0 0

sum 25352 0 0 0 0 105205898651 74 8 174234 174234
OSD_STAT USED AVAIL USED_RAW TOTAL HB_PEERS PG_SUM PRIMARY_PG_SUM
4 68 GiB 131 GiB 69 GiB 200 GiB [0,1,2,3] 113 44
3 51 GiB 148 GiB 52 GiB 200 GiB [0,1,2,4] 92 29
2 55 GiB 144 GiB 56 GiB 200 GiB [0,1,3,4] 96 33
1 52 GiB 147 GiB 53 GiB 200 GiB [0,2,3,4] 90 22
0 68 GiB 131 GiB 69 GiB 200 GiB [1,2,3,4] 116 41
sum 294 GiB 701 GiB 299 GiB 1000 GiB
4- CRUSH Map:
Contém uma lista de dispositivos de armazenamento, a hierarquia dos domínios de falha (por exemplo: dispositivo, host, rack, linha, sala etc.) e regras para percorrer a hierarquia ao armazenar dados. Para visualizar um mapa CRUSH, os seguintes passos devem ser executados:

  • Salvar o mapa em um arquivo binário:
    ceph osd getcrushmap -o filename
  • Decompilar o binário:
    crushtool -d filename -o decompiled-crushmap-filename
  • Em seguida, basta ler o arquivo decompilado.

Por exemplo:
~# ceph osd getcrushmap -o crush
19
~# crushtool -d crush -o crush.txt
~# cat crush.txt
# begin crush map
tunable choose_local_tries 0
tunable choose_local_fallback_tries 0
tunable choose_total_tries 50
tunable chooseleaf_descend_once 1
tunable chooseleaf_vary_r 1
tunable chooseleaf_stable 1
tunable straw_calc_version 1
tunable allowed_bucket_algs 54

# devices
device 0 osd.0 class hdd
device 1 osd.1 class hdd
device 2 osd.2 class hdd
device 3 osd.3 class hdd
device 4 osd.4 class hdd

# types
type 0 osd
type 1 host
type 2 chassis
type 3 rack
type 4 row
type 5 pdu
type 6 pod
type 7 room
type 8 datacenter
type 9 zone
type 10 region
type 11 root

# buckets
host dp1 {
id -3 # do not change unnecessarily
id -4 class hdd # do not change unnecessarily
# weight 0.195
alg straw2
hash 0 # rjenkins1
item osd.2 weight 0.195
}
host dp4 {
id -5 # do not change unnecessarily
id -6 class hdd # do not change unnecessarily
# weight 0.195
alg straw2
hash 0 # rjenkins1
item osd.3 weight 0.195
}
host dp3 {
id -7 # do not change unnecessarily
id -8 class hdd # do not change unnecessarily
# weight 0.195
alg straw2
hash 0 # rjenkins1
item osd.1 weight 0.195
}
host dp2 {
id -9 # do not change unnecessarily
id -10 class hdd # do not change unnecessarily
# weight 0.195
alg straw2
hash 0 # rjenkins1
item osd.0 weight 0.195
}
host dp5 {
id -11 # do not change unnecessarily
id -12 class hdd # do not change unnecessarily
# weight 0.195
alg straw2
hash 0 # rjenkins1
item osd.4 weight 0.195
}
root default {
id -1 # do not change unnecessarily
id -2 class hdd # do not change unnecessarily
# weight 0.976
alg straw2
hash 0 # rjenkins1
item dp1 weight 0.195
item dp4 weight 0.195
item dp3 weight 0.195
item dp2 weight 0.195
item dp5 weight 0.195
}

# rules
rule replicated_rule {
id 0
type replicated
min_size 1
max_size 10
step take default
step chooseleaf firstn 0 type host
step emit
}

# end crush map

 

5- MDS Map:
Contém a época atual do mapa MDS, quando o mapa foi criado e a última vez que foi alterado. Ele também contém o pool para armazenar metadados, uma lista de servidores de metadados e quais servidores de metadados estão ativos e disponíveis.