Java Code Examples for org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder#setAddresses()

The following examples show how to use org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder#setAddresses() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IgniteInterpreterTest.java    From zeppelin with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() {
  TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
  ipFinder.setAddresses(Collections.singletonList(HOST));

  TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
  discoSpi.setIpFinder(ipFinder);

  IgniteConfiguration cfg = new IgniteConfiguration();
  cfg.setDiscoverySpi(discoSpi);

  cfg.setGridName("test");

  ignite = Ignition.start(cfg);

  Properties props = new Properties();
  props.setProperty(IgniteSqlInterpreter.IGNITE_JDBC_URL,
          "jdbc:ignite:cfg://[email protected]");
  props.setProperty(IgniteInterpreter.IGNITE_CLIENT_MODE, "false");
  props.setProperty(IgniteInterpreter.IGNITE_PEER_CLASS_LOADING_ENABLED, "false");
  props.setProperty(IgniteInterpreter.IGNITE_ADDRESSES, HOST);

  intp = new IgniteInterpreter(props);
  intp.open();
}
 
Example 2
Source File: DhtAndNearEvictionTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.EVICTION);

    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setGridLogger(strLog);

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
    ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47501"));
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));

    return cfg;
}
 
Example 3
Source File: IgniteInterpreter.java    From zeppelin with Apache License 2.0 5 votes vote down vote up
private Ignite getIgnite() {
  if (ignite == null) {
    try {
      String cfgUrl = getProperty(IGNITE_CFG_URL);

      if (cfgUrl != null && !cfgUrl.isEmpty()) {
        ignite = Ignition.start(new URL(cfgUrl));
      } else {
        IgniteConfiguration conf = new IgniteConfiguration();

        conf.setClientMode(Boolean.parseBoolean(getProperty(IGNITE_CLIENT_MODE)));

        TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
        ipFinder.setAddresses(getAddresses());

        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
        discoSpi.setIpFinder(ipFinder);
        conf.setDiscoverySpi(discoSpi);

        conf.setPeerClassLoadingEnabled(
                Boolean.parseBoolean(getProperty(IGNITE_PEER_CLASS_LOADING_ENABLED)));

        ignite = Ignition.start(conf);
      }

      initEx = null;
    } catch (Exception e) {
      logger.error("Error in IgniteInterpreter while getIgnite: " , e);
      initEx = e;
    }
  }
  return ignite;
}
 
Example 4
Source File: TcpClientDiscoverySpiSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @param clientIdx Client index.
 * @param srvIdx Server index.
 * @throws Exception In case of error.
 */
private void setClientRouter(int clientIdx, int srvIdx) throws Exception {
    TcpDiscoverySpi disco =
        (TcpDiscoverySpi)G.ignite("client-" + clientIdx).configuration().getDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = (TcpDiscoveryVmIpFinder)disco.getIpFinder();

    String addr = new ArrayList<>(IP_FINDER.getRegisteredAddresses()).get(srvIdx).toString();

    if (addr.startsWith("/"))
        addr = addr.substring(1);

    ipFinder.setAddresses(Collections.singletonList(addr));
}
 
Example 5
Source File: IgniteLaunchInModularEnvTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @return default configuration for test without spring module.
 */
private IgniteConfiguration igniteConfiguration() {
    IgniteConfiguration cfg = new IgniteConfiguration();

    TcpDiscoveryVmIpFinder finder = new TcpDiscoveryVmIpFinder();
    finder.setAddresses(Collections.singletonList("127.0.0.1"));
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(finder));
    return cfg;
}
 
Example 6
Source File: VisorManagementEventSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();

    // Enable visor management events.
    cfg.setIncludeEventTypes(
        EVT_MANAGEMENT_TASK_STARTED
    );

    cfg.setCacheConfiguration(
        new CacheConfiguration<Integer, Integer>()
            .setName("TEST")
            .setIndexedTypes(Integer.class, Integer.class)
            .setStatisticsEnabled(true)
    );

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();

    List<String> addrs = Arrays.asList("127.0.0.1:47500..47502");

    ipFinder.setAddresses(addrs);

    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    discoSpi.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(discoSpi);

    return cfg;
}
 
Example 7
Source File: JdbcStreamingToPublicCacheTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    CacheConfiguration<?,?> cache = defaultCacheConfiguration();

    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setIndexedTypes(
        Integer.class, Integer.class
    );

    cfg.setCacheConfiguration(cache);
    cfg.setLocalHost("127.0.0.1");

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
    ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47501"));

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    cfg.setConnectorConfiguration(new ConnectorConfiguration());

    return cfg;
}
 
