crushtool
is a utility that lets you create, compile, and decompile CRUSH map files.
CRUSH is a pseudo-random data distribution algorithm that efficiently maps
input values (typically data objects) across a heterogeneous, hierarchically
structured device map. The algorithm was originally described in detail in
the following paper (although it has evolved some since then):
will compile a plaintext map.txt into a binary map file.
-d map
will take the compiled map and decompile it into a plaintext source file,
suitable for editing.
--build numosds layer1 ...
will create a relatively generic map with the given layer structure. See below for examples.
OPTIONS
-o outfile
will specify the output file.
--clobber
will allow the tool to overwrite an existing outfile (it will normally refuse).
BUILDING A MAP
The build mode will generate relatively generic hierarchical maps. The first argument simply
specifies the number of devices (leaves) in the CRUSH hierarchy. Each layer describes how the
layer (or raw devices) preceeding it should be grouped.
Each layer consists of
name ( uniform | list | tree | straw ) size
The first element is the name for the elements in the layer (e.g. "rack"). Each element's
name will be append a number to the provided name.
The second component is the type of CRUSH bucket.
The third component is the maximum size of the bucket. If the size is 0, a single bucket
will be generated that includes everything in the preceeding layer.
EXAMPLE
Suppose we have 128 devices, each grouped into shelves with 4 devices each, and 8 shelves per
rack. We could create a three level hierarchy with: