XAP

Configuring the Environment Variables

This topic explains how the GigaSpaces and GigaSpaces environments are configured, and how to customize them to suit your specific application needs.

GigaSpaces

The GigaSpaces environment configuration is maintained by a configuration script file called setenv, located in the GS/bin directory. Each GigaSpaces script invokes this script to load the GigaSpaces configuration. If you are developing a standalone GigaSpaces client, it is recommended to use the setenv utility to derive the commonly used GigaSpaces libraries and setup environment.

To use this utility, you can simply call it from within your script file.

GigaSpaces

The GigaSpaces environment configuration is maintained by a configuration script file called setenv-overrides, located in the /bin directory. Each GigaSpaces script invokes this script to load the GigaSpaces configuration. Additionally, isetenv-overrides starts by invoking the GigaSpaces setenv configuration script, so all of the GigaSpaces environment configuration is also applied.

Customizing the Environment Variables

During the initial development stages, it is usually unnecessary to change any of the default GigaSpaces environment values. However, at some point the environment will need customization to suit your specific requirements (such as the Grid Service Container heap size).

Do not make changes to the original setenv script, as it complicates upgrading GigaSpaces later on. Instead, use the setenv-overrides script, which is automatically called by setenv and is intended for specifying custom overrides in a safe manner.

GigaSpaces Environment Variables

The following list describes GigaSpaces-related environment variables:

Name Description Default Value
JAVA_HOME The directory in which Java is installed.
GS_HOME The GigaSpaces GigaSpaces home directory. Automatically set via the folder structure
GS_LICENSE License key (for Premium and Enterprise editions).
GS_LOOKUP_GROUPS Lookup Service groups used for multicast discovery. xap-17.0
GS_LOOKUP_LOCATORS Lookup Service Locators used for unicast discovery.
GS_NIC_ADDRESS The network interface card that will be used by GigaSpaces. Automatically set to the host name
GS_SECURITY_POLICY The default policy file. GS_HOME/policy/policy.all
GS_LOGS_CONFIG_FILE The location of the GigaSpaces logging configuration. GS_HOME/config/log/xap_logging.properties
GS_MANAGER_SERVERS Set the list of Manager servers that other machines can connect to.
GS_PUBLIC_HOST Define the public IP address for the Docker host machine.
GS_MANAGER_OPTIONS Java options for the GigaSpaces Manager.
GS_GSCClosed Grid Service Container. This provides an isolated runtime for one (or more) processing unit (PU) instance and exposes its state to the GSM._OPTIONS Java options for the Grid Service Container (GSC).
GS_GSMClosed Grid Service Manager. This is is a service grid component that manages a set of Grid Service Containers (GSCs). A GSM has an API for deploying/undeploying Processing Units. When a GSM is instructed to deploy a Processing Unit, it finds an appropriate, available GSC and tells that GSC to run an instance of that Processing Unit. It then continuously monitors that Processing Unit instance to verify that it is alive, and that the SLA is not breached._OPTIONS Java options for the Grid Service Manager (GSM).  
GS_GSAClosed Grid Service Agent. This is a process manager that can spawn and manage Service Grid processes (Operating System level processes) such as The Grid Service Manager, The Grid Service Container, and The Lookup Service. Typically, the GSA is started with the hosting machine's startup. Using the agent, you can bootstrap the entire cluster very easily, and start and stop additional GSCs, GSMs and lookup services at will._OPTIONS Java options for the Grid Service Agent (GSA)
GS_LUSClosed Lookup Service. This service provides a mechanism for services to discover each other. Each service can query the lookup service for other services, and register itself in the lookup service so other services may find it._OPTIONS Java options for the Lookup Service (LUS).  
GS_GUI_OPTIONS Java options for the GigaSpaces Management Center.
GS_WEBUI_OPTIONS Java options for the Web Management Console.
GS_OPTIONS_EXT

Append these options to the default GigaSpaces GigaSpaces options.

 

 
GS_OPTIONS

Override the default GigaSpaces GigaSpaces options.

For use by GigaSpaces engineers. To add options, use GS_OPTIONS_EXT.
 
GS_LIBRARY_PATH_EXT Override the default GigaSpaces library path and set java.library.path to this path.  
GS_LIBRARY_PATH Append the path to the default GigaSpaces library path and set java.library.path to the result.  

  When running in ./gs-agent --manager configuration, this environment variable is ignored.

In addition, you can also use standard Spark environment variables. The GigaSpaces Platform loads Spark components in a manner that preserves their usage. For example, set SPARK_MASTER_PORT to override the default 7077 port.