Create a Ceph file system

Creating pools

A Ceph file system requires at least two RADOS pools, one for data and one for metadata.When configuring these pools, you might consider:

  • Using a higher replication level for the metadata pool, as any data loss inthis pool can render the whole file system inaccessible.

  • Using lower-latency storage such as SSDs for the metadata pool, as this willdirectly affect the observed latency of file system operations on clients.

  • The data pool used to create the file system is the “default” data pool andthe location for storing all inode backtrace information, used for hard linkmanagement and disaster recovery. For this reason, all inodes created inCephFS have at least one object in the default data pool. If erasure-codedpools are planned for the file system, it is usually better to use areplicated pool for the default data pool to improve small-object write andread performance for updating backtraces. Separately, another erasure-codeddata pool can be added (see also Erasure code) that can be used on an entirehierarchy of directories and files (see also File layouts).

Refer to Pools to learn more about managing pools. Forexample, to create two pools with default settings for use with a file system, youmight run the following commands:

  1. $ ceph osd pool create cephfs_data
  2. $ ceph osd pool create cephfs_metadata

Generally, the metadata pool will have at most a few gigabytes of data. Forthis reason, a smaller PG count is usually recommended. 64 or 128 is commonlyused in practice for large clusters.

Creating a file system

Once the pools are created, you may enable the file system using the fs new command:

  1. $ ceph fs new <fs_name> <metadata> <data>

For example:

  1. $ ceph fs new cephfs cephfs_metadata cephfs_data
  2. $ ceph fs ls
  3. name: cephfs, metadata pool: cephfs_metadata, data pools: [cephfs_data ]

Once a file system has been created, your MDS(s) will be able to enteran active state. For example, in a single MDS system:

  1. $ ceph mds stat
  2. cephfs-1/1/1 up {0=a=up:active}

Once the file system is created and the MDS is active, you are ready to mountthe file system. If you have created more than one file system, you willchoose which to use when mounting.

If you have created more than one file system, and a client does notspecify a file system when mounting, you can control which file systemthey will see by using the ceph fs set-default command.

Using Erasure Coded pools with CephFS

You may use Erasure Coded pools as CephFS data pools as long as they have overwrites enabled, which is done as follows:

  1. ceph osd pool set my_ec_pool allow_ec_overwrites true

Note that EC overwrites are only supported when using OSDS with the BlueStore backend.

You may not use Erasure Coded pools as CephFS metadata pools, because CephFS metadata is stored using RADOS OMAP data structures, which EC pools cannot store.