Manage asynchronous replication
Configure, operate, and recover asynchronous replication between NeuralMesh clusters.
All procedures require ClusterAdmin privileges. Manage asynchronous replication through this workflow:
Prepare both clusters.
Link the clusters.
Create a replication pair.
After you create a pair, use the on-demand procedures to monitor, modify, pause, or remove replication, manage file hydration, fail over to the target cluster, and fail back to the original source cluster.
The procedures use the weka replication link and weka replication fs-pair command groups.
Prepare the clusters for replication
Prepare both clusters for replication. Replication traffic passes through the S3 service of each cluster, over a dedicated replica route. Replication creates no bucket, S3 user, or object store filesystem of its own.
Before you begin
Ensure the clusters can reach each other over the management network (port 14000 by default) and over the S3 port of each cluster.
Procedure
Run steps 1 to 3 on both clusters.
Verify the replication license. Run
weka cluster licenseand check that Cross-Cluster Replication under Installed License shows Licensed. To add the entitlement, contact your WEKA account team.Set the cluster name. Run
weka cluster update --cluster-name <name>. The link is named after the cluster at the other end.Create an S3 cluster with at least one server serving S3. Run
weka s3 cluster add. See Manage the S3 cluster using the CLI.Optional: For Selective copy - critical paths (
--copy-pathwith specific directories), set up a Data Services container on the target cluster. Full data copy (--copy-path full) and Selective copy - metadata only (--copy-path none) do not need it. See Set up a Data Services container for background tasks.
Link the clusters
Link the two clusters so they can authenticate each other and replicate filesystems.
One weka replication link add command, run on either cluster, creates the link on both clusters. It authenticates to the other cluster with a cluster admin account on that cluster, pins the TLS certificate the other cluster presents, and creates the replication credentials for both clusters. There are no S3 users or keys to manage for replication. To rotate the credentials of a link, contact the Customer Success Team.
Before you begin
Complete the preparation on both clusters.
Get the management hostname or IP address of the other cluster, and the username and password of a cluster admin on it.
If the clusters can reach each other only through public addresses, contact the Customer Success Team before you link them.
The source cluster hosts the filesystem being replicated. The target cluster receives the replicated filesystem. This procedure runs the link command on the source cluster.
Procedure
On the target cluster, display the fingerprint of its TLS certificate, and record the colon-separated hexadecimal value:
On the source cluster, link to the target cluster:
Provide the password with --password, with the WEKA_PEER_PASSWORD environment variable, or at the prompt. On success, the command reports the ID of the new link: Cluster link added with ID <ID>.
If you run the command interactively without --fingerprint, it displays the fingerprint the other cluster presents and asks you to confirm it. Compare it with the weka security tls status output from the other cluster before you continue.
If a link to the other cluster already exists on either cluster, the command reports which cluster holds it and makes no change. Remove the existing link, then add it again. See Remove a replication link.
Parameters for weka replication link add
--peer-host*
Management hostname or IP address of the cluster to link to.
--username*
Cluster admin username on the other cluster.
--password
Password for --username. Alternatively, use the WEKA_PEER_PASSWORD environment variable or the interactive prompt.
--fingerprint
Expected SHA-256 fingerprint of the TLS certificate of the other cluster, as shown by weka security tls status on that cluster. Required in non-interactive mode unless you use --auto-accept-peer-cert.
--auto-accept-peer-cert
Accepts the TLS certificate the other cluster presents, without confirming its fingerprint. The certificate is still pinned and checked on every later connection.
--peer-port
Management API port of the other cluster. Default: 14000.
Verify the link on either cluster:
Confirm that Connection shows connected and Pairing shows mutual. Record the link ID. You use it to create replication pairs.
A link is identified by its ID. Its name follows the name of the other cluster, so two links can have the same name. Every weka replication link command, and weka replication fs-pair add --link-id, takes the ID.
Refresh a replication link
Refresh a link when the other cluster changes its name, management addresses, or S3 endpoints. Both clusters replace what they hold about each other with what the other cluster now reports. The refresh runs over the existing authenticated link and requires no password.
Procedure
Refresh the link on either cluster:
Use --peer-host and --peer-port to reach the other cluster for this run when its recorded addresses no longer work. The command does not store these values.
If a different cluster answers at the recorded address, the refresh stops. Remove the link and add it again.
Create a replication pair
Create a replication pair between a local filesystem and a filesystem on a linked cluster, and define its replication policy.
The replication policy determines the replication interval, which paths are copied proactively, when snapshots become visible on the target, and how many snapshots are retained.
Before you begin
Choose the copy option and access strategy for the workload. See Asynchronous replication. For a full data copy, ensure the target capacity is at least the source filesystem size.
Ensure the link to the target cluster shows Connection
connectedordegradedand Pairingmutualinweka replication link.Ensure the target cluster has a filesystem group with the same name as the group of the source filesystem. The target filesystem is created in that group.
Procedure
Create the replication pair on the source cluster:
The target filesystem is created automatically on the target cluster during the first replication cycle. It must not already exist. If it does, the command fails. On success, the command returns the new pair and its ID:
Parameters
The following parameters apply to weka replication fs-pair add. They do not apply to weka replication fs-pair.
--source-filesystem
Name of the local source filesystem.
--link-id
ID of the replication link to the target cluster, as shown by weka replication link.
--target-filesystem
Name of the filesystem on the remote cluster. It can be the same as the source filesystem name.
--interval
Replication interval, for example, 5m or 1h. From 5 minutes to 30 days.
--copy-path
Specifies up to 10 paths to copy proactively. Each path can be up to 1,023 characters long, and all paths together up to 2,048 characters. Separate paths with commas or repeat the option. Use full, all, or / to copy all data. Use none or null to replicate metadata only. Default: metadata-only replication.
--access-strategy
Controls when a target snapshot becomes accessible. INSTANT_ACCESS (default) exposes the snapshot immediately. Data not copied locally is retrieved on demand. COPY_FIRST exposes the snapshot only after the --copy-path data is local.
--apply-strategy
Controls when the target applies a replicated snapshot. AUTOMATIC applies the snapshot after the prerequisite phase completes.
--snapshots-to-keep
Number of snapshots to retain, from 2 to 25. Default: 3. Retaining more snapshots requires more storage. Enforced only while the pair is running; see Pause and resume replication.
--target-total-capacity
Total capacity for the target filesystem. Default: same as the source filesystem. A smaller target is allowed for a selective copy. A full copy requires at least the source size.
--now
Triggers the first replication cycle immediately instead of waiting one full interval.
Examples
Create a full data copy pair for disaster recovery over link 1, replicating every 5 minutes:
Replicate only selected directories:
Verify that the pair is created and running:
Monitor replication status
Monitor the state, progress, and health of replication pairs and cluster links.
View replication pairs
List the replication pairs and their current status:
The output shows for each pair:
Role:
SOURCEfor a pair this cluster drives, orTARGETfor a pair that another cluster replicates into this one. ATARGETrow is read-only. To change the pair, run the command on the source cluster.State: The overall state of the pair, such as
RUNNINGorERROR.Link: The name of the linked cluster.
Interval, Apply, Access, Copy: The configured replication policy.
Last Replication: The timestamp of the last completed replication cycle. Use it to assess the current recovery point.
Current Status: The current activity of the pair, such as
COPY,IDLE, orERROR. If a copy task is stuck, the status includes the reason.
Each cluster assigns its own pair IDs, so the same pair can have different IDs on the source and the target clusters.
For the pair UID, the link ID, and the number of snapshots to keep, run:
To customize the output, use the --output, --filter, and --sort options with any of the available columns, including last-error and last-error-time for troubleshooting.
Monitor replication interval compliance
The replication interval sets the target for each pair. There is no separate setting. The system times each cycle from its start and raises an alert when the cycle overruns the interval by more than one minute. Replication alerts are raised only on the source cluster and are not propagated to the target cluster.
Replication behind schedule
Minor
The configured interval, plus one minute
Replication behind schedule
Major
Three times the configured interval, plus one minute
The alert names the filesystem and the linked cluster, and reports the interval, how long the cycle has run, by how much it exceeds the target, and the time of the last completed cycle. Use the alert history as the compliance record.
No replication interval alert is raised for a pair that is paused, not running, or still in its first replication cycle.
View active alerts:
If a replication interval alert fires, inspect the cycle:
Common causes are a slow or broken connection to the linked cluster, an S3 service problem on the linked cluster, or low free capacity on the target. Repair the connection or the S3 service, or free space. If the source change rate consistently outpaces the connection, lengthen the interval or add bandwidth.
View replication link health
Check the connection and pairing status of each replication link. The status reflects the management endpoints of the other cluster. To check its S3 service, watch the Last Error column of the pairs that use the link, and the replication interval alerts. If Last Error reports an S3 authentication failure, contact the Customer Success Team.
Procedure
List the replication links:
To include the link UID, data IPs, and data port, add -v.
Check the Connection and Pairing columns:
Connection
connected
Every management endpoint of the other cluster answers.
Connection
degraded
Some management endpoints of the other cluster answer.
Connection
disconnected
No management endpoint of the other cluster answers.
Pairing
mutual
The other cluster holds a matching link.
Pairing
local-only
The other cluster holds no matching link. To repair it, remove the link and add it again.
Pairing
unknown
No management endpoint of the other cluster answers, so the pairing can’t be determined.
Modify the replication policy
Modify the policy of an existing replication pair without recreating it. Run the commands on the source cluster.
Before you begin
Identify the replication pair ID:
Procedure
Update the pair policy:
Use the parameter descriptions in the preceding table, with the following additions:
--copy-pathreplaces the entire copy path set. Usenoneornullto clear the set. Mutually exclusive with--add-copy-pathand--remove-copy-path.--add-copy-pathadds paths to the copy path set. Separate multiple paths with commas or repeat the option.--remove-copy-pathremoves paths from the copy path set. Separate multiple paths with commas or repeat the option.
Verify the updated policy:
Example
Switch a pair to Selective copy - metadata only and lengthen its interval:
Pause and resume replication
Pause a replication pair before maintenance or before removing it, and resume it to continue replication.
While a pair is paused, no new snapshot deltas are transferred to the target. On-demand data access on the target continues to work.
Pause a replication pair
Procedure
On the source cluster, pause the pair:
Resume a replication pair
Procedure
On the source cluster, resume the pair:
Replication continues from the last consistent state.
Manage file hydration on the target
Fetch the data of individual files to the target cluster proactively, monitor hydration progress, and release file data back to on-demand mode.
With a selective replication policy, file data is retrieved from the source cluster when files are accessed on the target. Use the hydration commands to control this behavior per file: fetch a file before a workload needs it, or release local data to free capacity on the target.
Fetch a file proactively
Fetch a file's data blocks from the source cluster in the background:
You can run up to five fetch commands concurrently. A sixth concurrent fetch command fails.
<path>is a local mount path. Alternatively, specify--filesystemand provide a path relative to the filesystem root.Use
--snapshotto resolve the path within a snapshot view instead of the live filesystem.
Monitor hydration progress
Fetch and release operations run in the background. Check the hydration status for a file:
Release file data
Return a file's data blocks to on-demand mode to free capacity on the target. The release runs in the background:
By default, background dehydration starts when the target filesystem uses 95% of its SSD capacity. It stops when usage falls to 90%.
Each <path> is a local mount path. Release several files in one command by listing more than one path. Monitor progress with weka replication fs-pair hydration status.
This command runs on the container that holds the mount, so it cannot be directed at another cluster with --HOST.
Remove a replication pair
Remove a replication pair when you no longer need to synchronize the source and target filesystems, or as part of a failover procedure.
Before you begin
Identify the replication pair ID on the source cluster:
Procedure
On the source cluster, pause the replication pair. A running pair cannot be removed. A pair in the
ERRORstate can be removed without pausing it:
Wait until the pair finishes its current cycle and Current Status shows IDLE.
Remove the pair:
The command removes the pair from both clusters, and reports success only after both are done. It prompts for confirmation. Use --force to skip the confirmation prompt, for example, in scripts.
If the target cluster is unreachable, the removal fails and the pair stays on both clusters. Retry when the target is reachable again. To remove the pair from the source cluster only, add --local-only, and then remove it on the target cluster as well.
Verify that the pair is no longer listed:
The target filesystem remains write-protected after the pair is removed. To make it writable, run this command on the target cluster:
Do this only when you intend to promote the target, such as during failover. See Activate the target cluster during failover.
Remove a pair on the target cluster
On the target cluster, weka replication fs-pair remove removes an incoming pair (role TARGET) only with --local-only. Use it when the source cluster is unavailable. The pair does not need to be paused:
If the source cluster is still running, its next replication cycle for the pair moves to the error state. Remove the pair on the source cluster as well.
Remove a replication link
Remove a replication link when replication between the two clusters is no longer required. One command removes the link from both clusters.
Before you begin
Remove every replication pair that uses the link, in both directions. See Remove a replication pair. Identify the link ID:
Procedure
Remove the link on either cluster:
The command prompts for confirmation. Use --force to skip the confirmation prompt.
Verify on both clusters that the link is gone:
If the command reports that the link is in use, a replication pair or a task still uses it, or a filesystem on this cluster still receives a replica over it. Remove the remaining pairs, or wait for the task to finish, and run the command again.
To remove the link on this cluster only, add --local-only. Use it when the other cluster is unreachable or no longer exists, or when the link exists on only one of the clusters. --local-only also removes a link that a target filesystem still receives a replica over.
Removing a link does not restore write access to the target filesystems. They stay write-protected until you promote them, as described in Activate the target cluster during failover.
Activate the target cluster during failover
Activate the target filesystem when the source cluster becomes unavailable, and redirect clients to it.
Before you begin
Confirm the recovery point. On the source cluster, if it is still reachable, check the Last Replication timestamp:
Confirm that the target contains the data you need:
With
COPY_FIRSTand--copy-path full, all data is local. No action is required.Hydrate data before breaking any other pair type. This includes
INSTANT_ACCESS, Selective copy - critical paths pairs, and smaller targets.Run
weka replication fs-pair fetch <path>for each path you need on the target. Any file you do not fetch is retrieved on demand: opening or reading it on the target filesystem fetches its data from the source. See Manage file hydration on the target.
Procedure
The steps differ depending on whether the source cluster is still reachable.
Planned failover, source cluster reachable:
On the source cluster, pause the pair, wait until Current Status shows
IDLE, and remove it. The removal clears the pair on both clusters:
Disaster failover, source cluster unavailable:
On the target cluster, remove the incoming pair. The source is unreachable, so the pair is removed on the target only:
Both cases, to promote the target:
Remove write protection from the target filesystem. On the target cluster:
Mount the filesystem on a client and verify the data before redirecting production traffic to it.
When the source cluster returns, its pair moves to the error state on the next cycle. Remove the pair on the source cluster with weka replication fs-pair remove <pair ID>.
Fail back to the original source cluster
After a failover, return replication and clients to the original source cluster by creating a replication pair in the reverse direction, from the former target to the original source. Keep the cluster link: one link carries replication in both directions. The new pair starts with a full first replication cycle.
Before you begin
Confirm that the original source cluster is running. On the former target cluster, run
weka replication linkand check that the link shows Connectionconnectedordegradedand Pairingmutual.After a disaster failover, the original source cluster still lists the old pair, in the
ERRORstate. Remove it on that cluster withweka replication fs-pair remove <pair ID>. A pair in theERRORstate does not need to be paused. After a planned failover, the pair is already removed from both clusters.Choose the filesystem name on the original source cluster. The replication pair creates this filesystem in its first cycle, so the name must not exist there. Use a new name, or remove the original filesystem first.
Procedure
On the former target cluster, identify the link ID:
On the former target cluster, create the pair. Use a full data copy with
COPY_FIRST, so all data is local on the original source cluster before you move clients back:
Wait until Last Replication shows a completed cycle:
Move clients back by following Activate the target cluster during failover, with the original source cluster as the target.
Last updated