使用绑定地址

您使用绑定地址配置通过非默认网卡发送网络流量,并在多个卡上分配Geode的网络流量负载。 如果未找到绑定地址设置,Geode将使用主机的默认地址。

主机需要通过一个或多个网卡(也称为网络接口卡(NIC)或LAN卡),将数据传输到网络并且从网络接收数据。 具有多个卡的主机称为多宿主(multi-homed)主机。 在多宿主主机上,默认使用一个网卡。 您可以使用绑定地址将Geode成员配置为使用多宿主主机上非默认网卡。

注意: 为进程指定非默认卡地址时,连接到该网卡的所有进程都需要在其连接设置中使用相同的地址。 例如,如果对服务器和Locator使用绑定地址,则必须使用相同的地址来配置客户端中的服务器连接池。

使用IPv4或IPv6数字地址规范进行绑定地址设置。 有关这些规范的信息,请参阅在IPv4和IPv6之间选择。 不要使用主机名作为地址规范。 主机名解析为默认主机地址。

对等和服务器通信

您可以配置对等和服务器通信,以便每种通信类型使用自己的地址或使用相同的地址的类型。 如果未找到特定通信类型的设置,Geode将使用主机的默认地址。

注意: 通过API设置的绑定地址(例如CacheServerDistributedSystem)优先于此处讨论的设置。 如果您的设置不起作用,请检查以确保没有通过API调用完成绑定地址设置。

此表列出了用于对等和服务器通信的设置,按优先级排序。 例如,对于服务器通信,Geode首先搜索cache-server绑定地址,然后搜索gfsh start server``server-bind-address设置,依此类推,直到找到设置或所有可能性都用完为止。

按优先顺序排序的属性设置 对等 服务器 Gateway Receiver 语法
cache.xml \ bind-address X \bind-address=address
gfsh start server command-line --server-bind-address X X gfsh start server --server-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 two separate addresses for peer and server communication:

// gemfire.properties setting for peer communication
bind-address=192.0.2.0
//cache.xml settings
<cache>

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

  <region ...

Gateway Receiver Communication

If you are using multi-site (WAN) topology, you can also configure gateway receiver communication (in addition to peer and server communication) so that each communication type uses its own address.

This table lists the settings used for peer, server, and gateway receiver communication, ordered by precedence. For example, for gateway receiver communication, Geode searches first for a cache.xml <gateway-receiver> bind-address setting. If that is not set, Geode searches for the gfsh start server 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 Receiver Syntax
cache.xml \ bind-address X \bind-address=address
cache.xml \ bind-address X \bind-address=address
gfsh start server command-line --server-bind-address X X gfsh start server --server-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 receiver communication:

// gemfire.properties setting for peer communication
bind-address=192.0.2.0
//cache.xml settings
<cache>
// Gateway receiver configuration
  <gateway-receiver start-port="1530" end-port="1551" bind-address="192.0.2.2"/>

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

  <region ...

Locator Communication

Set the locator bind address using one of these methods:

  • On the gfsh command line, specify the bind address when you start the locator, the same as you specify any other address:

    gfsh>start locator --name=my_locator --bind-address=ip-address-to-bind --port=portNumber
    
  • Inside a Geode application, take one of the following actions:

    • Automatically start a co-located locator using the gemfire property start-locator, and specifying the bind address for it in that property setting.
    • Use org.apache.geode.distributed.LocatorLauncher API to start the locator inside your code. Use the LocatorLauncher.Builder class to construct an instance of the LocatorLauncher, use the setBindAddress method to specify the IP address to use and then use the start() method to start a Locator service embedded in your Java application process.

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.

results matching ""

    No results matching ""