Skip to content

Instantly share code, notes, and snippets.

@ahodroj
Last active December 14, 2015 08:49
Show Gist options
  • Save ahodroj/5060718 to your computer and use it in GitHub Desktop.
Save ahodroj/5060718 to your computer and use it in GitHub Desktop.
Starts an elastic in-memory data grid in XAP running with ESM
import org.openspaces.admin.*
import org.openspaces.admin.pu.elastic.config.ManualCapacityScaleConfigurer
import org.openspaces.admin.space.ElasticSpaceDeployment
import org.openspaces.core.util.MemoryUnit
println "Starting Elastic In-Memory Data Grid..."
pu = new AdminFactory().addGroup("ahodroj").createAdmin().gridServiceManagers.waitForAtLeastOne().deploy(
new ElasticSpaceDeployment("mySpace")
.memoryCapacityPerContainer(128, MemoryUnit.MEGABYTES).maxMemoryCapacity(2048, MemoryUnit.MEGABYTES)
.singleMachineDeployment()
// initial scale
.scale(
new ManualCapacityScaleConfigurer()
.memoryCapacity(512, MemoryUnit.MEGABYTES)
.create()
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment