Questo contenuto non è disponibile nella lingua selezionata.

Chapter 15. Incremental Backup Assistance using Glusterfind


Glusterfind is a utility that provides the list of files that are modified between the previous backup session and the current period. The commands can be executed at regular intervals to retrieve the list. Multiple sessions for the same volume can be present for different use cases. The changes that are recorded are, new file/directories, data/metadata modifications, rename, and deletes.

15.1. Glusterfind Configuration Options

The following is the list configuration options available in Glusterfind:
  • Glusterfind Create
  • Glusterfind Pre
  • Glusterfind Post
  • Glusterfind Query
  • Glusterfind List
  • Glusterfind Delete

Note

All the glusterfind configuration commands such as, glusterfind pre, glusterfind post, glusterfind list, and glusterfind delete for a session have to be executed only on the node on which session is created.
Glusterfind Create

To create a session for a particular instance in the volume, execute the following command:

# glusterfind create [-h] [--debug] [--force] <SessionName> <volname> [--reset-session-time]
where,
--force: is executed when a new node/brick is added to the volume .
--reset-session-time: forces reset of the session time. The next incremental run will start from this time.
--help OR -h: Used to display help for the command.
SessionName: Unique name of a session.
volname: Name of the volume for which the create command is executed.
For example:
# glusterfind create sess_vol1 vol1
Session sess_vol1 created with volume vol1
Glusterfind Pre

Ensure that all nodes are online before glusterfind Pre operation. To retrieve the list of modified files and directories and store it in the outfile, execute the following command:

# glusterfind pre [-h] [--debug] [--no-encode] [--full] [--disable-partial] [--output-prefix OUTPUT_PREFIX] [--regenerate-outfile] [-N] [--tag-for-full-find TAG_FOR_FULL_FIND] [--type {f,d,both}] [--field-separator FIELD_SEPARATOR] <session> <volname> <outfile>
where,
--help OR -h: Displays help for the command
--debug: Enables the debug mode
--no-encode: The file paths are encoded by default in the output file. This option disables encoding of file paths.
--full: Performs a full search.
--disable-partial: Disables the partial-find feature that is enabled by default.
--output-prefix OUTPUT_PREFIX: Prefix to the path/name that is specified in the outfile.
--regenerate-outfile: Regenerates a new outfile and discards the outfile generated from the last pre command.
-N OR --only-namespace-changes: List only namespace changes
--tag-for-full-find TAG_FOR_FULL_FIND: Tag prefix for file names emitted during a full find operation. Default value is NEW
--type {f,d,both}: type: f, f-files only ; d, d-directories only ; by default = both
--field-separator: Specifies the character/s that glusterfind output uses to separate fields. By default this is a single space, but if your file names contain spaces, you may want to change the delimiter so you can parse the output of glusterfind automatically.
session: Unique name of a session.
volname: Name of the volume for which the pre command is executed.
outfile: Incremental list of modified files.
For example:
# glusterfind pre sess_vol1 vol1 /tmp/outfile.txt
Generated output file /tmp/outfile.txt

Note

The output format is <TYPE> <PATH1> <PATH2>. Possible type values are, NEW, MODIFY, DELETE and RENAME. PATH2 is applicable only if type is RENAME. For example:
NEW file1
NEW dir1%2Ffile2
MODIFY dir3%2Fdir4%2Ftest3
RENAME test1 dir1%2F%2Ftest1new
DELETE test2
The example output with --no-encode option
NEW file1
NEW dir1/file2
MODIFY dir3/dir4/test3
RENAME test1 dir1/test1new
DELETE test2
Glusterfind Post

The following command is run to update the session time:

# glusterfind post [-h] [--debug] <SessionName> <volname>
where,
SessionName: Unique name of a session.
volname: Name of the volume for which the post command is executed.
For example:
# glusterfind post sess_vol1 vol1
Session sess_vol1 with volume vol1 updated
Glusterfind List

To list all the active sessions and the corresponding volumes present in the cluster, execute the following command:

