You can create clusters using the
You can separate and group your clusters in a simple way by specifying cluster names. Example groupings can be by development, production, test, app, etc. The following is an example declarative configuration.
<hazelcast> <cluster-name>production</cluster-name> </hazelcast>
hazelcast: cluster-name: production
You can also define the cluster configuration programmatically.
A JVM can host multiple Hazelcast instances. Each Hazelcast instance can only
participate in one group. Each Hazelcast instance only joins to its own group
and does not interact with other groups. The following code example creates
three separate Hazelcast instances--
h1 belongs to the
h3 belong to the
Config configProd = new Config(); configProd.setClusterName( "production" ); Config configDev = new Config(); configDev.setClusterName( "development" ); HazelcastInstance h1 = Hazelcast.newHazelcastInstance( configProd ); HazelcastInstance h2 = Hazelcast.newHazelcastInstance( configDev ); HazelcastInstance h3 = Hazelcast.newHazelcastInstance( configDev );