Skip to content

Commit 726234c

Browse files
committed
doc/dev/cephfs-mirroring: edit file 2 of x
Add prompts (and perform necessary corrections to glaring grammatical errors) to doc/dev/cephfs-mirroring.rst, as requested by Jos Collin in https://github.com/ceph/ceph/pull/63237/files#r2085886075. This commit edits the second quarter of the doc/dev/cephfs-mirroring.rst file. This commit encompasses about one-hundred lines of RST. Signed-off-by: Zac Dover <[email protected]> (cherry picked from commit 0768ef3)
1 parent 14a9fc5 commit 726234c

File tree

1 file changed

+92
-56
lines changed

1 file changed

+92
-56
lines changed

doc/dev/cephfs-mirroring.rst

Lines changed: 92 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -96,93 +96,129 @@ file system mirroring and is the recommended control interface.
9696
Mirroring Module and Interface
9797
------------------------------
9898

99-
Mirroring module provides interface for managing directory snapshot mirroring. The module
100-
is implemented as a Ceph Manager plugin. Mirroring module does not manage spawning (and
101-
terminating) the mirror daemons. Right now the preferred way would be to start/stop
102-
mirror daemons via `systemctl(1)`. Going forward, deploying mirror daemons would be
103-
managed by `cephadm` (Tracker: http://tracker.ceph.com/issues/47261).
99+
The mirroring module provides an interface for managing directory snapshot
100+
mirroring. The module is implemented as a Ceph Manager plugin. The mirroring
101+
module does not manage the spawning of (and terminating of) the mirror
102+
daemons. `systemctl(1)` is the preferred way to start and stop mirror daemons.
103+
In the future, mirror daemons will be deployed and managed by `cephadm`
104+
(Tracker: http://tracker.ceph.com/issues/47261).
105+
106+
The manager module is responsible for assigning directories to mirror daemons
107+
for synchronization. Multiple mirror daemons can be spawned to achieve
108+
concurrency in directory snapshot synchronization. When mirror daemons are
109+
spawned (or terminated), the mirroring module discovers the modified set of
110+
mirror daemons and rebalances the directory assignment amongst the new set
111+
thus providing high-availability.
112+
113+
.. note:: Configurations that have multiple mirror daemons are currently
114+
untested. Only a single mirror daemon is recommended.
115+
116+
The mirroring module is disabled by default. To enable mirroring, run the
117+
following command:
104118

105-
The manager module is responsible for assigning directories to mirror daemons for
106-
synchronization. Multiple mirror daemons can be spawned to achieve concurrency in
107-
directory snapshot synchronization. When mirror daemons are spawned (or terminated)
108-
, the mirroring module discovers the modified set of mirror daemons and rebalances
109-
the directory assignment amongst the new set thus providing high-availability.
119+
.. prompt:: bash $
120+
121+
ceph mgr module enable mirroring
110122

111-
.. note:: Multiple mirror daemons is currently untested. Only a single mirror daemon
112-
is recommended.
123+
The mirroring module provides a family of commands for controlling the
124+
mirroring of directory snapshots. To add or remove directories, mirroring
125+
must be enabled for a given file system. To enable mirroring, run a command of the following form:
113126

114-
Mirroring module is disabled by default. To enable mirroring use::
127+
.. prompt:: bash $
115128

116-
$ ceph mgr module enable mirroring
129+
ceph fs snapshot mirror enable <fs_name>
117130

118-
Mirroring module provides a family of commands to control mirroring of directory
119-
snapshots. To add or remove directories, mirroring needs to be enabled for a given
120-
file system. To enable mirroring use::
131+
.. note:: The mirroring-module commands use the ``fs snapshot mirror`` prefix
132+
as distinct from the monitor commands, which use the ``fs mirror`` prefix.
133+
Make sure to use module (that is, ``fs snapshot mirror``) commands.
121134

122-
$ ceph fs snapshot mirror enable <fs_name>
135+
To disable mirroring, run a command of the following form:
123136

124-
.. note:: Mirroring module commands use `fs snapshot mirror` prefix as compared to
125-
the monitor commands which `fs mirror` prefix. Make sure to use module
126-
commands.
137+
.. prompt:: bash $
127138

128-
To disable mirroring, use::
139+
ceph fs snapshot mirror disable <fs_name>
129140

130-
$ ceph fs snapshot mirror disable <fs_name>
141+
After mirroring has been enabled, add a peer to which directory snapshots will
142+
be mirrored. Peers follow the ``<client>@<cluster>`` specification and get
143+
assigned a unique-id (UUID) when added. See the `Creating Users` section for
144+
information on how to create Ceph users for mirroring.
131145

132-
Once mirroring is enabled, add a peer to which directory snapshots are to be mirrored.
133-
Peers follow `<client>@<cluster>` specification and get assigned a unique-id (UUID)
134-
when added. See `Creating Users` section on how to create Ceph users for mirroring.
146+
To add a peer, run a command of the following form:
135147

136-
To add a peer use::
148+
.. prompt:: bash $
137149

138-
$ ceph fs snapshot mirror peer_add <fs_name> <remote_cluster_spec> [<remote_fs_name>] [<remote_mon_host>] [<cephx_key>]
150+
ceph fs snapshot mirror peer_add <fs_name> <remote_cluster_spec> [<remote_fs_name>] [<remote_mon_host>] [<cephx_key>]
139151

140-
`<remote_fs_name>` is optional, and default to `<fs_name>` (on the remote cluster).
152+
``<remote_fs_name>`` is optional, and defaults to ``<fs_name>`` (on the remote
153+
cluster).
141154

142-
This requires the remote cluster ceph configuration and user keyring to be available in
143-
the primary cluster. See `Bootstrap Peers` section to avoid this. `peer_add` additionally
144-
supports passing the remote cluster monitor address and the user key. However, bootstrapping
145-
a peer is the recommended way to add a peer.
155+
This requires that the remote-cluster Ceph configuration and the user keyring
156+
are available in the primary cluster. See the `Bootstrap Peers` section for
157+
more information. The ``peer_add`` subcommand also supports passing the remote
158+
cluster's monitor address and user key. However, bootstrapping a peer is the
159+
recommended way to add a peer.
146160

147161
.. note:: Only a single peer is supported right now.
148162

149-
To remove a peer use::
163+
To remove a peer, run a command of the following form:
164+
165+
.. prompt:: bash $
166+
167+
ceph fs snapshot mirror peer_remove <fs_name> <peer_uuid>
168+
169+
.. note:: See the `Mirror Daemon Status` section on how to figure out Peer
170+
UUID.
150171

151-
$ ceph fs snapshot mirror peer_remove <fs_name> <peer_uuid>
172+
To list the file system mirror peers, run a command of the following form:
152173

153-
.. note:: See `Mirror Daemon Status` section on how to figure out Peer UUID.
174+
.. prompt:: bash $
154175

155-
To list file system mirror peers use::
176+
ceph fs snapshot mirror peer_list <fs_name>
156177

157-
$ ceph fs snapshot mirror peer_list <fs_name>
178+
To configure a directory for mirroring, run a command of the following form:
158179

159-
To configure a directory for mirroring, use::
180+
.. prompt:: bash $
160181

161-
$ ceph fs snapshot mirror add <fs_name> <path>
182+
ceph fs snapshot mirror add <fs_name> <path>
162183

163-
To stop a mirroring directory snapshots use::
184+
To stop a directory from mirroring snapshots, run a command of the following
185+
form:
164186

165-
$ ceph fs snapshot mirror remove <fs_name> <path>
187+
.. prompt:: bash $
166188

167-
Only absolute directory paths are allowed. Also, paths are normalized by the mirroring
168-
module, therefore, `/a/b/../b` is equivalent to `/a/b`::
189+
ceph fs snapshot mirror remove <fs_name> <path>
190+
191+
Only absolute directory paths are allowed. Also, paths are normalized by the
192+
mirroring module. This means that ``/a/b/../b`` is equivalent to ``/a/b``:
193+
194+
.. prompt:: bash $
195+
196+
mkdir -p /d0/d1/d2
197+
ceph fs snapshot mirror add cephfs /d0/d1/d2 {}
198+
ceph fs snapshot mirror add cephfs /d0/d1/../d1/d2
199+
::
169200

170-
$ mkdir -p /d0/d1/d2
171-
$ ceph fs snapshot mirror add cephfs /d0/d1/d2
172-
{}
173-
$ ceph fs snapshot mirror add cephfs /d0/d1/../d1/d2
174201
Error EEXIST: directory /d0/d1/d2 is already tracked
175202

176-
Once a directory is added for mirroring, its subdirectory or ancestor directories are
177-
disallowed to be added for mirroring::
203+
After a directory is added for mirroring, its subdirectory or ancestor
204+
directories are not allowed to be added for mirroring:
205+
206+
.. prompt:: bash $
207+
208+
ceph fs snapshot mirror add cephfs /d0/d1
209+
::
210+
211+
Error EINVAL: /d0/d1 is a ancestor of tracked path /d0/d1/d2
212+
213+
.. prompt:: bash $
214+
215+
ceph fs snapshot mirror add cephfs /d0/d1/d2/d3
216+
::
178217

179-
$ ceph fs snapshot mirror add cephfs /d0/d1
180-
Error EINVAL: /d0/d1 is a ancestor of tracked path /d0/d1/d2
181-
$ ceph fs snapshot mirror add cephfs /d0/d1/d2/d3
182-
Error EINVAL: /d0/d1/d2/d3 is a subtree of tracked path /d0/d1/d2
218+
Error EINVAL: /d0/d1/d2/d3 is a subtree of tracked path /d0/d1/d2
183219

184-
Commands to check directory mapping (to mirror daemons) and directory distribution are
185-
detailed in `Mirror Daemon Status` section.
220+
Commands for checking directory mapping (to mirror daemons) and directory
221+
distribution are detailed in the `Mirror Daemon Status` section.
186222

187223
Bootstrap Peers
188224
---------------

0 commit comments

Comments
 (0)