<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.lustre.org/index.php?action=history&amp;feed=atom&amp;title=Lustre_Rsync_Replication</id>
	<title>Lustre Rsync Replication - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.lustre.org/index.php?action=history&amp;feed=atom&amp;title=Lustre_Rsync_Replication"/>
	<link rel="alternate" type="text/html" href="http://wiki.lustre.org/index.php?title=Lustre_Rsync_Replication&amp;action=history"/>
	<updated>2026-09-01T17:16:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://wiki.lustre.org/index.php?title=Lustre_Rsync_Replication&amp;diff=5581&amp;oldid=prev</id>
		<title>Elliswilson: Created page with &quot;== Overview ==  &lt;code&gt;lustre_rsync&lt;/code&gt; replicates a Lustre filesystem to another filesystem (Lustre or non-Lustre) using MDT changelogs. After an initial full sync, subsequent runs only process changes recorded since the last sync, making incremental replication efficient.  == Prerequisites ==  * The source filesystem must have changelogs enabled on the MDT. * The target filesystem must be mounted and writable. * An initial full sync must be completed &#039;&#039;&#039;before&#039;&#039;&#039; reg...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.lustre.org/index.php?title=Lustre_Rsync_Replication&amp;diff=5581&amp;oldid=prev"/>
		<updated>2026-07-20T15:28:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Overview ==  &amp;lt;code&amp;gt;lustre_rsync&amp;lt;/code&amp;gt; replicates a Lustre filesystem to another filesystem (Lustre or non-Lustre) using MDT changelogs. After an initial full sync, subsequent runs only process changes recorded since the last sync, making incremental replication efficient.  == Prerequisites ==  * The source filesystem must have changelogs enabled on the MDT. * The target filesystem must be mounted and writable. * An initial full sync must be completed &amp;#039;&amp;#039;&amp;#039;before&amp;#039;&amp;#039;&amp;#039; reg...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;lustre_rsync&amp;lt;/code&amp;gt; replicates a Lustre filesystem to another filesystem (Lustre or non-Lustre) using MDT changelogs. After an initial full sync, subsequent runs only process changes recorded since the last sync, making incremental replication efficient.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
* The source filesystem must have changelogs enabled on the MDT.&lt;br /&gt;
* The target filesystem must be mounted and writable.&lt;br /&gt;
* An initial full sync must be completed &amp;#039;&amp;#039;&amp;#039;before&amp;#039;&amp;#039;&amp;#039; registering the changelog user and starting changelog-based replication.&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Setup ==&lt;br /&gt;
&lt;br /&gt;
=== 1. Perform Initial Full Sync ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This must be done before registering the changelog user.&amp;#039;&amp;#039;&amp;#039; Use standard &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; to copy the entire source filesystem to the target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync -av --xattrs /mnt/source_fs/ /mnt/target_fs/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you register the changelog user and start &amp;lt;code&amp;gt;lustre_rsync&amp;lt;/code&amp;gt; without completing the initial sync first, the target will be missing files that existed before the changelog user was registered. The changelog only records changes &amp;#039;&amp;#039;after&amp;#039;&amp;#039; registration.}}&lt;br /&gt;
&lt;br /&gt;
=== 2. Register a Changelog User ===&lt;br /&gt;
&lt;br /&gt;
Register a changelog user on the source MDT. This creates a consumer that tracks which changelog records have been processed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lctl --device testfs-MDT0000 changelog_register&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This returns a changelog user ID (e.g., &amp;lt;code&amp;gt;cl1&amp;lt;/code&amp;gt;). Note this ID — it is required for all subsequent &amp;lt;code&amp;gt;lustre_rsync&amp;lt;/code&amp;gt; invocations.&lt;br /&gt;
&lt;br /&gt;
To verify:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lctl get_param mdd.testfs-MDT0000.changelog_users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 3. First lustre_rsync Run ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lustre_rsync --source=/mnt/source_fs \&lt;br /&gt;
             --target=/mnt/target_fs \&lt;br /&gt;
             --mdt=testfs-MDT0000 \&lt;br /&gt;
             --user=cl1 \&lt;br /&gt;
             --statuslog=/var/log/lustre_rsync.status \&lt;br /&gt;
             --verbose&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Key options:&lt;br /&gt;
