From 5ed5f18f05545f6ff8b746720e17d5425572aece Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 16 May 2023 10:55:34 +0530 Subject: [PATCH] doc: explain cephfs mirroring `peer_add` step in detail @zdover23 reached out regarding missing explanation for `peer_add` step in cephfs mirroring documentation. Add some explanation and and example to make the step clear. Signed-off-by: Venky Shankar (cherry picked from commit 6a6e887ff1f7f7d76db7f30f8410783b2f8153b0) --- doc/cephfs/cephfs-mirroring.rst | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/doc/cephfs/cephfs-mirroring.rst b/doc/cephfs/cephfs-mirroring.rst index 8793f3e3cdcaa..bda66b7eef388 100644 --- a/doc/cephfs/cephfs-mirroring.rst +++ b/doc/cephfs/cephfs-mirroring.rst @@ -82,19 +82,32 @@ To disable mirroring, use:: $ ceph fs snapshot mirror disable Once mirroring is enabled, add a peer to which directory snapshots are to be mirrored. -Peers follow `@` specification and get assigned a unique-id (UUID) -when added. See `Creating Users` section on how to create Ceph users for mirroring. +Peers are specified by `@` format which is also termed as `remote_cluster_spec` +(further in this document) and are assigned a unique-id (UUID) when added. See `Creating Users` +section on how to create Ceph users for mirroring. To add a peer use:: $ ceph fs snapshot mirror peer_add [] [] [] +`` is of format `client.@`. `` is optional, and defaults to `` (on the remote cluster). This requires the remote cluster ceph configuration and user keyring to be available in -the primary cluster. See `Bootstrap Peers` section to avoid this. `peer_add` additionally -supports passing the remote cluster monitor address and the user key. However, bootstrapping -a peer is the recommended way to add a peer. +the primary cluster. E.g.: Say, user `client_mirror` is created on the remote cluster which +has `rwps` permissions for the remote file system `remote_fs` (Refer `Creating Users`) and the +remote cluster is named `remote_ceph` (i.e., the remote cluster configuration file is named +`remote_ceph.conf` on the primary cluster), use the following command to add the remote filesystem +as a peer to the primary filesystem `primary_fs`:: + + $ ceph fs snapshot mirror peer_add primary_fs client.mirror_remote@remote_ceph remote_fs + +To avoid maintaining remote cluster configuration file and remote ceph user keyring in the primary +cluster, users can bootstrap a peer (which stores the relevant remote cluster details in the monitor +config store on the parimary cluster). See `Bootstrap Peers` section. + +Note that, `peer_add` additionally supports passing the remote cluster monitor address and the user key. +However, bootstrapping a peer is the recommended way to add a peer. .. note:: Only a single peer is supported right now. -- 2.39.5