CRUSH on single host

The CRUSH algorithm intends to distribute objects across different hosts, so if you set up all OSDs on the same host, CRUSH will complians. For instance, a Ceph cluster with 3 OSDs on single host will likely get a 65 active, 54 active+degraded, 73 active+remapped state when fresh-deployed, which was supposed to be 192 active+clean.

But sometimes we really expect it to work on just one host, in order to change CRUSH’s policy, get the current CRUSH map and add a simple fix, then push the map back to cluster:

sudo ceph osd getcrushmap -o /tmp/crushmap
sudo crushtool -d /tmp/crushmap -o /tmp/crushmap.txt
sudo vi /tmp/crushmap.txt
# Find a line: "step chooseleaf firstn 0 type host",
# and change it to "step chooseleaf firstn 0 type osd".
sudo crushtool -c /tmp/crushmap.txt -o /tmp/ 
sudo ceph osd setcrushmap -i /tmp/


Hacker / Tenniser / Photographer / Diver / Entrepreneur

Kaohsiung, Taiwan

看文章如果不回應, 跟條鹹魚有什麼分別?