Overview
This section explains the main concepts and elements of the GigaSpaces system environment, including space, container, server startup scripts, properties and environment variables, and how to use them to set up the environment.
Deployment Architecture
The core element in the GigaSpaces architecture is the JavaSpaces space (the word cache is used to describe a space configured to act as a cache instance).
A space/cache always runs in a space container, a logical unit of the GigaSpaces server. The space container is encased in a service container: this enables dynamic deployment of spaces, and allows applications to access a space as a service (for more about the grid service container, see Service Grid).
Two or more spaces can form a cluster. The cluster comprises multiple spaces running in one or more containers. Two common clustering topologies are replicated and partitioned (see Space Cluster Topologies).
Remote vs. Embedded Space
Applications can access the space as a remote server. Direct communication with the space is facilitated by the RMI protocol or an NIO-based protocol; the space is discovered using the Jini Lookup Service. Alternatively, the space can be deployed as a service using the Service Grid.
The space can also run within the application's JVM. This type of space is called an embedded space.
Running the Remote Space
There are two ways to run a space server:
Expand this...
- Light version of server (<GigaSpaces Root>\bin\gsInstance.bat or .sh) – a script that launches a space container and one space, as a pure Java server with no additional services.
- Full version of server (<GigaSpaces Root>\bin\gsServer.bat or .sh) – a script that launches a space a Jini service within a standard service container. Launches a container, a space, an HTTP Daemon for codebase downloads, the Jini Lookup Service, the Jini Distributed Transaction Manager Service, and the JavaSpaces Service and RMI Registry.
 | These scripts use the SpaceFinder or CacheFinder class to create a new instance. The same classes are used by applications to connect to an existing space. |
Key Environment Elements
The following elements participate in the GigaSpaces runtime environment:
- Configuration schemas (<GigaSpaces Root>\config\schemas*-schema.xml or .xsl) – XML configuration files used as templates for the configuration of a space, container, or cluster.
- Space configuration schemas define the space instance configuration, including serialization mode, protocol, persistency model, and memory management.
- Container configuration schemas manage the lifecycle of the space and the lookup directory.
- Cluster configuration schemas define the space cluster topology. The topology is defined using three policies: replication, load balancing and failover.
- Default properties (com.gs.*) – variables used in the configuration schemas. The default properties hold the default values, which are not user-editable. These can be overwritten by user-defined values.
Expand this...
- Custom properties files (<GigaSpaces Root>\config*.properties) – a custom properties file sets custom values for some or all of the default properties; the values in the custom property file override the default values. The custom values only take effect when the custom properties file is loaded explicitly.
 | You define whether to load a properties file and call system properties in the server startup scripts gsInstance and gsServer, by adding ?parameters=parameterFileName to the space URL. |
- System properties in the Java command (-Dcom.gs.*) – properties can be set as system properties, using the -D switch of the Java command in gsInstance and gsServer. Values of system properties override the default properties, and those in the custom properties file, if used.
- Environment variables (<GigaSpaces Root]\bin\setenv.bat or .sh) – environment variables used by GigaSpaces are set automatically by setenv.bat (this file is invoked by the server startup scripts). Among the variables are JAR locations, system properties for RMI, verbose levels, Cygwin support, and support for command line options provided by different JVM vendors.
 | The JAVA_HOME variable is usually set manually. Be sure to define this as an operating system variable, and set its value to the root directory of the JDK. If you do not define it, GigaSpaces searches for the JDK using the system PATH variable. |
- Service Grid Deployment Descriptors (SDDs) – define the prerequisites for running a service, the implementation details, scaling policy, failover detection, how many instances need to be deployed per machine, and how many instances in total. GigaSpaces provides default deployment descriptors for common cluster topologies
(for more details, see Service Deployment Descriptor).
How Properties Affect Configuration
In GigaSpaces, properties are used to populate values of configuration parameters in schema files. In the schema files, each configuration parameter may either have an absolute value, or may be populated from a property.
Expand this...
Properties in configuration schemas can be populated from three sources: the default properties (hard-coded), a custom property file (user-defined, can loaded by server startup scripts), and system properties (called in the Java command of the server startup scripts).
- If a custom property file is not loaded, and no system properties are called, the default values are used for all properties in the schema files.
- If a custom property file is loaded, and no system properties are called, then the values provided in the custom property file override the default values, and properties that were not set in the custom property file still get the default values.
- If a custom property file is loaded, and system properties are called, then:
- The values set in the system properties override the values in the custom property file.
- If there are properties that were not set as a system property, but were set in the property file, the property file values are used.
- Properties that were set neither as a system property nor in the custom property file get the default values.
- If only system properties are called (and a property file was not loaded), then:
|
Section Contents
- Common Environment Variables — Descriptions of the main environment variables set automatically by setenv.bat.
- Configuration Files Element List — A list and description of Service Grid Deployment Descriptor, space schema, space container, cluster schema, JMS clustered space, JMS client schema configuration file, local cache, and space POJO class mapping schema elements.
- Debugging GigaSpaces Using Eclipse — How to create a new Java project for GigaSpaces in Eclipse, and debug it.
- GigaSpaces Logging — GigaSpaces logging system.
- GigaSpaces Port Usage — Default ports used by the space, container, and Jini Lookup Service, and how to configure them.
- Installing GigaSpaces — Requirements and how to install GigaSpaces with Windows, Linux or Unix.
- Java SecurityPolicy File — Setting the java.security.policy property.
- License Key — Getting a license key and defining it in the space schema.
- Lookup Service Configuration — Defining group names for Jini Services; searching for available lookup services in the network.
- Multicast Configuration — Enabling multicast on Linux and windows.
- Multi-NIC Configuration — Configuring GigaSpaces for a machine with multiple network cards. By default all network cards are used; you can limit GigaSpaces to specific ones.
- Network Detection Failure — The Network Detection Failure facility provides robust and optimize mechanism to identify network Failures.
- Performance Tuning — Helpful recommendations for tuning GigaSpaces, boosting its performance, and improving its scalability.
- Properties List — GigaSpaces properties list, as defined in the com.j_spaces.kernel.SystemProperties class.
- Setting Classpath — JARs that should be in the classpath of applications accessing a remote or embedded space.
- Setting JVM Location — Setting the JAVAHOME parameter to tell GigaSpaces where the JDK is installed.
- Space JMX Management — Controlling space attributes and operations using the JMX console.
- Space URL — An address, passed to SpaceFinder and CacheFinder, used to connect to a space and remotely create new spaces.
- Tested JVMs and Platforms — JVM vendors GigaSpaces has been tested with: Windows, Linux, and Solaris.
- Testing System Environment — Verifying a local installation, a remote installation, and the cluster configuration.
- Understanding Space Configuration Schema — What is a schema; space schema basics; overwriting default configuration; custom schemas.
- Custom Schemas — How to create a custom configuration schema, manually and using the GigaSpaces Browser.
- Overwriting Schema Settings in Runtime — Overwriting schema values using system properties and attributes in the space URL.
- Schema Basics — The space schema is defined through the schema attribute in the SpaceFinder URL.
- What is a Schema? — Uses of configuration schemas; physical location of schemas; schema naming conventions.
|
Add Comment