Example 8
Source File: JdbcStreamingSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @param gridName Grid name.
 * @return Grid configuration used for starting the grid.
 * @throws Exception If failed.
 */
private IgniteConfiguration getConfiguration0(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    CacheConfiguration<?,?> cache = defaultCacheConfiguration();

    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setIndexedTypes(
        Integer.class, Integer.class
    );

    cfg.setCacheConfiguration(cache);
    cfg.setLocalHost("127.0.0.1");

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
    ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47501"));

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    cfg.setConnectorConfiguration(new ConnectorConfiguration());

    return cfg;
}
 
Example 9
Source File: JdbcBulkLoadSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @param gridName Grid name.
 * @return Grid configuration used for starting the grid.
 * @throws Exception If failed.
 */
private IgniteConfiguration getConfiguration0(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    CacheConfiguration<?,?> cache = defaultCacheConfiguration();

    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setIndexedTypes(
        Integer.class, Person.class
    );

    cfg.setCacheConfiguration(cache);
    cfg.setLocalHost("127.0.0.1");

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
    ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47501"));

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    cfg.setConnectorConfiguration(new ConnectorConfiguration());

    return cfg;
}
 
Example 10
Source File: IgniteDemo.java    From banyan with MIT License 5 votes vote down vote up
public static IgniteConfiguration getIgniteConfiguration() {
    IgniteConfiguration configuration = new IgniteConfiguration();
    TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
    TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder();
    tcpDiscoveryVmIpFinder.setAddresses(addresses);
    tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);

    configuration.setDiscoverySpi(tcpDiscoverySpi);
    configuration.setClientMode(true);
    configuration.setPeerClassLoadingEnabled(true);
    return configuration;
}
 
Example 11
Source File: IgniteSqlInterpreterTest.java    From zeppelin with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
  TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
  ipFinder.setAddresses(Collections.singletonList(HOST));

  TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
  discoSpi.setIpFinder(ipFinder);

  IgniteConfiguration cfg = new IgniteConfiguration();
  cfg.setDiscoverySpi(discoSpi);
  cfg.setPeerClassLoadingEnabled(true);

  cfg.setGridName("test");

  ignite = Ignition.start(cfg);

  Properties props = new Properties();
  props.setProperty(IgniteSqlInterpreter.IGNITE_JDBC_URL,
          "jdbc:ignite:cfg://[email protected]");

  intp = new IgniteSqlInterpreter(props);

  CacheConfiguration<Integer, Person> cacheConf = new CacheConfiguration<>();
  cacheConf.setIndexedTypes(Integer.class, Person.class);
  cacheConf.setName("person");

  IgniteCache<Integer, Person> cache = ignite.createCache(cacheConf);
  cache.put(1, new Person("sun", 100));
  cache.put(2, new Person("moon", 50));
  assertEquals("moon", cache.get(2).getName());

  intp.open();
}
 
Example 12
Source File: GridLog4jCorrectFileNameTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * Creates grid configuration.
 *
 * @param igniteInstanceName Ignite instance name.
 * @return Grid configuration.
 */
private static IgniteConfiguration getConfiguration(String igniteInstanceName) {
    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setIgniteInstanceName(igniteInstanceName);
    cfg.setGridLogger(new Log4JLogger());
    cfg.setConnectorConfiguration(null);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(false);

    ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47502"));

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    return cfg;
}
 
Example 13
Source File: CacheConfigurationP2PTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @return Configuration.
 */
static IgniteConfiguration createConfiguration() {
    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setPeerClassLoadingEnabled(true);

    cfg.setLocalHost("127.0.0.1");

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinderCleanFrequency(1000);

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();

    ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    return cfg;
}
 
Example 14
Source File: TcpClientDiscoverySpiSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception if failed.
 */
