System Level Configuration
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:
- Programmatic configuration
- Properties set at the command line
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
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
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
You can pass in specific properties programmatically by using a
Properties object to define the non-default properties.
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();
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
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.
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.
geode.properties file is included with the Apache Geode native client installation in the
To use this file:
- Copy the file to the directory where you start the application.
Uncomment the lines you need and edit the settings as shown in this example:
Start the application.
Default geode.properties File
# Default C++ distributed system properties # Copy to current directory and uncomment to override defaults. # ## Debugging support, enables stacktraces in apache::geode::client::Exception. # # The default is false, uncomment to enable 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.
- Place the
geode.propertiesfile for the application in the working directory or in
- Place the
cache.xmlfile for the application in the desired location and specify its path using the
cache-xml-fileproperty in the
- Add other attributes to the
geode.propertiesfile 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.