我正在尝试从我的Java App连接到本地运行的Ignite Server(通过ignite.bat运行)。这个问题很奇怪!我能够从Windows 8连接到VM Ware中运行的所有节点。但是,如果没有在PC上运行的那些VM ware Linux节点,我无法连接到本地运行的Ignite服务器。我使用127.0.0.1作为IP Finder中的地址,但它说无法连接到IP Finder的任何地址。这是我的Java代码 -
TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
List<String> addressList = new ArrayList<>();
addressList.add("127.0.0.1:47500");
addressList.add("192.168.25.1");
addressList.add("192.168.1.101");
addressList.add("192.168.56.1");
addressList.add("192.168.10.1");
addressList.add("localhost");
ipFinder.setAddresses(addressList);
tcpDiscoverySpi.setIpFinder(ipFinder);
tcpDiscoverySpi.setLocalAddress("127.0.0.1");
OptimizedMarshaller optimize = new OptimizedMarshaller();
optimize.setRequireSerializable(false);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setLocalHost("127.0.0.1");
cfg.setClientMode(true);
cfg.setPeerClassLoadingEnabled(false);
cfg.setMarshaller(optimize);
cfg.setMarshaller(optimize);
cfg.setDiscoverySpi(tcpDiscoverySpi);
Ignite ignite = Ignition.start(cfg);