CephFS

What is CephFS?

CephFS is a POSIX-compliant file system that can be accessed by multiple clients. It can be mounted directly via the Linux kernel or through FUSE and libcephfs. Metadata (e.g., file names, directory contents, permissions) and data are stored in separate pools. Metadata is managed by an MDS (Metadata Server), while clients connect directly to OSDs to store/retrieve data.

Metadata Servers (MDS)

MDS are essential for setting up CephFS.

How Many MDS?

  • Each file system can have multiple active MDS.
  • Each active MDS requires a separate passive failover MDS.
  • Typically, one active MDS and one standby MDS are sufficient.
  • Multiple active MDS are recommended for systems with over 100 million files or a high number of metadata operations.

Hardware Requirements

  • MDS are both CPU and memory bound, though it highly depends on the workload.
  • Colocating MDS with OSDs or other services means they are competing for resources.
  • Make sure the cephfs_metadata pool is backed by the fastest possible OSDs in your cluster. croit will automatically try to place the pool on NVMes.

Setting mds cache memory limit

  1. Navigate to Config in the UI.
  2. Click Add
  3. Search for mds cache memory limit
  4. The default of 4 GiB is rather low for most workloads.

Important Ceph allows this limit to be overshot by 50% before displaying warnings to allow for usage spikes.

Setting Up MDS

  1. Navigate to CephFS in the UI.
  2. You will be prompted to choose servers for your MDS.
  3. Select at least two servers (1 active + 1 standby).

More Than One Active MDS

By default, only one active MDS is set. To configure more:

  1. Navigate to CephFS -> MDS.
  2. Adjust Max MDS.

Important Changing the number of active MDS might temporarily impact clients.

Running Multiple MDS per Server

We recommend running only one MDS per server. When running multiple MDS per server, you might end up running multiple active or standby-replay MDS on a single server. This can cause downtime for CephFS or slow recovery should that server go down.

If you still want to run multiple MDS per server, you need to first enable this feature in croit:

  1. Navigate to Croit in the UI (bottom left) to access the croit settings page.
  2. Click Add and search for croit enable multi mds support.
  3. Enable the toggle button, and click on Save. Multi-RGW settings

The user interface now allows you to add multiple MDS instances on a single server.

Data Placement

To influence how the files are stored you have two options:

In Croit

  1. Go to CephFS.
  2. Select a folder and click Edit -> Pool Layout.
  3. You can adjust both the desired destination pool and namespace.

On the mounted Filesystem

You can use filesystem attributes to achieve the same thing on the mounted filesystem.

setfattr -n ceph.dir.layout.pool -v cephfs_data_nvme /mnt/cephfs/my_nvme_pool

Existing files inside the folder aren't moved to the new pool!

Snapshot Mirroring

Open File Storage, select a filesystem, then open Mirroring. The page separates source configuration from destination credentials and reports configuration, daemon observations, destinations, and mirrored directories. Viewing the page does not enable or change mirroring.

Requirements

  • Two reachable Ceph clusters with a filesystem on each side.
  • Administrator access to change mirroring configuration. Viewer access is sufficient to inspect its status.
  • A compatible Ceph manager and an image containing the enhanced cephfs-mirror daemon. The interface checks command support and refuses operations it cannot perform safely, including importing credentials through standard input. It does not fall back to putting secrets in command arguments.
  • Snapshots of the source directories, created manually or by a snapshot schedule. Registering a mirrored directory does not create snapshots.

Configure the Destination

  1. On the destination cluster, select the destination filesystem and open Mirroring.
  2. Enable the mirroring manager module and filesystem mirroring if needed. These are separate, explicit actions.
  3. Under Destination filesystem, choose Create destination bootstrap token. Enter a site name and a new, dedicated Ceph client name. Existing clients and client.admin are refused.
  4. Copy the token securely for import on the source cluster.

The token contains reusable destination credentials and has no automatic expiry. Closing the token dialog removes it from the browser view; it does not revoke the credentials. Do not put the token in tickets, logs, or screenshots.

Configure the Source

  1. On the source cluster, select the source filesystem and open Mirroring.
  2. Enable the mirroring manager module and filesystem mirroring if needed.
  3. Choose Import destination token and paste the token created on the destination.
  4. If no daemon is configured, choose Deploy mirror daemon and select a server with a compatible image. Deployment enables synchronization for that daemon's dedicated client, not globally. Check service status after the task completes; task completion alone does not prove the daemon has started.
  5. Choose Add mirrored directory and enter an existing absolute path inside the source filesystem. Use Manage snapshot schedules if snapshots should be created automatically.

Mirroring copies snapshots from the source to the destination. It does not configure automatic failover. An idle daemon or an observation with no reported failure does not prove that every snapshot has arrived. Unavailable observations are shown separately from an unconfigured filesystem.

Stop Replication

Stopping a mirrored directory stops replication of that path to all configured destinations. Removing a destination stops replication to that destination. Existing local and remote snapshots are retained. These operations require confirmation.

Remove all mirrored directories and destinations explicitly before disabling filesystem mirroring. If a destination change fails, inspect both clusters before retrying: part of the remote ownership or credential cleanup may already have completed.

Mounting the Filesystem

There are multiple ways to mount the filesystem.

The Native Way

To mount your CephFS on a Linux system you need to:

  1. Setup Ceph Keys.
  2. Download and move both ceph.conf and key to /etc/ceph/ on the system.
  3. Ensure the system has an up-to-date kernel, to prevent client bugs.
  4. Ensure the system has access to your MONs.
mount -t ceph name@.fs_name=/ /mnt/cephfs -o mon_addr=10.0.0.1,10.0.0.2,10.0.0.3

Replace mon_addr with your actual MON addresses.

Accessing via SMB

Accessing via NFS