Configuring file system affinity

Set the Ceph File System (CephFS) affinity for a particular Ceph Metadata Server (MDS).

Before you begin

Before you begin, make sure that you have the following prerequisites in place:
  • A healthy, and running IBM Storage Ceph.
  • A Ceph File System created.
  • Root-level access to a Ceph Monitor node.

About this task

For more information about file system affinity, see File system affinity.

Procedure

  1. Check the current state of a Ceph File System.
    [root@mon ~]# ceph fs dump
    dumped fsmap epoch 399
    ...
    Filesystem 'cephfs01' (27)
    ...
    e399
    max_mds 1
    in      0
    up      {0=20384}
    failed
    damaged
    stopped
    ...
    [mds.a{0:20384} state up:active seq 239 addr [v2:127.0.0.1:6854/966242805,v1:127.0.0.1:6855/966242805]]
    
    Standby daemons:
    
    [mds.b{-1:10420} state up:standby seq 2 addr [v2:127.0.0.1:6856/2745199145,v1:127.0.0.1:6857/2745199145]]
  2. Set the file system affinity.
    ceph config set STANDBY_DAEMON mds_join_fs FILE_SYSTEM_NAME
    For example,
    [root@mon ~]# ceph config set mds.b mds_join_fs cephfs01

    After a Ceph MDS failover event, the file system favors the standby daemon for which the affinity is set, as shown in the following example.

    Note the mds.b daemon now has the join_fscid=27 in the file system dump output.
    [root@mon ~]# ceph fs dump
    dumped fsmap epoch 405
    e405
    ...
    Filesystem 'cephfs01' (27)
    ...
    max_mds 1
    in      0
    up      {0=10420}
    failed
    damaged
    stopped
    ...
    [mds.b{0:10420} state up:active seq 274 join_fscid=27 addr [v2:127.0.0.1:6856/2745199145,v1:127.0.0.1:6857/2745199145]] 
    
    Standby daemons:
    
    [mds.a{-1:10720} state up:standby seq 2 addr [v2:127.0.0.1:6854/1340357658,v1:127.0.0.1:6855/1340357658]]
    Note: If a file system is in a degraded or undersized state, then no failover occurs to enforce the file system affinity.