Chapter 16. Using 2-way replication with CephFS


To reduce storage overhead with CephFS when data resiliency is not a primary concern, you can opt for using 2-way replication (replica-2). This reduces the amount of storage space used and decreases the level of fault tolerance.

There are two ways to use replica-2 for CephFS:

Use this procedure to edit the existing default CephFS pool to replica-2 and use it with the default CephFS storageclass.

Procedure

  1. Patch the storagecluster to change default CephFS data pool to replica-2.

    $ oc patch storagecluster ocs-storagecluster -n openshift-storage --type json --patch '[{ "op": "replace", "path": "/spec/managedResources/cephFilesystems/dataPoolSpec/replicated/size", "value": 2 }]'
    storagecluster.ocs.openshift.io/ocs-storagecluster patched
    $ oc get cephfilesystem ocs-storagecluster-cephfilesystem -o=jsonpath='{.spec.dataPools}' | jq
    [
      {
        "application": "",
        "deviceClass": "ssd",
        "erasureCoded": {
          "codingChunks": 0,
          "dataChunks": 0
        },
        "failureDomain": "zone",
        "mirroring": {},
        "quotas": {},
        "replicated": {
          "replicasPerFailureDomain": 1,
          "size": 2,
          "targetSizeRatio": 0.49
        },
        "statusCheck": {
          "mirror": {}
        }
      }
    ]
  2. Check the pool details.

    $ ceph osd pool ls | grep filesystem
    ocs-storagecluster-cephfilesystem-metadata
    ocs-storagecluster-cephfilesystem-data0

Use this procedure to add an additional CephFS data pool with replica-2.

Prerequisites

  • Ensure that you are logged into the OpenShift Container Platform web console and OpenShift Data Foundation cluster is in Ready state.

Procedure

  1. Click Storage StorageClasses Create Storage Class.
  2. Select CephFS Provisioner.
  3. Under Storage Pool, click Create new storage pool.

    1. Fill in the Create Storage Pool fields.
    2. Under Data protection policy, select 2-way Replication.
    3. Confirm Storage Pool creation
  4. In the Storage Class creation form, choose the newly created Storage Pool.
  5. Confirm the Storage Class creation.

Verification

  1. Click Storage Data Foundation.
  2. In the Storage systems tab, select the new storage system.
  3. The Details tab of the storage system reflect the correct volume and device types you chose during creation
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top