Ceph SSD Cache Pool Setup - CloudCommandos/JohnChan GitHub Wiki
create cephfs pools
ceph osd pool create data_pool 1024
set up ceph crushmap to have rules selecting hdd only and ssd only
ceph osd getcrushmap -o old_crushmap_compiled
crushtool -d old_crushmap_compiled -o old_crushmap_decompiled
nano old_crushmap_decompiled
## add in the following:
rule ssd_only {
id 1
type replicated
min_size 1
max_size 10
step take default class ssd
step chooseleaf firstn 0 type host
step emit
}
rule hdd_only {
id 2
type replicated
min_size 1
max_size 10
step take default class hdd
step chooseleaf firstn 0 type host
step emit
}
crushtool -c old_crushmap_decompiled -o new_crushmap_compiled
ceph osd setcrushmap -i new_crushmap_compiled
ceph osd pool set data_pool crush_rule hdd_only
create ssd cache pool
ceph osd pool create ssd_cache_pool 512
ceph osd pool set ssd_cache_pool crush_rule ssd_only
set up cache tier
ceph osd tier add data_pool ssd_cache_pool
ceph osd tier cache-mode ssd_cache_pool writeback
ceph osd tier set-overlay data_pool ssd_cache_pool
configure ssd cache pool
ceph osd pool set ssd_cache_pool hit_set_type bloom
ceph osd pool set ssd_cache_pool hit_set_count 1
ceph osd pool set ssd_cache_pool hit_set_period 3600 # 1 hour
ceph osd pool set ssd_cache_pool target_max_bytes 1000000000000 # 1 TB
ceph osd pool set ssd_cache_pool min_read_recency_for_promote 1
ceph osd pool set ssd_cache_pool min_write_recency_for_promote 1