You can specify attributes in different ways, which can cause conflicting definitions. Applications can be configured programmatically, and that has priority over other settings.
In case an attribute is defined in more than one place, the first source in this list is used:
current-working-directory/geode.properties
filenative-client-installation-directory/defaultSystem/geode.properties
fileThe geode.properties
files and programmatic configuration are optional. If they are not present, no warnings or errors occur. For details on programmatic configuration through the Properties
object, see Defining Properties Programmatically.
The client and cache server processes first look for their properties file in the native-client-installation-directory/defaultSystem
directory, then in the working directory.
Any properties set in the working directory override settings in the native-client-installation-directory/defaultSystem/geode.properties
file.
The geode.properties
file provides information to the client regarding the expected server configuration. Properties set in this file (in the client environment) do not have any effect on the server itself. Its main purpose is to inform the client application as to how to communicate with the server.
You can pass in specific properties programmatically by using a Properties
object to define the non-default properties.
Example:
auto systemProps = Properties::create();
systemProps->insert("statistic-archive-file", "stats.gfs");
systemProps->insert("cache-xml-file", "./myapp-cache.xml");
systemProps->insert("stacktrace-enabled", "true");
auto cache = CacheFactory(systemProps).create();
The geode.properties
file provides local settings required to connect a client to a distributed system, along with settings for licensing, logging, and statistics. See System Properties.
A client looks for a geode.properties
file first in the working directory where the process runs, then in native-client-installation-directory/defaultSystem
. Use the defaultSystem
directory to group configuration files or to share them among processes for more convenient administration. If geode.properties
is not found, the process starts up with the default settings.
For the cache.xml
cache configuration file, a client looks for the path specified by the cache-xml-file
attribute in geode.properties
(see System Properties). If the cache.xml
is not found, the process starts with an unconfigured cache.
A sample geode.properties
file is included with the VMware GemFire native client installation in the native-client-installation-directory/defaultSystem
directory.
To use this file:
Uncomment the lines you need and edit the settings as shown in this example:
cache-xml-file=test.xml
Start the application.
Default geode.properties File
# Default C++ distributed system properties
# Copy to current directory and uncomment to override defaults.
#
## Debugging support, activates stacktraces in apache::geode::client::Exception.
#
# The default is false, uncomment to activate stacktraces in exceptions.
#stacktrace-enabled=true
#crash-dump-enabled=true
#
#
## Cache region configuration
#
#cache-xml-file=cache.xml
#
## Log file config
#
#log-file=gemfire_cpp.log
#log-level=config
# zero indicates use no limit.
#log-file-size-limit=0
# zero indicates use no limit.
#log-disk-space-limit=0
...
The typical configuration procedure for a client includes the high-level steps listed below.
geode.properties
file for the application in the working directory or in native-client-installation-directory/defaultSystem
.cache.xml
file for the application in the desired location and specify its path using the cache-xml-file
property in the geode.properties
file.geode.properties
file as needed for the local system architecture.If you start a client without any configuration, it uses any attributes set programmatically plus any hard-coded defaults (listed in System Properties). Running with the defaults is a convenient way to learn the operation of the distributed system and to test which attributes need to be reconfigured for your environment.
Running based on defaults is not recommended for production systems, as important components, such as security, might be overlooked.