ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Cherkasov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-7572) Local cache fails to start on local node
Date Tue, 30 Jan 2018 18:29:00 GMT
Mikhail Cherkasov created IGNITE-7572:
-----------------------------------------

             Summary: Local cache fails to start on local node
                 Key: IGNITE-7572
                 URL: https://issues.apache.org/jira/browse/IGNITE-7572
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 2.3
            Reporter: Mikhail Cherkasov
            Assignee: Mikhail Cherkasov
             Fix For: 2.5


Reproducer:


import java.util.Arrays;
import org.apache.ignite.Ignite;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.jetbrains.annotations.NotNull;

public class LocalCache {
 private static int id;

 public static void main(String[] args) throws InterruptedException {
 Ignition.setClientMode(false);

 Ignite server = Ignition.start(getConfiguration());

 System.out.println("Server is up");

 Ignition.setClientMode(true);
 Ignite client = Ignition.start(getConfiguration());

 System.out.println("Client is up");
 }

 @NotNull private static IgniteConfiguration getConfiguration() {
 IgniteConfiguration cfg = new IgniteConfiguration();

 TcpDiscoveryVmIpFinder finder = new TcpDiscoveryVmIpFinder(true);
 finder.setAddresses(Arrays.asList("localhost:47500..47600"));

 cfg.setIgniteInstanceName("test" + id++);

 CacheConfiguration cacheConfiguration = new CacheConfiguration("TEST");
 cacheConfiguration.setCacheMode(CacheMode.LOCAL);

 cfg.setCacheConfiguration(cacheConfiguration);

 cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(finder));
 return cfg;
 }
}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message