vFabric GemFire Command-Line Utility

The vFabric GemFire command-line utility allows you to perform basic administration tasks from a command-line script. Use it to manage GemFire locators, view product version and licensing information, merge log files, and print information from statistic files.

Usage

At an operating system prompt, enter this command line:

gemfire [-debug] [-h[elp]] [-q] [-J<vmOpt>]* command|help ...
Note: On Windows, you can display a command-line prompt from the Start menu by pointing to Programs, pointing to Accessories, then clicking Command Prompt.
Option Description
-debug Causes gemfire to log extra information when it fails.
-h or -help Prints general help information or help for a specific command. To display help information about the gemfire config command, type in: gemfire -h config
-q Provides quiet operation by suppressing extra messages.
-J<vmOpt> JVM option for the command.
command Specifies the operation to perform.

gemfire Command Options

The gemfire command requires one of the command strings listed in the table below. In the command descriptions, the following syntax is used:
  • courier designates literal text.
  • [ ] designates an optional item.
  • ( ) groups items.
  • the * suffix means zero or more of the previous item.
  • < > indicates a placeholder where an appropriate value should be supplied.
  • | indicates one of several mutually exclusive options.
gemfire Command and Syntax Description
backup <target directory>

Connects to a running system and asks all its members that have persistent data to back it up to the specified directory. The directory specified must exist on all members, but it can be a local directory on each machine. See Back Up and Restore a Disk Store.

When running this command, specify the gemfire.properties file to use when connecting to the distributed system. For example:
gemfire -J-DgemfirePropertyFile=mygemfire.properties 
backup mydir
compact-all-disk-stores Connects to a running system and tells its members to compact all disk stores where allow-force-compaction is set to true. See Design and Configure Disk Stores for details on setting the allow-force-compaction attribute. This command uses the compaction threshold that each member has configured for its disk stores. See Running Compaction on Disk Store Log Files for more information.
When running this command, specify the gemfire.properties file to use when connecting to the distributed system. For example:
gemfire -J-DgemfirePropertyFile=mygemfire.properties 
compact-all-disk-stores
compact-disk-store <diskStoreName> <directory>+ [-maxOplogSize=<long>]

Compacts an offline disk store. Compaction removes all unneeded records from the persistent files.

Provide the disk store name and all of its directories to this command.

-maxOplogSize=<long> causes the oplogs created by compaction to be no larger than the specified size in megabytes.

See Running Compaction on Disk Store Log Files.

encrypt-password passwordString Encrypts the password provided and prints the encrypted password to standard output. This encrypted password is used in data source connections for transactions.
help [all | overview | commands | options | usage | configuration] Prints information on how to use this tool. If you specify an optional help topic, then more detailed help is printed.
info-locator [-dir=locatorDir] Prints information on a locator, including the locator’s process ID. The -dir option specifies the locator's directory.
list-missing-disk-stores Lists all disk stores with most recent data that are being waited on by other members.
merge-logs logFile* [-out=outFile] Merges the specified logs into a single log. The -out option specifies the output file for the merged log. By default, the merged file is sent to standard output.
modify-disk-store <diskStoreName> <directory>+ [-region=<regionName> [-remove | (-lru= <none | lru-entry-count | lru-heap-percentage | lru-memory-size> | -lruAction=<none | overflow-to-disk | local-destroy> | -lruLimit=<int> | -concurrencyLevel=<int> | -initialCapacity=<int> | -loadFactor=<float> | -statisticsEnabled=<boolean>)*]] <diskStoreName> <directory>+ [-maxOplogSize=<int>]

Modifies an offline disk store. Use this to remove a region from a disk store or to modify its load and memory control attributes.

Provide the disk store name and all its directories.

Provide the region name that you want to change. Then specify either -remove to take the region out of the disk store, or one or more of the region attribute switches to change attribute settings.

revoke-missing-disk-store <address> <directory>
Connects to a running system and tells its members to stop waiting for the specified disk store to be available. Only revoke a disk store if its files are lost.
Note: Once a disk store is revoked its files can no longer be loaded, so be careful.

The gemfire list-missing-disk-stores command gives you the address and directory of the missing disk store to pass to this revoke command. If the disk store was spread across multiple directories, just specify the first directory in the list.