# glusterfind list [-h] [--session SESSION] [--volume VOLUME] [--debug]
where,
--session SESSION: Displays the information related to that session
--volume VOLUME: Displays all the active sessions corresponding to that volume
--help OR -h: Displays help for the command
For example:
# glusterfind list
SESSION VOLUME SESSION TIME
--------------------------------------------------
sess_vol1 vol1 2015-06-22 22:22:53
Glusterfind Query

The glusterfind query subcommand provides a list of changed files based on a specified time stamp. These commands do not check any change log information. Use the glusterfind query subcommand when your backup software maintains its own checkpoints and time stamps outside glusterfind. The glusterfind query subcommand can be used as follows:

# glusterfind query [-h] [--since-time SINCE_TIME] [--end-time END_TIME] [--no-encode] [--full] [--debug] [--disable-partial] [--output-prefix OUTPUT_PREFIX] [-N] [--tag-for-full-find TAG_FOR_FULL_FIND] [--type {f,d,both}] [--field-separator FIELD_SEPARATOR] volname outfile
where,
--help OR -h: Displays help for the command
--since-time SINCE_TIME: Start time stamp expected in seconds, since the Linux epoch date (1970-01-01 00:00:00 UTC). Current Linux epoch time can be determined by executing echo $(date +'%s') command.
--end-time END_TIME: End time stamp expected in seconds, since the Linux epoch date (1970-01-01 00:00:00 UTC). Current Linux epoch time can be determined by executing echo $(date +'%s') command.
--no-encode: The file paths are encoded by default in the output file. This option disables encoding of file paths.
--full: Performs a full search. This cannot be used with --since-time and --end-time.
--debug: Enables the debug mode.
--disable-partial: Disables the partial-find feature that is enabled by default.
--output-prefix OUTPUT_PREFIX: Prefix to the path/name that is specified in the outfile.
-N OR --only-namespace-changes: List only namespace changes
--tag-for-full-find TAG_FOR_FULL_FIND: Tag prefix for file names emitted during a full find operation. Default value is NEW
--type {f,d,both}: type: f, f-files only ; d, d-directories only ; by default = both
--field-separator: Specifies the character/s that glusterfind output uses to separate fields. By default this is a single space, but if your file names contain spaces, you may want to change the delimiter so you can parse the output of glusterfind automatically.
volname: Name of the volume for which the pre command is executed.
outfile: Incremental list of modified files.
For example:
To retrieve files changed between two timestamps, run the following command:
# glusterfind query volname --since-time timestamp1 --end-time timestamp2 output_file.txt
Time stamps are expected in seconds since the Linux epoch date (1970-01-01 00:00:00 UTC). Current Linux epoch time can be output by running echo $(date +'%s') on the command line.
You can retrieve all files in the volume by running the following command:
# glusterfind query volname --full output_file.txt
When running a full find operation, you can also retrieve a subset of files according to a tag. For example, to find all new files on a volume, run the following command:
# glusterfind query volname --full --tag-for-full-find NEW output_file.txt
By default, the output of glusterfind uses a single space to separate fields. If your file names contain spaces, you may want to change the delimiter in order to parse the output of glusterfind automatically. You can set the delimiter to one or more characters by using the --field-separator option. The following command sets the field separator to ==.
# gluster query volname --full output_file.txt --field-separator "=="
Glusterfind Delete

To clear out all the session information associated with that particular session, execute the following command:

Ensure, no further backups are expected to be taken in a particular session.
# glusterfind delete [-h] [--debug] <SessionName> <volname>
where,
SessionName: Unique name of a session.
volname: Name of the volume for which the delete command is executed.
For example:
# glusterfind delete sess_vol1 vol1
Session sess_vol1 with volume vol1 deleted

15.1.1. Adding or Replacing a Brick from an Existing Glusterfind Session

When a new brick is added or an existing brick is replaced, execute the glusterfind create command with force for the existing session to work. For example:
# glusterfind create existing-session volname --force
Red Hat logoGithubRedditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita ilBlog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

© 2024 Red Hat, Inc.