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

Ask Your Question

Confused with clustering space and SLA

I have 2 computers in cluster - on each of them I have 2 GSC. I need to deploy my web application with space to cluster.

I little bit confused, but don't understand - how it works. When I wrote "<os-sla:sla cluster-schema="partitioned-sync2backup" number-of-instances="2" number-of-backups="1" max-instances-per-vm="1">" - this configuration is deployed my application to the cluster with backups or spaces? As I understand - for deploying spaces I need to wrote next lines - "<os-core:space id="space" url="/./mySpace?total_members=2&id=1"/>". But how it all works? My web application deployed on first machine to the first and second GSC or only first? And where deployed spaces - on the first or second machine and? Sorry for noob question, but I'm in the dead end. And small question - is Gigaspaces have any way to write some objects to spaces in cluster after deploying(not from external data source, just simple java code) or I need to use Spring Cron?

asked 2013-10-19 15:18:43 -0500

ssherbakov gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

The number-of-backups property is relevant only for statefull PU - a PU that have a space bean with an embedded URL (e.g "/./mySpace").

If you deploy a war file that connects to a remote space - URL is in the format :


This is considered a stateless PU. In this case the number-of-backups property is irrelevant and ignored.

You can have a bean that is injected with an embedded GigaSpace that is activated only with a primary space partition that can write objects into the space once fully deployed and started.

Deployed PU is first provisioned into an empty GSC. If you want to control to which GSCs a deployed PU will be provisioned you should use zones. See: http://wiki.gigaspaces.com/wiki/displ...

class MyBean {
    // invoked after a space becomes primary; doesn't get any parameter. 
    public void myAfterPrimaryMethod() {
        // Do something

make sure you pu.xml have this:

<os-core:annotation-support />

See more: http://wiki.gigaspaces.com/wiki/displ...


answered 2013-10-19 17:44:01 -0500

shay hassidim gravatar image

updated 2013-10-19 17:44:56 -0500

edit flag offensive delete link more


Thank you. But general poin in my question - if I need deploy web application and 2 spaces with backups for each app, what I need to do? As I understand - I need to wrote next lines:

<os-sla:sla cluster-schema="partitioned-sync2backup" max-instances-per-vm="1" number-of-backups="1" number-of-instances="2"> <os-core:space id="space" url="/./mySpace?total_members=2&amp;id=1"> And how it works - each web application, primary spaces and backups is loadig to the different GSC? I.e. for this configuration I need 2 GSC for web application, 2 instances for primary spaces and 2 instances for the backup spaces? I.e. I need to have 6 GSC?</os-core:space></os-sla:sla>

ssherbakov gravatar imagessherbakov ( 2013-10-20 01:52:48 -0500 )edit

In general running a web app that embed a space in a partitioned cluster schema does not make sense.

The web instances collocated with the backup space instances will not be able to access their collocated spaces as backup instances are blocked from application access.

Deploying a replicated cluster makes more sense when the entire data set fits a single JVM and you don't need to start new web apps dynamically.

More sensible architecture would be to deploy a data grid and the web application separately (different PUs) where the web application communicates with the remote data grid (using remote URL).

To optimize read operations the web applications should have a local view. This will speed up read operations dramatically and will allow you to start new web applications dynamically.

Do you know how much data your web application will need to store in-memory?

Can you fit it within a single JVM?

Are you running map-reduce operations on the data grid?

Maybe a partitioned space is not required in your case.

Does your app perform more read operations than write operations?

Some more details about application will help us to establish the right architecture that fits your needs.

shay hassidim gravatar imageshay hassidim ( 2013-10-20 03:12:01 -0500 )edit

Thank you!!! But sorry for noob question, but now I'm try to deploy some spaces in cluster from Processing Unit, but in GS-UI I see only one space instance in active state, others - in Unreachable state(gray circle). This my configuration - "<os-core:space id="space" url="/./mySpace?cluster_schema=sync_replicated&total_members=2&**id=1**"/>". But when I add another line - "<os-core:space id="space" url="/./mySpace?cluster_schema=sync_replicated&total_members=2&**id=2**"/>" - all is ok. But how to deploy spaces from one processing unit with one line? And as I understand - all spaces is running in one GSC(without SLA)?

ssherbakov gravatar imagessherbakov ( 2013-10-20 07:20:14 -0500 )edit

I.e. I have one simple question - how to deploy spaces with "sync_replicated" schema in my cluster, and it's possible via SLA? Please, if it's not hard - give me configuration lines for this.

ssherbakov gravatar imagessherbakov ( 2013-10-20 11:34:37 -0500 )edit

Problem resolved.

ssherbakov gravatar imagessherbakov ( 2013-10-20 14:01:46 -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: 2013-10-19 15:18:43 -0500

Seen: 385 times

Last updated: Oct 20 '13