Hi Daniel,
It's easy to support your use case if to configure multicast [1] or
static IP finders in a particular way.
Please refer to these discussions happened earlier:
http://apache-ignite-users.70518.x6.nabble.com/How-keep-separate-different-grid-instances-on-the-same-network-td1609.html
http://apache-ignite-users.70518.x6.nabble.com/Two-ignite-instance-without-linking-td2342.html
[1]
https://apacheignite.readme.io/docs/cluster-config#multicast-based-discovery
[2]
https://apacheignite.readme.io/docs/cluster-config#static-ip-based-discovery
--
Denis
On 1/14/2016 1:50 PM, Daniel López wrote:
Hi there,
I have an application where I need to share some data between all
nodes, so we created a cluster with REPLICATED caches, so far so good.
There are other pieces of data that we need to use that we don't
need/want to keep local, so we are trying to setup a different cluster
and let the application servers just be clients of that cluster. So I
created a different cluster and specify in the configuration,
setClientMode(true). However, when I start both ignite instances in
the application, the second cluster seems to find the server of the
first cluster and decide it's also part of the cluster, hence
defeating the purpose of being "just a client".
So, in the same app:
// Define replicated cluster
igniteReplicatedConfiguration igniteReplicatedConfiguration = new
igniteReplicatedConfiguration();
igniteReplicatedConfiguration.setGridLogger(new Slf4jLogger(log));
igniteReplicatedConfiguration.setPeerClassLoadingEnabled(false);
igniteReplicatedConfiguration.setClientMode(false);
igniteReplicatedConfiguration.setGridName("REPLICATED_CLUSTER");
...
tcpReplicatedDiscoveryVmIpFinder.registerAddresses(/* localhost:3806 */ );
...
tcpReplicatedDiscoverySpi.setLocalPort(3806);
tcpReplicatedDiscoverySpi.setLocalPortRange(0);
... // Cache initialisation etc.
Ignite igniteReplicated = Ignition.start(igniteReplicatedConfiguration);
...
// Define distributed cluster
igniteDistributedConfiguration igniteDistributedConfiguration = new
igniteDistributedConfiguration();
igniteDistributedConfiguration.setGridLogger(new Slf4jLogger(log));
igniteDistributedConfiguration.setPeerClassLoadingEnabled(false);
igniteDistributedConfiguration.setClientMode(false);
igniteDistributedConfiguration.setGridName("DISTRIBUTED_CLUSTER");
...
tcpDistributedDiscoveryVmIpFinder.registerAddresses(/* localhost:3810
*/ );
...
tcpDistributedDiscoverySpi.setLocalPortRange(0);
... // Cache initialisation etc.
Ignite igniteDistributed = Ignition.start(igniteDistributedConfiguration);
When I start the application, I can see this:
[11:12:36] Ignite node started OK (id=43d3eabd, grid=REPLICATED_CLUSTER
[11:12:36] Topology snapshot [ver=1, servers=1, clients=0, CPUs=8,
heap=4.0GB]
Just one server, good. I would then expect the app to stop because I
have not started the server (a different app configured to listen at
localhost:3810) for the the DISTRIBUTED_CLUSTER. But instead of
stopping, I see this:
[11:12:38] Ignite node started OK (id=9eff8e55, grid=DISTRIBUTED_CLUSTER
[11:12:38] Topology snapshot [ver=2, servers=1, clients=1, CPUs=8,
heap=4.0GB]
If I then start the DISTRIBUTED_CLUSTER server, then the topology
updates and reads 2 servers, 1 client... huh?
If I comment out the first part, where igniteReplicated instance is
created, then I see the expected result:
WARN |2016-01-14T10:40:01,862||TcpDiscoverySpi|IP finder returned
empty addresses list. Please check IP finder configuration and make
sure multicast works on your network. Will retry every 2 secs.
[11:40:01] IP finder returned empty addresses list. Please check IP
finder configuration and make sure multicast works on your network.
Will retry every 2 secs.
and stays there until I start the DISTRIBUTED_CLUSTER server.
I've browsed the documentation and the mailing list archive and I
could not find any other setting that might sound helpful...
Am I missing something?
Thanks!
D.