LATEST VERSION: 8.2.6 - CHANGELOG
Pivotal GemFire® v8.2

Changing the Default GemFire Configuration in the tc Server Module

Changing the Default GemFire Configuration in the tc Server Module

By default, the tc Server HTTP module will run GemFire automatically with pre-configured settings. You can change these GemFire settings.

Here are the default GemFire settings:
  • GemFire peer-to-peer members are discovered using a default multicast channel.
  • GemFire locators are not used for member discovery.
  • The region name is set to GemFire_modules_sessions.
  • The cache region is replicated for peer-to-peer configurations and partitioned (with redundancy turned on) for client/server configurations.
  • GemFire clients have local caching turned on and when the local cache needs to evict data, it will evict least-recently-used (LRU) data first.
Note: On the application server side, the default inactive interval for session expiration is set to 30 minutes. To change this value, refer to Session Expiration.

However, you may want to change this default configuration. For example, you might want to change the region from replicated to partitioned, or to use locators for discovery. To change GemFire settings, use the --interactive command line argument when creating your tc Server instance.

In Unix:
  prompt$ ./tcruntime-instance.sh create my_instance_name --template gemfire-p2p
        --interactive
  prompt$ ./tcruntime-instance.sh create my_instance_name --template gemfire-cs
         --interactive

In Windows:
  prompt> tcruntime-instance.bat create my_instance_name --template gemfire-p2p 
         --interactive
  prompt> tcruntime-instance.bat create my_instance_name --template gemfire-cs 
         --interactive

In interactive mode, you will be prompted to specify a series of property values. Hit <return> for any property where you would like to use the default value.

  Creating instance 'my_instance_name' ...
  Using separate layout
  Please enter a value for 'gemfire.maximum.vm.heap.size.mb'. Default '512':
  Please enter a value for 'gemfire.initial.vm.heap.size.mb'. Default '512':
  ...
  ...

After responding to approximately 20 prompts, you should see the following line:

Instance created.
Note: You cannot override region attributes on the cache server when using the HTTP Session Management Module. You must place all region attribute definitions in the region attributes template that you customize in tc Server. See Overriding Region Attributes for more information.

For information on setting up your instance for the most common types of configurations, refer to the sections below. For more information about each interactive prompt, refer to Interactive Mode Reference.

Using a Different Multicast Port

For a GemFire peer-to-peer member to communicate on a different multicast port than the default (10334), answer the following question in the tc Server HTTP module's interactive mode:

  Please enter the port used by GemFire members to discover each other using 
  multicast networking. Default '10334': 10335

This example changes the multicast port to 10335.

You typically should change the multicast port so that you don't inadvertently join another GemFire cluster on the same network.

Overriding Region Attributes

When using the HTTP Session Management Module, you cannot override region attributes directly on the cache server. You must place all region attribute definitions in the region attributes template that you customize within tc Server. For example, to specify a different name for the region's disk store, you could add the new disk-store-name specification to the region attributes template and then reference the template on the cache server.
<region-attributes id="MY_SESSIONS" refid="PARTITION_REDUNDANT_PERSISTENT_OVERFLOW" 
disk-store-name="mystore">
  ...
</region-attributes>
Then on the cache server side, reference the modified region attributes template to allow the region to use the disk-store-name attribute:
<region name="gemfire_modules_sessions" refid="MY_SESSIONS"/>

Peer-to-peer Configuration Using Locators

By default, GemFire peers discover each other using multicast communication on a known port. Alternatively, you can configure member discovery using one or more dedicated locators. A locator provides both discovery and load balancing services.



To run GemFire with one or more locators, turn off multicast discovery (by setting it to 0) and specify the list of locators.

  Please enter the port used by GemFire members to discover each other using 
  multicast networking. Default '10334': 0
  
  Please enter the list of locators used by GemFire members to discover each other. 
  The format is a comma-separated list of host[port]. Default ' ': hostname[10334]

This example turns off multicast discovery and uses a locator at hostname on port 10334.

You must be sure when you specify a locator that you specifically launch a locator correctly at this location. You can do this using the gemfire command-line tool found in the bin subdirectory of the HTTP module distribution.

In Unix:
  ./gemfire.sh start-locator -port=10334
  
In Windows:
  gemfire.bat start-locator -port=10334

This example starts a locator that listens on port 10334.

Client/Server Configuration Using Locators

By default, GemFire clients and servers discover each other on a pre-defined port on the localhost. This is not typically the way you would deploy a client/server configuration. A preferred solution is to use one or more dedicated locators. A locator provides both discovery and load balancing services.



To run GemFire with one or more locators instead of a multicast port, add locator information to the GemFire cache-client.xml file in the conf subdirectory of the applicable tc Server instance.

  <pool name="sessions">
    <locator host="hostname" port="10334"/>
  </pool>

This example tells the GemFire client (which is the process running the tc Server application server) to use a locator at hostname on port 10334.

You must now launch a locator correctly at this location. You can do this using the gemfire command-line tool found in the bin subdirectory of the HTTP module distribution.

./gemfire start-locator -port=10334

This example starts a locator that listens on port 10334.

You also need to tell the GemFire server to use a locator when you launch the server. You can do this through a command-line argument when you start up the server with the script provided in the bin subdirectory wherever you installed the GemFire HTTP module:

In Unix: 
  prompt$ ./cacheserver.sh start locators=hostname[port]
  
In Windows:
  prompt> cacheserver.bat start locators=hostname[port]

If you are running more than one locator, use a comma-separated list of locators.