Using Bind Addresses

Host machines transmit data to the network and receive data from the network through one or more network cards, also referred to as network interface cards (NIC) or LAN cards. A host with more than one card is referred to as a multi-homed host. On multi-homed hosts, one network card is used by default. You can configure your GemFire members to use non-default network cards on a multi-homed host.

Use bind address configuration to send network traffic through non-default network cards and to distribute the load of network traffic for GemFire across multiple cards. If no bind address setting is found, GemFire uses the host machine's default address.

Note: When you specify a non-default card address for a process, all processes that connect to it need to use the same address in their connection settings. For example, if you use bind addresses for your server locators, you must use the same addresses to configure the server pools in your clients.
Note: Use IPv4 or IPv6 numeric address specifications for your bind address settings. For information on these specifications, see Choosing Between IPv4 and IPv6. Do not use host names for your address specifications. Host names resolve to default machine addresses.

Peer, Server, and Gateway Hub Communication

You can configure peer, server, and gateway hub communication so two or more types use the same address or so each communication type uses its own address. If no setting is found for a specific communication type, GemFire uses the host machine's default address.

Note: Bind addresses set through the APIs, like CacheServer and DistributedSystem, take precedence over the settings discussed here. If your settings are not working, check to make sure there are no bind address settings being done through API calls.

This table lists the settings used for peer, server, and gateway hub and communication, ordered by precedence. For example, for gateway hub communication, GemFire searches first for a cache.xml <gateway-hub> bind-address setting. If that is not set, GemFire searches for the cacheserver server-bind-address setting, and so on until a setting is found or all possibilities are exhausted.

Property Setting Ordered by Precedence Peer Server Gateway Hub Syntax
cache.xml <gateway-hub> bind-address X <gateway-hub>bind-address=address
cache.xml <cache-server> bind-address X <cache-server>bind-address=address
cacheserver command-line server-bind-address X X cacheserver start server-bind-address=address
cacheserver command-line bind-address X X X cacheserver start bind-address=address
gemfire.properties server-bind-address X X server-bind-address=address
gemfire.properties bind-address X X X bind-address=address

For example, a member started with these configurations in its gemfire.properties and cache.xml files will use three separate addresses for peer, server, and gateway hub communication:
// gemfire.properties setting for peer communication
bind-address=194.124.0.104
//cache.xml settings 
<cache>
// Gateway Hub communication
  <gateway-hub id="EU" bind-address="194.124.0.105" ...

// Server communication
  <cache-server bind-address="194.124.0.106" ...

  <region ...

Locator Communication

Set the locator bind address using one of these methods:
  • On the command line, specify the bind address when you start the locator, the same as you specify any other address:
    gemfire start-locator -address=bind-address-setting -port=portNumber
  • Inside a GemFire application, take one of the following actions:
    • Automatically start a colocated locator using the gemfire property start-locator, and specifying the bind address for it in that property setting.
    • Start the locator in your code using the Locator class in com.gemstone.gemfire.distributed. Use a method that accepts a bindAddress argument.

If your locator uses a bind address, make sure every process that accesses the locator has the address as well. For peer-to-peer access to the locator, use the locator's bind address and the locator's port in your gemfire.properties locators list. For server discovery in a client/server installation, use the locator's bind address and the locator's port in the locator list you provide to in the client’s server pool configuration.