export
Export configurations, data, logs and stack-traces.
-
Export a cluster configuration ZIP file that contains the
cache.xml
files,gemfire.properties
files, and application JAR files needed to configure and operate a cluster. -
Export configuration properties for a member or members.
-
Export user data from a region to a file.
-
Export logs to a given directory.
-
Export region data from an offline disk store into gemfire snapshot files.
-
Export the stack trace for a member or members.
export cluster-configuration
Exports a single XML file or a ZIP file with cluster configuration that contains the cache.xml
files, gemfire.properties
files, and application JAR files needed to configure and operate a cluster.
When neither a file name nor a ZIP file name is specified, the cluster configuration is written to standard output.
Availability: Online. You must be connected in gfsh
to a JMX Manager member to use this command.
See Overview of the Cluster Configuration Service.
Syntax:
export cluster-configuration [--group(=value)?] [--xml-file=value]
[--zip-file-name=value]
Export Cluster-Configuration Parameters:
Name | Description | Default Value |
---|---|---|
‑‑group | Export the configuration for the specified server group. When no group is specified, use the default cluster group. |
|
‑‑xml-file | Filename to contain the exported cluster configuration. May also include an absolute or relative path. Only specify one of --xml-file or --zip-file-name . |
|
‑‑zip-file-name | Filename of the ZIP file to contain the exported cluster configuration. May also include an absolute or relative path. Only specify one of --xml-file or --zip-file-name . |
Example Commands:
gfsh>export cluster-configuration --zip-file-name=/group/shared-configs/devClusterConfig.zip
gfsh>export cluster-configuration --zip-file-name=my-configs/myClusterConfig.zip
gfsh>export cluster-configuration --zip-file-name=myClusterConfig.zip
gfsh>export cluster-configuration --xml-file=Cluster3Config.xml
Sample Output:
gfsh>export cluster-configuration --zip-file-name=mySharedConfig.zip
Downloading cluster configuration : /home/username/gemfire/mySharedConfig.zip
export config
Export configuration properties for a member or members.
If you do not specify any parameters, all member configurations will be exported.
Availability: Online. You must be connected in gfsh
to a JMX Manager member to use this command.
Syntax:
export config [--members=value(,value)*] [--groups=value(,value)*]
[--dir=value]
Export Config Parameters:
Name | Description |
---|---|
--members | Name/Id of the member(s) whose configuration will be exported. |
--groups | Group(s) of members whose configuration will be exported. |
--dir | Directory to which the exported configuration files will be written. |
Example Commands:
export config
export config --members=member1
Sample Output:
gfsh>export config --members=member1
Downloading Cache XML file: c:\PivotalGemFire\Latest\.\member1-cache.xml
Downloading properties file: c:\PivotalGemFire\Latest\.\member1-gf.properties
export data
Export user data from a region to a file or files.
Availability: Online. You must be connected in gfsh
to a JMX Manager member to use this command.
Syntax:
To export data from any region, replicated or partitioned, sequentially to a single file, use the --file
option:
export data --region=value --member=value --file=value
In this scenario, data from replicated and partitioned regions is exported sequentially to a single file on the specified member.
In the case of partitioned regions, you can speed up the export process by using the --parallel
option:
export data --parallel --region=value --member=value --dir=value
In this scenario, partitioned region data is exported simultaneously on all hosting nodes to directories local to those respective nodes.
Parallel export applies only to partitioned regions.
The
--file
and--dir
options are mutually exclusive;--file
can be used only for serial export,--dir
can be used for both serial and parallel exports.
Export Data Parameters:
Name | Description |
---|---|
--region | Required. Region from which data is to be exported. |
‑‑member | Required. Name/Id of a member that hosts the region. In a serial export, all data is exported to the specified file on the host where the member is running. In a parallel export, data from a partitioned region partially hosted on this member is exported for each partition to files on the nodes that host those partitions. |
--file | File to which the exported data is to be written. The file must have an extension of .gfd . Cannot be specified at the same time as --dir, cannot be used with ‑‑parallel. |
--dir | Directory to which the exported data is to be written. Required if --parallel is true. Cannot be specified at the same time as --file. |
--parallel | Export local data on each node to a directory on that machine. Available for partitioned regions only. |
Example Commands:
export data --region=region2 --file=region2_20121001.gfd --member=server2
Sample Output:
gfsh>export data --region=region2 --file=region2_20121001.gfd --member=server1
Data succesfully exported from region : region2 to file : C:\PivotalGemFire\
Latest\server1\region2_20121001.gfd on host : 192.0.2.0
export logs
Export logs to a given directory.
All files that have logs in the specified time range will be exported. If no time range is specified, all logs will be exported.
The --dir
parameter specifies a local directory to which log files will be written. This is used only when you are exporting logs using an http connection. If executed over http, the zip archive will be saved in the specified directory on the user’s client machine. If not specified, logs are written to the location specified by the user.dir
system property. When the command is executed over JMX, logs will be saved as exportedLogs_xxx.zip
in the connected locator’s working directory.
Availability: Online. You must be connected in gfsh
to a JMX Manager member to use this command.
Syntax:
export logs [--dir=value] [--groups=value(,value)*] [--members=value(,value)*]
[--log-level=value] [--only-log-level=value] [--merge-log=value]
[--start-time=value] [--end-time=value] [logs-only(=value)?]
[--stats-only(=value)?] [--file-size-limit(=value)?]
Export Logs Parameters:
Name | Description | Default Value |
---|---|---|
--dir | Local directory to which log files will be written when logs are exported using an http connection. Ignored when the command is executed over JMX. | |
--groups | Group(s) of members whose log files will be exported. | |
‑‑members | Name/ID of the member(s) whose log files will be exported. | |
--log-level | Minimum level of log entries to export. Valid values are: OFF , FATAL , ERROR , WARN , INFO , DEBUG , TRACE , and ALL . |
INFO |
--only-log-level | Whether to only include only entries that exactly match the --log-level specified. | false |
‑‑merge‑log | Whether to merge logs after exporting to the target directory (deprecated). | false |
--start-time | Log entries that occurred after this time will be exported. Format: yyyy/MM/dd/HH/mm/ss/SSS/z OR yyyy/MM/dd . When using the yyyy/MM/dd/HH/mm/ss/SSS/z format, the time zone, denoted z , should be specified as either a 3-letter time zone such as PST or as an offset to GMT/UTC such as GMT+08:00 . |
no limit |
--end-time | Log entries that occurred before this time will be exported. Format: yyyy/MM/dd/HH/mm/ss/SSS/z OR yyyy/MM/dd . When using the yyyy/MM/dd/HH/mm/ss/SSS/z format, the time zone, denoted z , should be specified as either a 3-letter time zone such as PST or as an offset to GMT/UTC such as GMT+08:00 . An end time specified by only a date implements a time of 00:00 . This exports logs written up until 23:59:59.999 on the date prior to the one specified. |
no limit |
--logs-only | Whether to export only logs (not statistics) | If parameter not specified: false. If parameter specified without a value: true |
--stats-only | Whether to export only statistics (not logs) | If parameter not specified: false. If parameter specified without a value: true |
--file-size-limit | Limits total unzipped size of the exported files. Specify 0 (zero) for no limit. Value is in megabytes by default or [k,m,g,t] may be specified. | If parameter not specified: 100m. If parameter specified without a value: 0 |
Example commands, showing output:
gfsh>export logs --dir=data/logs
Logs exported to the connected member's file system: /my-locator/data/logs/exportedLogs_1489513007261.zip
gfsh>export logs --start-time=2020/12/14/12/00/00/000/GMT-08:00 --end-time=2020/12/27 --dir=data/logs
Start time parsed as 2020-12-14T12:00 PST
End time parsed as 2020-12-27T00:00 PST
Logs exported to the connected member's file system: /my-locator/data/logs/exportedLogs_1608165308676.zip
gfsh>export logs --dir=data/logs --file-size-limit=1k
Estimated exported logs expanded file size = 95599, file-size-limit = 1024.
To disable exported logs file size check use option "--file-size-limit=0".
gfsh>export logs --dir=data/logs --file-size-limit=99k
Logs exported to the connected member's file system: /my-locator/data/logs/exportedLogs_1489513007261.zip
export offline-disk-store
Export region data from an offline disk store into gemfire snapshot files.
Availability: Online or offline.
Syntax:
export offline-disk-store --name=value --disk-dirs=value(,value)* --dir=value
Export Offline-Disk-Store Parameters:
Name | Description |
---|---|
--name | Required. Name of the disk store to be exported. |
--disk-dirs | Directories which contain the disk store files. |
--dir | Directory to export the snapshot files to. |
Example Commands:
export offline-disk-store --name= DiskStore1 \
--disk-dirs=/home/username/gemfire/mydiskStore1Dir --dir=/home/username/gemfire/export
export stack-traces
Export the stack trace for a member or members.
Availability: Online. You must be connected in gfsh
to a JMX Manager member to use this command.
Syntax:
export stack-traces --file=value [--members=value(,value)*] [--groups=value(,value)*]
Export Stack-Traces Parameters:
Name | Description |
---|---|
--file | Required. Filename to which the stack-traces will be written. |
--members | Name or ID of the member(s) whose log files will be exported. |
--groups | Group(s) of members whose log files will be exported. |
Example Commands:
export stack-traces --file=stack.txt
Sample Output:
gfsh>export stack-traces --file=stack.txt
stack-trace(s) exported to file: C:\PivotalGemFire\Latest\locator1\stack.txt
On host : GemFireStymon