@Test
public void testClientReconnectHistoryMissingOnRouter() throws Exception {
    clientFailureDetectionTimeout = 60000;
    netTimeout = 60000;

    startServerNodes(2);

    Ignite srv0 = grid("server-0");
    TcpDiscoveryNode srv0Node = (TcpDiscoveryNode)srv0.cluster().localNode();

    clientIpFinder = new TcpDiscoveryVmIpFinder();
    clientIpFinder.setAddresses(
        Collections.singleton("localhost:" + srv0Node.discoveryPort()));

    startClientNodes(1);

    attachListeners(0, 1);

    Ignite client = grid("client-0");
    TcpDiscoveryNode clientNode = (TcpDiscoveryNode)client.cluster().localNode();
    TestTcpDiscoverySpi clientSpi = (TestTcpDiscoverySpi)client.configuration().getDiscoverySpi();
    UUID clientNodeId = clientNode.id();

    checkNodes(2, 1);

    clientSpi.pauseAll(true);

    stopGrid(srv0.name());

    startServerNodes(1);

    Ignite srv2 = grid("server-2");
    TcpDiscoveryNode srv2Node = (TcpDiscoveryNode)srv2.cluster().localNode();
    clientIpFinder.setAddresses(
        Collections.singleton("localhost:" + srv2Node.discoveryPort()));

    clientSpi.resumeAll();

    awaitPartitionMapExchange();

    assertEquals("connected", clientSpi.getSpiState());
    assertEquals(clientNodeId, clientNode.id());
    assertEquals(srv2Node.id(), clientNode.clientRouterNodeId());
}
 
Example 15
Source File: ComputeFailoverNodeStartup.java    From ignite with Apache License 2.0 3 votes vote down vote up
/**
 * Create Ignite configuration with configured checkpoints.
 *
 * @return Ignite configuration.
 * @throws IgniteException If configuration creation failed.
 */
public static IgniteConfiguration configuration() throws IgniteException {
    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setLocalHost("127.0.0.1");
    cfg.setPeerClassLoadingEnabled(true);

    // Configure checkpoint SPI.
    SharedFsCheckpointSpi checkpointSpi = new SharedFsCheckpointSpi();

    checkpointSpi.setDirectoryPaths(Collections.singletonList("work/checkpoint/sharedfs"));

    cfg.setCheckpointSpi(checkpointSpi);

    // Configure discovery SPI.
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();

    ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));

    discoSpi.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(discoSpi);

    return cfg;
}
 
Example 16
Source File: MemcacheRestExampleNodeStartup.java    From ignite with Apache License 2.0 3 votes vote down vote up
/**
 * Create Ignite configuration with IGFS and enabled IPC.
 *
 * @return Ignite configuration.
 * @throws IgniteException If configuration creation failed.
 */
public static IgniteConfiguration configuration() throws IgniteException {
    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setLocalHost("127.0.0.1");
    cfg.setDeploymentMode(SHARED);
    cfg.setPeerClassLoadingEnabled(true);

    cfg.setConnectorConfiguration(new ConnectorConfiguration());

    CacheConfiguration cacheCfg = new CacheConfiguration();

    cacheCfg.setName("default");
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg.setRebalanceMode(SYNC);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);

    cfg.setCacheConfiguration(cacheCfg);

    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();

    ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500..47509"));

    discoSpi.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(discoSpi);

    return cfg;
}
 
Example 17
Source File: CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    //Data Storage

    cfg.setDataStorageConfiguration(getDataStorageConfiguration());

    //cache configuration

    CacheConfiguration ccfg = getCacheConfiguration();

    if (isHangOnWriteAll)
        ccfg.setCacheStoreFactory(getStoreFactoryWithHangWriteAll());
    else
        ccfg.setCacheStoreFactory(getStoreFactory());

    cfg.setCacheConfiguration(ccfg);

    //discovery

    TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder();

    ArrayList<String> addrs = new ArrayList<>();

    addrs.add("127.0.0.1:47500..47509");

    tcpDiscoveryVmIpFinder.setAddresses(addrs);

    tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);

    cfg.setDiscoverySpi(tcpDiscoverySpi);

    return cfg;
}
 
Example 18
Source File: QueryEntityCaseMismatchTest.java    From ignite with Apache License 2.0 2 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setLocalHost("127.0.0.1");

    cfg.setPeerClassLoadingEnabled(true);

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
    ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500..47509"));

    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    discoSpi.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(discoSpi);

    CacheConfiguration<Object, Integer> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

    cfg.setMarshaller(new BinaryMarshaller());

    QueryEntity queryEntity = new QueryEntity("KeyType", Integer.class.getName());

    LinkedHashMap<String, String> fields = new LinkedHashMap<>();

    fields.put("a", "TypeA");
    fields.put("b", "TypeB");

    queryEntity.setFields(fields);

    //Specify key fields in upper register
    HashSet<String> keyFields = new HashSet<>();

    keyFields.add("a");
    keyFields.add("B");

    queryEntity.setKeyFields(keyFields);

    ccfg.setQueryEntities(F.asList(queryEntity));

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example 19
Source File: CacheConfigurationP2PTestClient.java    From ignite with Apache License 2.0 2 votes vote down vote up
/**
 * @param args Arguments.
 * @throws Exception If failed.
 */