* &amp;lt;code&amp;gt;--source&amp;lt;/code&amp;gt; — mount point of the source Lustre filesystem.&lt;br /&gt;
* &amp;lt;code&amp;gt;--target&amp;lt;/code&amp;gt; — mount point of the target filesystem.&lt;br /&gt;
* &amp;lt;code&amp;gt;--mdt&amp;lt;/code&amp;gt; — MDT device name (e.g., &amp;lt;code&amp;gt;testfs-MDT0000&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;lt;code&amp;gt;--user&amp;lt;/code&amp;gt; — changelog user ID returned by &amp;lt;code&amp;gt;changelog_register&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;--statuslog&amp;lt;/code&amp;gt; — file to track sync progress. Required for incremental runs.&lt;br /&gt;
* &amp;lt;code&amp;gt;--verbose&amp;lt;/code&amp;gt; — optional, prints progress.&lt;br /&gt;
&lt;br /&gt;
=== 4. Subsequent Runs ===&lt;br /&gt;
&lt;br /&gt;
After the first run, only the &amp;lt;code&amp;gt;--statuslog&amp;lt;/code&amp;gt; is required. &amp;lt;code&amp;gt;lustre_rsync&amp;lt;/code&amp;gt; reads the status file to determine where it left off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lustre_rsync --statuslog=/var/log/lustre_rsync.status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run this periodically (e.g., via cron) to keep the target in sync.&lt;br /&gt;
&lt;br /&gt;
== Multiple Targets ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;lustre_rsync&amp;lt;/code&amp;gt; supports replicating to multiple targets simultaneously:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lustre_rsync --source=/mnt/source_fs \&lt;br /&gt;
             --target=/mnt/target_fs1 \&lt;br /&gt;
             --target=/mnt/target_fs2 \&lt;br /&gt;
             --mdt=testfs-MDT0000 \&lt;br /&gt;
             --user=cl1 \&lt;br /&gt;
             --statuslog=/var/log/lustre_rsync.status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each target receives the same set of changes.&lt;br /&gt;
&lt;br /&gt;
== Additional Options ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Option !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--dry-run&amp;lt;/code&amp;gt; || Show what would be done without making changes.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--abort-on-err&amp;lt;/code&amp;gt; || Stop on the first error instead of continuing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;-D&amp;lt;/code&amp;gt; || Debug mode — verbose logging for troubleshooting.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--xattr=no&amp;lt;/code&amp;gt; || Skip syncing extended attributes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DNE Considerations ==&lt;br /&gt;
&lt;br /&gt;
For filesystems with multiple MDTs (DNE), you need one changelog user per MDT and one &amp;lt;code&amp;gt;lustre_rsync&amp;lt;/code&amp;gt; process per MDT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Register on each MDT&lt;br /&gt;
lctl --device testfs-MDT0000 changelog_register  # returns cl1&lt;br /&gt;
lctl --device testfs-MDT0001 changelog_register  # returns cl1&lt;br /&gt;
&lt;br /&gt;
# Run lustre_rsync for each MDT&lt;br /&gt;
lustre_rsync --source=/mnt/source_fs --target=/mnt/target_fs \&lt;br /&gt;
             --mdt=testfs-MDT0000 --user=cl1 \&lt;br /&gt;
             --statuslog=/var/log/lustre_rsync_mdt0.status &amp;amp;&lt;br /&gt;
&lt;br /&gt;
lustre_rsync --source=/mnt/source_fs --target=/mnt/target_fs \&lt;br /&gt;
             --mdt=testfs-MDT0001 --user=cl1 \&lt;br /&gt;
             --statuslog=/var/log/lustre_rsync_mdt1.status &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Deregistering a Changelog User ==&lt;br /&gt;
&lt;br /&gt;
When replication is no longer needed, deregister the changelog user to allow changelog records to be purged:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lctl --device testfs-MDT0000 changelog_deregister cl1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Warning|Failing to deregister unused changelog users causes changelogs to accumulate indefinitely, consuming MDT space.}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Lustre Backup Strategies]]&lt;br /&gt;
* [[Backing Up a Lustre File System]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Lustre Systems Administration]]&lt;br /&gt;
[[Category:Lustre Backup and Recovery]]&lt;/div&gt;</summary>
		<author><name>Elliswilson</name></author>
	</entry>
</feed>