Common GemFire Configuration Changes in Tomcat
Common GemFire Configuration Changes in Tomcat
Using a Different Multicast Port
For a GemFire peer-to-peer member to communicate on a different multicast port than the default (10334), use the mcast-port property in Tomcat's server.xml file.
<Listener className="com.gemstone.gemfire.modules.session.catalina. PeerToPeerCacheLifecycleListener" locators="" mcast-port=10445 />
This example uses port 10445 as the multicast port.
Peer-to-Peer Configuration Using Locators
By default, GemFire peers discover each other using multicast communication on a known port (as specified by the mcast-port system parameter). 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 instead of a multicast port, use the locators property in Tomcat's server.xml file.
<Listener className="com.gemstone.gemfire.modules.session.catalina. PeerToPeerCacheLifecycleListener" mcast-port=0 locators="hostname[10334]" />
This example 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 cache-client.xml file in the Tomcat instance's conf subdirectory:
<pool name="sessions"> <locator host="hostname" port="10334"/> </pool>
This example tells the GemFire client (which is the process running the 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.