Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

How to create a cluster from existing space instances?

If I were to boot up three different CPU's where each had a process that created a new space + container, is there a way I can join these three spaces into a cluster through use of API calls, as opposed to writing a config file and restarting each space, etc...



This thread was imported from the previous forum.
For your reference, the original is available here

asked 2008-08-31 17:44:23 -0500

jazzbutcher gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

There is no need to have a config file to form a clustered space. This is needed only in very special cases where the out of the box clustered-space schemas are not sufficient. Such special cases include asymmetrical replication or when there is a need to inject replication filter.

Starting few GSCs and deploying a cluster via the UI or CLI is very simple and does not require special config.

There is no public way to add a space to a running cluster. The cluster have pre-defined max amount of partitions.

Still, the location of the spaces , active partitions and the max data size capacity can be modified in runtime by relocating the spaces to another GSC.

For example: you can have 10 partitions running within 2 JVM with max heap size of 3 G each (total of 6 G data capacity), and later expand the capacity of the cluster to 30G by relocating the spaces into different 10 JVMs with 3 G heap size each.


answered 2008-08-31 22:20:14 -0500

shay hassidim gravatar image
edit flag offensive delete link more



Allow me to refine my question further. Is there a way I can call a GS API via Java in order to create a cluster? I do not want to use the GS-UI. I would prefer not to use CLI commands.

If so, do I need to have an spaces already created on the machines involved? Or can I just create the spaces/cluster all at once?

I would be interested in having a cluster to allow replication via sync or async replication.

Can you point me to any relevant examples or doc pages for this? I thought this was called "dynamic clustering", but i've yet to find any useful details about how to do it on the GS wiki.

Many thanks,


jazzbutcher gravatar imagejazzbutcher ( 2008-09-01 19:50:49 -0500 )edit

See: http://www.gigaspaces.com/wiki/displa...

To start 3 space instances in embedded mode (running as part of your application process) replicating their data and operations synchronously, you should have the following setup:

Member 1 IJSpace space = (IJSpace)SpaceFinder.find("/./mySpace?cluster_schema=sync_replicated&total_members=3&id=1");

Member 2 IJSpace space = (IJSpace)SpaceFinder.find("/./mySpace?cluster_schema=sync_replicated&total_members=3&id=2");

Member 3 IJSpace space = (IJSpace)SpaceFinder.find("/./mySpace?cluster_schema=sync_replicated&total_members=3&id=3");


shay hassidim gravatar imageshay hassidim ( 2008-09-01 22:04:16 -0500 )edit

I presume your example used "embedded mode" out of convenience. I assume it should be possible to run GS Java code on machine 'W' and create a cluster/spaces on machines X, Y and Z (not running in embedded mode). Is this correct?

Are there any limitations to doing this? ie... I would like to create a persistent cluster/spaces on machine X, Y, Z that does not go away when my Java app on machine 'W' stops running. Is this possible?



Edited by: jazzbutcher on Sep 2, 2008 2:07 AM

jazzbutcher gravatar imagejazzbutcher ( 2008-09-02 01:20:51 -0500 )edit

Sure , you can use the same URL to form the cluster with the relevant persistency configuration (property file) when using the gsInstance command. See examples as part of the above link.

I'm not sure why you can't use GSC , with relevant pu.xml and deploy command. It is much simpler and avoid the need to asign ID when starting the space when used with the gsInstance command.


shay hassidim gravatar imageshay hassidim ( 2008-09-02 11:42:48 -0500 )edit


I would like to avoid ssh'ing to a server machine from my client and running some script that uses the gsc command. I would prefer to be able to do this programatically through Java code running on a remote client app.

I don't know whether this makes any difference, but I will be running under an EDG environment.



jazzbutcher gravatar imagejazzbutcher ( 2008-09-02 12:38:39 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-08-31 17:44:23 -0500

Seen: 53 times

Last updated: Aug 31 '08