Apache Geode
CHANGELOG
Setting Properties
Geode provides a default configuration for out-of-the-box systems. To use non-default configurations and to fine-tune your member communication, you can use a mix of various options to customize your configuration.
Geode properties are used to join a cluster and configure system member behavior. Configure your Geode properties through the gemfire.properties file, the Java API, or command-line input. Generally, you store all your properties in the gemfire.properties file, but you may need to provide properties through other means, for example, to pass in security properties for a username and password that you have received from keyboard input.
Note:
Check with your Geode system administrator before changing properties through the API, including the gemfire.properties and gfsecurity.properties settings. The system administrator may need to set properties at the command line or in configuration files. Any change made through the API overrides those other settings.
Note:
The product defaultConfigs directory has a sample gemfire.properties file with all default settings.
Set properties by any combination of the following. The system looks for the settings in the order listed:
java.lang.Systemproperty setting. Usually set at the command line. For applications, set these in your code or at the command line.Naming: Specify these properties in the format
gemfire.property-name, whereproperty-namematches the name in thegemfire.propertiesfile. To set the gemfire property file name, usegemfirePropertyFileby itselfIn the API, set the
Systemproperties before the cache creation call. Example:System.setProperty("gemfirePropertyFile", "gfTest"); System.setProperty("gemfire.mcast-port", "10999"); Cache cache = new CacheFactory().create();At the
javacommand line, pass inSystemproperties using the-Dswitch. Example:java -DgemfirePropertyFile=gfTest -Dgemfire.mcast-port=10999 test.Program
Entry in a
Propertiesobject.Naming: Specify these properties using the names in the
gemfire.propertiesfile. To set the gemfire property file name, usegemfirePropertyFile.In the API, create a
Propertiesobject and pass it to the cache create method. Example:Properties properties= new Properties(); properties.setProperty("log-level", "warning"); properties.setProperty("name", "testMember2"); ClientCache userCache = new ClientCacheFactory(properties).create();For the cache server, pass the properties files on the
gfshcommand line as command-line options. Example:gfsh>start server --name=server_name --mcast-port=10338 --properties-file=serverConfig/gemfire.properties --security-properties-file=gfsecurity.propertiesSee Running Geode Server Processes for more information on running cache servers.
Entry in a
gemfire.propertiesfile. See Deploying Configuration Files without the Cluster Configuration Service. Example:cache-xml-file=cache.xml conserve-sockets=true disable-tcp=falseDefault value. The default values are defined within the API for
org.apache.geode.distributed.ConfigurationProperties.