-.TH lreplicate 8 "2009 Apr 08" Lustre "Lustre Filesystem replication utility"
+.TH lustre_rsync 8 "2009 Apr 08" Lustre "Lustre Filesystem replication utility"
.SH NAME
-lreplicate \- Utility to replicate a Lustre Filesystem
+lustre_rsync \- Utility to replicate a Lustre Filesystem
.SH SYNOPSIS
.br
-.B lreplicate --source|-s <src> --target|-t <tgt>
+.B lustre_rsync --source|-s <src> --target|-t <tgt>
.br
.B\t\t\t --mdt|-m <mdt> [--user|-u <user id>]
.br
.br
.br
-.B lreplicate --statuslog|-l <log>
+.B lustre_rsync --statuslog|-l <log>
.br
.br
-.B lreplicate --statuslog|-l <log> --source|-s <source>
+.B lustre_rsync --statuslog|-l <log> --source|-s <source>
.br
.br
.B\t\t\t --target|-t <tgt> --mdt|-m <mdt>
.SH DESCRIPTION
-.B lreplicate
+.B lustre_rsync
is designed to replicate a Lustre filesystem (source filesystem) to
another target filesystem (any filesystem type) efficiently by
using Lustre MDT changelogs. A changelog user must be registered
.B --statuslog=<log>
.br
A status log file to which the status of replication is saved.
-When lreplicate is started, the state from a previous replication
+When lustre_rsync is started, the state from a previous replication
will be read from here.
If a statuslog from a previous replication operation is specified, the
.TP
Replicate the lustre filesystem /mnt/lustre to /mnt/target.
-$ lreplicate --source=/mnt/lustre --target=/mnt/target \\
+$ lustre_rsync --source=/mnt/lustre --target=/mnt/target \\
.br
--mdt=lustre-MDT0000 --user=cl1 \\
.br
.br
Errors: 0
.br
-lreplicate took 1 seconds
+lustre_rsync took 1 seconds
.br
Changelog records consumed: 22
.br
changes. Only the statuslog needs to be specified as it has all the \
parameters passed earlier.
.br
-$ lreplicate --statuslog replicate.log --verbose
+$ lustre_rsync --statuslog replicate.log --verbose
.br
Replicating Lustre filesystem: lustre
.br
.br
Errors: 0
.br
-lreplicate took 2 seconds
+lustre_rsync took 2 seconds
.br
Changelog records consumed: 42
.br
.TP
To replicate the lustre filesystem /mnt/lustre to /mnt/target1 and /mnt/target2.
-$ lreplicate --source=/mnt/lustre \\
+$ lustre_rsync --source=/mnt/lustre \\
.br
--target=/mnt/target1 --target=/mnt/target2 \\
.br
.SH AUTHOR
-The lreplicate command is part of the Lustre filesystem. Contact
+The lustre_rsync command is part of the Lustre filesystem. Contact
http://www.lustre.org/
.SH SEE ALSO
noinst_SCRIPTS += recovery-mds-scale.sh run_dd.sh run_tar.sh run_iozone.sh
noinst_SCRIPTS += run_dbench.sh run_IOR.sh recovery-double-scale.sh
noinst_SCRIPTS += recovery-random-scale.sh parallel-scale.sh metadata-updates.sh
-noinst_SCRIPTS += lreplicate-test.sh ost-pools.sh rpc.sh
+noinst_SCRIPTS += lustre_rsync-test.sh ost-pools.sh rpc.sh
nobase_noinst_SCRIPTS = cfg/local.sh
nobase_noinst_SCRIPTS += acl/make-tree acl/run cfg/ncli.sh
nobase_noinst_SCRIPTS += racer/dir_create.sh racer/file_create.sh racer/file_list.sh
export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
ONLY=${ONLY:-"$*"}
-ALWAYS_EXCEPT="$LREPLICATE_EXCEPT 5a 5b"
+ALWAYS_EXCEPT="$LRSYNC_EXCEPT 5a 5b"
# bug number for skipped test: - 20878
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
KILL=/bin/kill
TMP=${TMP:-/tmp}
-LREPL_LOG=$TMP/lreplicate.log
+LREPL_LOG=$TMP/lustre_rsync.log
ORIG_PWD=${PWD}
LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
build_test_filter
-export LREPLICATE=${LREPLICATE:-"$LUSTRE/utils/lreplicate"}
-[ ! -f "$LREPLICATE" ] && export LREPLICATE=$(which lreplicate)
-export LREPLICATE="$LREPLICATE -v" # -a
+export LRSYNC=${LRSYNC:-"$LUSTRE/utils/lustre_rsync"}
+[ ! -f "$LRSYNC" ] && export LRSYNC=$(which lustre_rsync)
+export LRSYNC="$LRSYNC -v" # -a
# control the time of tests
DBENCH_TIME=${DBENCH_TIME:-60} # No of seconds to run dbench
}
init_src() {
- rm -rf $TGT/$tdir $TGT/d*.lreplicate-test 2> /dev/null
- rm -rf $TGT2/$tdir $TGT2/d*.lreplicate-test 2> /dev/null
- rm -rf ${DIR}/$tdir $DIR/d*.lreplicate-test ${DIR}/tgt 2> /dev/null
+ rm -rf $TGT/$tdir $TGT/d*.lustre_rsync-test 2> /dev/null
+ rm -rf $TGT2/$tdir $TGT2/d*.lustre_rsync-test 2> /dev/null
+ rm -rf ${DIR}/$tdir $DIR/d*.lustre_rsync-test ${DIR}/tgt 2> /dev/null
rm -f $LREPL_LOG
mkdir -p $TGT
mkdir -p $TGT2
# Replicate
echo "Replication #1"
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
# Set attributes
chmod 000 $DIR/$tdir/d2/file3
fi
echo "Replication #2"
- $LREPLICATE -l $LREPL_LOG
+ $LRSYNC -l $LREPL_LOG
if [ "$xattr" == "yes" ]; then
local xval1=$(getfattr -n user.foo --absolute-names --only-values \
sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME || error "dbench failed!"
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
# Use diff to compare the source and the destination
check_diff $DIR/$tdir $TGT/$tdir
$KILL -SIGSTOP $child_pid
echo Starting replication
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
echo Resuming dbench
$KILL -SIGSTOP $child_pid
echo Starting replication
- $LREPLICATE -l $LREPL_LOG
+ $LRSYNC -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
echo "Wait for dbench to finish"
# Replicate the changes to $TGT
echo Starting replication
- $LREPLICATE -l $LREPL_LOG
+ $LRSYNC -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
local quit=0
while [ $quit -le 1 ];
do
- echo "Running lreplicate"
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m ${mds1_svc} -u $CL_USER -l $LREPL_LOG
+ echo "Running lustre_rsync"
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m ${mds1_svc} -u $CL_USER -l $LREPL_LOG
sleep 5
pgrep dbench
if [ $? -ne 0 ]; then
createmany -o $DIR/$tdir/$tfile $numfiles || error "createmany failed!"
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
writemany -q -a $DIR/$tdir/$tfile $time $threads || error "writemany failed!"
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
unlinkmany $DIR/$tdir/$tfile $numfiles || error "unlinkmany failed!"
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
$KILL -SIGSTOP $child_pid
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
sleep 1;
done
- $LREPLICATE -l $LREPL_LOG
+ $LRSYNC -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
}
run_test 4 "Replicate files created by iozone"
-# Test 5a - Stop / start lreplicate
+# Test 5a - Stop / start lustre_rsync
test_5a() {
[ "$SLOW" = "no" ] && skip "Skipping slow test" && return
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG &
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG &
local child_pid=$!
sleep 30
$KILL -SIGHUP $child_pid
wait
- $LREPLICATE -l $LREPL_LOG
+ $LRSYNC -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
cleanup_src_tgt
return 0
}
-run_test 5a "Stop / start lreplicate"
+run_test 5a "Stop / start lustre_rsync"
-# Test 5b - Kill / restart lreplicate
+# Test 5b - Kill / restart lustre_rsync
test_5b() {
[ "$SLOW" = "no" ] && skip "Skipping slow test" && return
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG &
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG &
local child_pid=$!
sleep 30
$KILL -SIGKILL $child_pid
wait
- $LREPLICATE -l $LREPL_LOG
+ $LRSYNC -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
cleanup_src_tgt
return 0
}
-run_test 5b "Kill / restart lreplicate"
+run_test 5b "Kill / restart lustre_rsync"
-# Test 6 - lreplicate large no of hard links
+# Test 6 - lustre_rsync large no of hard links
test_6() {
init_src
init_changelog
done
# Replicate the changes to $TGT
- $LREPLICATE -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -t $TGT2 -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff $DIR/$tdir $TGT/$tdir
check_diff $DIR/$tdir $TGT2/$tdir
cleanup_src_tgt
return 0
}
-run_test 6 "lreplicate large no of hard links"
+run_test 6 "lustre_rsync large no of hard links"
-# Test 7 - lreplicate stripesize
+# Test 7 - lustre_rsync stripesize
test_7() {
init_src
init_changelog
# To simulate replication to another lustre filesystem, replicate
# the changes to $DIR/tgt. We can't turn off the changelogs
- # while we are registered, so lreplicate better not try to
+ # while we are registered, so lustre_rsync better not try to
# replicate the replication steps. It seems ok :)
mkdir $DIR/tgt
- $LREPLICATE -s $DIR -t $DIR/tgt -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $DIR/tgt -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff ${DIR}/$tdir $DIR/tgt/$tdir
local i=0
cleanup_src_tgt
return 0
}
-run_test 7 "lreplicate stripesize"
+run_test 7 "lustre_rsync stripesize"
# Test 8 - Replicate multiple file/directory moves
test_8() {
mv $DIR/$tdir/d$i $DIR/$tdir/d0$i
done
- $LREPLICATE -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG
+ $LRSYNC -s $DIR -t $TGT -m $MDT0 -u $CL_USER -l $LREPL_LOG
check_diff ${DIR}/$tdir $TGT/$tdir
rootsbin_PROGRAMS = mount.lustre
sbin_PROGRAMS = mkfs.lustre tunefs.lustre lctl wiretest \
l_getidentity llverfs llverdev \
- llog_reader lr_reader lshowmount lreplicate \
+ llog_reader lr_reader lshowmount lustre_rsync \
ll_recover_lost_found_objs ltrack_stats
if LIBPTHREAD
sbin_PROGRAMS += loadgen
loadgen_LDADD := $(LIBREADLINE) liblustreapi.a $(LIBPTLCTL) $(PTHREAD_LIBS)
loadgen_DEPENDENCIES := $(LIBPTLCTL)
-lreplicate_SOURCES = lreplicate.c obd.c lustre_cfg.c lreplicate.h
-lreplicate_LDADD := $(LIBREADLINE) liblustreapi.a $(LIBPTLCTL)
-lreplicate_DEPENDENCIES := $(LIBPTLCTL) liblustreapi.a
+lustre_rsync_SOURCES = lustre_rsync.c obd.c lustre_cfg.c lustre_rsync.h
+lustre_rsync_LDADD := $(LIBREADLINE) liblustreapi.a $(LIBPTLCTL)
+lustre_rsync_DEPENDENCIES := $(LIBPTLCTL) liblustreapi.a
ll_recover_lost_found_objs_SOURCES = ll_recover_lost_found_objs.c
ll_recover_lost_found_objs_LDADD := $(LIBPTLCTL)
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
- * lustre/utils/lreplicate.c
+ * lustre/utils/lustre_rsync.c
*
* Author: Kalpak Shah <Kalpak.Shah@Sun.COM>
* Author: Manoj Joseph <Manoj.Joseph@Sun.COM>
*/
/*
- * - lreplicate is a tool for replicating a lustre filesystem.
+ * - lustre_rsync is a tool for replicating a lustre filesystem.
*
* - The source-fs is a live lustre filesystem. It is not a
* snapshot. It is mounted and undergoing changes
* - There is a changelog of all metadata operations that happened on
* the filesystem since the 'sync point'.
*
- * - lreplicate replicates all the operations saved in the changelog
+ * - lustre_rsync replicates all the operations saved in the changelog
* on to the target filesystem to make it identical to the source.
*
* To facilitate replication, the lustre filesystem provides
* With just this information, it is not alwasy possible to determine
* the file paths for each operation. For instance, if pfid does not
* exist on the source-fs (due to a subsequent deletion), its path
- * cannot be queried. In such cases, lreplicate keeps the files in a
+ * cannot be queried. In such cases, lustre_rsync keeps the files in a
* special directory ("/.lustrerepl"). Once all the operations in a
* changelog are replayed, all the files in this special directory
* will get moved to the location as in the source-fs.
#include <libcfs/libcfsutil.h>
#include <lustre/liblustreapi.h>
#include <lustre/lustre_idl.h>
-#include "lreplicate.h"
+#include "lustre_rsync.h"
#define REPLICATE_STATUS_VER 1
#define CLEAR_INTERVAL 100
struct lr_parent_child_list *pc_next;
};
-struct lreplicate_status *status;
+struct lustre_rsync_status *status;
char *statuslog; /* Name of the status log file */
int logbackedup;
int noxattr; /* Flag to turn off replicating xattrs */
/* Command line usage */
void lr_usage()
{
- fprintf(stderr, "\tlreplicate -s <lustre_root_path> -t <target_path> "
+ fprintf(stderr, "\tlustre_rsync -s <lustre_root_path> -t <target_path> "
"-m <mdt> -r <user id> -l <status log>\n"
- "lreplicate can also pick up parameters from a "
+ "lustre_rsync can also pick up parameters from a "
"status log created earlier.\n"
- "\tlreplicate -l <log_file>\n"
+ "\tlustre_rsync -l <log_file>\n"
"options:\n"
"\t--xattr <yes|no> replicate EAs\n"
"\t--abort-on-err abort at first err\n"
/* Initialize the replication parameters */
int lr_init_status()
{
- size_t size = sizeof(struct lreplicate_status) + PATH_MAX;
+ size_t size = sizeof(struct lustre_rsync_status) + PATH_MAX;
if (status != NULL)
return 0;
{
struct lr_parent_child_list *tmp;
struct lr_parent_child_log rec;
- struct lreplicate_status *s;
+ struct lustre_rsync_status *s;
int fd = -1;
size_t size;
- size_t read_size = sizeof(struct lreplicate_status) + PATH_MAX;
+ size_t read_size = sizeof(struct lustre_rsync_status) + PATH_MAX;
int rc = 0;
if (statuslog == NULL)
lr_clear_cl(info, 1);
if (verbose) {
- printf("lreplicate took %ld seconds\n", time(NULL) - start);
+ printf("lustre_rsync took %ld seconds\n", time(NULL) - start);
printf("Changelog records consumed: %lld\n", rec_count);
}
{
/* Set a flag for the replicator to gracefully shutdown */
quit = 1;
- printf("lreplicate halting.\n");
+ printf("lustre_rsync halting.\n");
}
int main(int argc, char *argv[])
ignored. */
status->ls_num_targets = numtargets;
}
- newsize = sizeof (struct lreplicate_status) +
+ newsize = sizeof (struct lustre_rsync_status) +
(status->ls_num_targets * PATH_MAX);
if (status->ls_size != newsize) {
status->ls_size = newsize;
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
- * lustre/include/lustre/lreplicate.h
+ * lustre/include/lustre/lustre_rsync.h
*
*/
-#ifndef _LREPLICATE_H_
-#define _LREPLICATE_H_
+#ifndef _LUSTRE_RSYNC_H_
+#define _LUSTRE_RSYNC_H_
#define LR_NAME_MAXLEN 64
#define LR_FID_STR_LEN 128
-/* Structure used by lreplicate. On-disk structures stored in a log
+/* Structure used by lustre_rsync. On-disk structures stored in a log
* file. This is used to determine the next start record and other
* parameters. */
-struct lreplicate_status {
+struct lustre_rsync_status {
__u32 ls_version; /* Version of the log entry */
__u32 ls_size; /* Size of the log entry */
__u64 ls_last_recno; /* Last replicated record no. */
char pcl_name[PATH_MAX];
};
-#endif /* _LREPLICATE_H_ */
+#endif /* _LUSTRE_RSYNC_H_ */