Network Configuration

Facilitates communication between nodes within the cluster.

CommunicationSpi provides basic plumbing to send and receive grid messages and is utilized for all distributed grid operations, such as task execution, monitoring data exchange, distributed event querying and others. Ignite provides TcpCommunicationSpi as the default implementation of CommunicationSpi, that uses the TCP/IP to communicate with other nodes.

At startup, this SPI tries to start listening to local port specified by TcpCommunicationSpi.LocalPort. If local port is occupied, then SPI will automatically increment the port number until it can successfully bind for listening. TcpCommunicationSpi.LocalPortRange configuration parameter controls maximum number of ports that SPI will try before it fails.

📘

Local Port Range

Port range comes very handy when starting multiple grid nodes on the same machine or even in the same VM. In this case all nodes can be brought up without a single change in configuration.

Example

var cfg = new IgniteConfiguration
{
    CommunicationSpi = new TcpCommunicationSpi
    {
        LocalPort = 4321   // Override local port.
    }
};
<igniteConfiguration>
  	<!-- Override local port. -->
    <communicationSpi type='TcpCommunicationSpi' localPort='4321' />
</igniteConfiguration>
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
  ...
  <property name="communicationSpi">
    <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
      <!-- Override local port. -->
      <property name="localPort" value="4321"/>
    </bean>
  </property>
  ...
</bean>