ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: Client & server in the same VM
Date Fri, 15 Jan 2016 13:51:48 GMT
Hi,

Looking at your code I see that you've just forgot to apply the newly 
configured IP finders to IgniteConfigurations.
Basically the following calls are missing in your code

igniteReplicatedConfiguration.setDiscoverySpi(tcpReplicatedDiscoverySpi);

igniteDistributedConfiguration.setDiscoverySpi(tcpDistributedDiscoverySpi);


Also please make sure the following (taken from [1]) cause you're using 
IP finders in non-shared mode /In this mode the list of IP addresses 
should also contain the address of the local node, so the node can 
become the 1st node in the cluster, in case if other remote nodes have 
not been started yet./ [1] 
https://apacheignite.readme.io/docs/cluster-config#static-ip-based-discovery 
-- Denis
On 1/15/2016 11:39 AM, DLopez wrote:
> Hi Denis,
>
> Thanks for your answer. I'm using TcpDiscoveryVmIpFinder directly, does that
> not disable multicast? I had already read the thread you linked and, AFAIK,
> done everything it's suggested there for static IP discovery (different
> local ports, different grid names) but from the logs, it seems multicast
> discovery is still being doing things under the hood. So, apart of using
> TcpDiscoveryVmIpFinder, what do I need to do to disable multicast?
>
> This is the full code code I'm using to test it:
> -----------------------------------------
> public class IgniteMultipleInstancesCase {
>      public static void main(String[] args) {
>
>          IgniteConfiguration igniteReplicatedConfiguration = new
> IgniteConfiguration();
>          igniteReplicatedConfiguration.setClientMode(false);
>          igniteReplicatedConfiguration.setGridName("REPLICATED_CLUSTER");
>          TcpDiscoveryVmIpFinder tcpReplicatedDiscoveryVmIpFinder = new
> TcpDiscoveryVmIpFinder();
>          tcpReplicatedDiscoveryVmIpFinder.registerAddresses(Arrays.asList(new
> InetSocketAddress("localhost", 3806)));
>          TcpDiscoverySpi tcpReplicatedDiscoverySpi = new TcpDiscoverySpi();
>          tcpReplicatedDiscoverySpi.setLocalPort(3806);
>          tcpReplicatedDiscoverySpi.setLocalPortRange(0);
>         
> tcpReplicatedDiscoverySpi.setIpFinder(tcpReplicatedDiscoveryVmIpFinder);
>          Ignite igniteReplicated =
> Ignition.start(igniteReplicatedConfiguration);
>          //
>          IgniteConfiguration igniteDistributedConfiguration = new
> IgniteConfiguration();
>          igniteDistributedConfiguration.setClientMode(true);
>          igniteDistributedConfiguration.setGridName("DISTRIBUTED_CLUSTER");
>          TcpDiscoveryVmIpFinder tcpDistributedDiscoveryVmIpFinder = new
> TcpDiscoveryVmIpFinder();
>         
> tcpDistributedDiscoveryVmIpFinder.registerAddresses(Arrays.asList(new
> InetSocketAddress("localhost", 3810)));
>          TcpDiscoverySpi tcpDistributedDiscoverySpi = new TcpDiscoverySpi();
>          tcpDistributedDiscoverySpi.setLocalPortRange(0);
>         
> tcpDistributedDiscoverySpi.setIpFinder(tcpDistributedDiscoveryVmIpFinder);
>          Ignite igniteDistributed =
> Ignition.start(igniteDistributedConfiguration);
>      }
> }
> ---
> Running this class, you can see the final output as
>
>> [09:44:42] Ignite node started OK (id=b02f1f9b, grid=DISTRIBUTED_CLUSTER)
>> [09:44:42] Topology snapshot [ver=2, servers=1, clients=1, CPUs=8,
>> heap=3.5GB]
> Thanks,
> D.
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Client-server-in-the-same-VM-tp2559p2576.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message