When running this command, specify the gemfire.properties and/or gfsecurity.properties file to use when connecting to the distributed system. For example:
gemfire -J-DgemfirePropertyFile=mygemfire.properties 
-J-DgemfireSecurityPropertyFile=mygfsecurity.properties
revoke-missing-disk-store /store/directory1 mydir
shut-down-all Connects to a running system and tells members that are hosting a cache to shut down in an orderly fashion. Persistent partitioned regions bring themselves in sync before shutting down, which speeds startup the next time.
When running this command, specify the gemfire.properties and/or gfsecurity.properties file to use when connecting to the distributed system. For example:
gemfire -J-DgemfirePropertyFile=mygemfire.properties 
-J-DgemfireSecurityPropertyFile=mygfsecurity.properties
shut-down-all

This command does not shut down locators.

start-locator [-port=port] [-address=ipAddr] [-dir=locatorDir] [-peer=<true|false>] [-server=<true|false>] [-hostname-for-clients=<ipAddr>] [-properties=gemfire.properties.file] [-DsystemPropertyName=value]* [-Xoption=value]* Starts a locator.
  • -port specifies the port on which the locator listens (by default, 10334 ). Valid values are in the range 0..65535.
  • -address specifies the IP address on which the locator listens. By default, the locator listens on the default card for the machine.
  • -dir specifies the directory in which the locator runs.
  • -peer indicates whether the locator acts as a peer locator service for members of its own distributed system. The default is true.
  • -server indicates whether the locator acts as a server locator service for clients to its distributed system. The default is true.
  • -hostname-for-clients specifies a host name or IP address that is sent to clients for connecting to the locator. The default is the address on which the locator is listening.
  • -properties specifies the gemfire.properties file to use for configuring the locator's distributed system. The file's path should be absolute, or relative to the locator's directory, specified in the -dir option.
  • -D allows you to provide the locator with a Java system property from the command line. Any number of system properties may be specified.
  • -X allows you to set a vendor-specific JVM option. It is generally used to increase the size of the locator process when using multicast. Any number of vendor-specific options can be specified.
stats ([instanceId][:typeId][.statId])* -archive=statFile [-details] [-nofilter|-persec|-persample] [-prunezeros] [-starttime=time] [-endtime=time] Prints statistic values from a statistic archive. By default all statistics are printed.
  • statSpec arguments can be used to print individual resources or a specific statistic. The format of a statSpec is (in order): an optional combine operator, an optional instanceId, an optional typeId, an optional statId. The combine operator can be a plus (+) to combine all matches in the same file or double plus (++) to combine all matches across all files. The instanceId must be the name or id of a resource. The typeId is a colon (:) followed by the name of a resource type. The statId is a period (.) followed by the name of a statistic. A typeId or instanceId with no statId prints out all the matching resources and all their statistics. A typeId or instanceId with a statId prints out just the named statistic on the matching resources. A statId with no typeId or instanceId matches all statistics with that name.
  • The -archive option specifies the archive file to use.
  • The -details option causes statistic descriptions to also be printed.
  • The -nofilter option, in conjunction with -archive, causes all printed statistics to be raw, unfiltered, values. The -persec option, in conjunction with -archive, causes the printed statistics to be the rate of change, per second, of the raw values. The -persample option, in conjunction with -archive, causes the printed statistics to be the rate of change, per sample, of the raw values.
  • The -prunezeros option, in conjunction with -archive, suppresses the printing of statistics whose values are all zero.
  • The -starttime option, in conjunction with -archive, causes statistics samples taken before the specified time to be ignored. The argument format must match this string: yyyy/MM/dd HH:mm:ss.SSS z where z is the time zone.
  • The -endtime option, in conjunction with -archive , causes statistics samples taken after the specified time to be ignored. The argument format must match this string: yyyy/MM/dd HH:mm:ss.SSS z
See Statistics for more information.
status-locator [-dir=locatorDir] Prints the status of a locator. The status string is one of the following: stopped, stopping, killed, starting, running. The -dir option specifies the locator's directory, which defaults to the current working directory.
stop-locator [-port=port] [-address=ipAddr] [-dir=locatorDir] Stops a locator.
  • -port specifies the port that the locator is listening on.
  • -addr specifies the IP address on which the locator is listening. By default, the locator listens on the default card for the machine.
  • -dir specifies the locator's directory.
tail-locator-log [-dir=locatorDir] Prints the tail end of the locator’s log. The -dir option specifies the locator's directory.
validate-disk-store <diskStoreName> <directory>+

Checks to make sure files of an offline disk store are valid. The name of the disk store and the directories its files are stored in are required arguments. See Validating a Disk Store.

version Prints GemFire product version information.