public static void main(String[] args) throws Exception {
    System.out.println("Starting test client node.");

    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setPeerClassLoadingEnabled(true);

    cfg.setLocalHost("127.0.0.1");

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();

    ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    try (Ignite ignite = Ignition.start(cfg)) {
        System.out.println("Test external node started");

        int nodes = ignite.cluster().nodes().size();

        if (nodes != 4)
            throw new Exception("Unexpected nodes number: " + nodes);

        CacheConfiguration<Integer, Organization1> ccfg1 = new CacheConfiguration<>();

        ccfg1.setName("cache1");

        ccfg1.setNodeFilter(new CacheAllNodesFilter());

        ccfg1.setIndexedTypes(Integer.class, Organization1.class);

        System.out.println("Create cache1.");

        IgniteCache<Integer, Organization1> cache1 = ignite.createCache(ccfg1);

        for (int i = 0; i < 500; i++)
            cache1.put(i, new Organization1("org-" + i));

        SqlQuery<Integer, Organization1> qry1 = new SqlQuery<>(Organization1.class, "_key >= 0");

        int cnt = cache1.query(qry1).getAll().size();

        if (cnt != 500)
            throw new Exception("Unexpected query result: " + cnt);

        System.out.println("Sleep some time.");

        Thread.sleep(5000); // Sleep some time to wait when connection of p2p loader is closed.

        System.out.println("Create cache2.");

        CacheConfiguration<Integer, Organization2> ccfg2 = new CacheConfiguration<>();

        ccfg2.setName("cache2");

        ccfg2.setIndexedTypes(Integer.class, Organization2.class);

        IgniteCache<Integer, Organization2> cache2 = ignite.createCache(ccfg2);

        for (int i = 0; i < 600; i++)
            cache2.put(i, new Organization2("org-" + i));

        SqlQuery<Integer, Organization2> qry2 = new SqlQuery<>(Organization2.class, "_key >= 0");

        cnt = cache2.query(qry2).getAll().size();

        if (cnt != 600)
            throw new Exception("Unexpected query result: " + cnt);

        cache1.destroy();

        cache2.destroy();
    }
}
 
Example 20
Source File: TcpClientDiscoverySpiSelfTest.java    From ignite with Apache License 2.0 2 votes vote down vote up
/**
 * @param singleSrv If {@code true} starts one server node two otherwise.
 * @throws Exception If failed.
 */
private void missedAddFinishedMessage(boolean singleSrv) throws Exception {
    int srvs = singleSrv ? 1 : 2;

    startServerNodes(srvs);

    afterWrite = new CIX2<TcpDiscoveryAbstractMessage, Socket>() {
        private boolean first = true;

        @Override public void applyx(TcpDiscoveryAbstractMessage msg, Socket sock) throws IgniteCheckedException {
            if (first && (msg instanceof TcpDiscoveryJoinRequestMessage)) {
                first = false;

                log.info("Close socket after message write [msg=" + msg + "]");

                try {
                    sock.close();
                }
                catch (IOException e) {
                    throw new IgniteCheckedException(e);
                }

                log.info("Delay after message write [msg=" + msg + "]");

                U.sleep(5000); // Wait when server process join request.
            }
        }
    };

    Ignite srv = singleSrv ? G.ignite("server-0") : G.ignite("server-1");

    TcpDiscoveryNode srvNode = (TcpDiscoveryNode)srv.cluster().localNode();

    assertEquals(singleSrv ? 1 : 2, srvNode.order());

    clientIpFinder = new TcpDiscoveryVmIpFinder();

    clientIpFinder.setAddresses(Collections.singleton("localhost:" + srvNode.discoveryPort()));

    startClientNodes(1);

    TcpDiscoveryNode clientNode = (TcpDiscoveryNode)G.ignite("client-0").cluster().localNode();

    assertEquals(srvNode.id(), clientNode.clientRouterNodeId());

    checkNodes(srvs, 1);
}