Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
This module contains the base class to build services aware of Ignite.
"""

import socket

from abc import abstractmethod, ABCMeta

from ducktape.services.background_thread import BackgroundThreadService
Expand Down Expand Up @@ -75,6 +77,8 @@ def _prepare_config(self, node):

config.discovery_spi.prepare_on_start(cluster=self)

config.discovery_spi.local_address = socket.gethostbyname(node.account.hostname)

node_config = self.spec.config_template.render(config_dir=self.PERSISTENT_ROOT, work_dir=self.WORK_DIR,
config=config)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ class TcpDiscoverySpi(DiscoverySpi):
"""
TcpDiscoverySpi.
"""
def __init__(self, ip_finder=TcpDiscoveryVmIpFinder(), port=47500, port_range=100):
def __init__(self, ip_finder=TcpDiscoveryVmIpFinder(), port=47500, port_range=100, local_address=None):
self.ip_finder = ip_finder
self.port = port
self.port_range = port_range
self.local_address = local_address

@property
def type(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

{% macro tcp_discovery_spi(spi) %}
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
{% if spi.local_address %}
<property name="localAddress" value="{{ spi.local_address }}"/>
{% endif %}
<property name="localPort" value="{{ spi.port }}"/>
<property name="localPortRange" value="{{ spi.port_range }}"/>
{{ ip_finder(spi) }}
Expand Down