extended attribute of directories. The name of this extended attribute is
``ceph.dir.pin``. Users can set this attribute using standard commands:
-::
+.. prompt:: bash #
setfattr -n ceph.dir.pin -v 2 path/to/dir
children. However, the parents pin can be overridden by setting the child
directory's export pin. For example:
-::
+.. prompt:: bash #
mkdir -p a/b
# "a" and "a/b" both start without an export pin set
would be the ``/home`` directory: we want every user's home directory to be
spread across the entire MDS cluster. This can be set via:
-::
+.. prompt:: bash #
setfattr -n ceph.dir.pin.distributed -v 1 /cephfs/home
``ceph.dir.pin.random`` with the value set to the percentage of directories
that should be pinned. For example:
-::
+.. prompt:: bash #
setfattr -n ceph.dir.pin.random -v 0.5 /cephfs/tmp
which policy is followed is the rule of the closest parent: if a closer parent
directory has a conflicting policy, use that one instead. For example:
-::
+.. prompt:: bash #
mkdir -p foo/bar1/baz foo/bar2
setfattr -n ceph.dir.pin -v 0 foo
For the reverse situation:
-::
+.. prompt:: bash #
mkdir -p home/{patrick,john}
setfattr -n ceph.dir.pin.distributed -v 1 home
To remove a partitioning policy, remove the respective extended attribute
or set the value to 0.
-.. code::bash
+.. prompt:: bash #
+
$ setfattr -n ceph.dir.pin.distributed -v 0 home
# or
$ setfattr -x ceph.dir.pin.distributed home
For export pins, remove the extended attribute or set the extended attribute
value to `-1`.
-.. code::bash
+.. prompt:: bash #
+
$ setfattr -n ceph.dir.pin -v -1 home
This option can be configured with the ``ceph fs set`` command. For example:
-::
+.. prompt:: bash #
ceph fs set <fs_name> bal_rank_mask <hex>
Each bitfield of the ``<hex>`` number represents a dedicated rank. If the ``<hex>`` is
set to ``0x3``, the balancer runs on active ``0`` and ``1`` ranks. For example:
-::
+.. prompt:: bash #
ceph fs set <fs_name> bal_rank_mask 0x3
If the ``bal_rank_mask`` is set to ``-1`` or ``all``, all active ranks are masked
and utilized by the balancer. As an example:
-::
+.. prompt:: bash #
ceph fs set <fs_name> bal_rank_mask -1
On the other hand, if the balancer needs to be disabled,
the ``bal_rank_mask`` should be set to ``0x0``. For example:
-::
+.. prompt:: bash #
ceph fs set <fs_name> bal_rank_mask 0x0