This quickstart demonstrates how create a simple, clustered, cache on JBoss AS 7.1.
The example can be deployed using Maven from the command line or from Eclipse using JBoss Tools.
For more information, including how to set up Maven or JBoss Tools in Eclipse, refer to the Getting Started Guide.
-
Edit
standalone/configuration/standalone.xmland add a cache -
Start the server by runnig
bin/standalone.sh -
Package the app by running
mvn clean package -
Deploy the app using the management console at http://localhost:9990
-
Access the app at http://localhost:8080/infinispan-jboss-as7/home.jsf and put entries into the cache
-
Edit
domain/configuration/domain.xmland add a this cache container configuration to thefull-haprofile: -
Ensure that you have an ha group starting, edit domain/configuration/host.xml, copy server-three to create a server-four, and change the port offset to
350. Set both server-three and server-four toauto-start="true"and server-one and server-two toauto-start="false". -
Change 'cluster-password' value in "urn:jboss:domain:messaging:1.1" subsystem to something else. For example:
new-password
-
Start the domain by running
bin/domain.sh -
Package the app by running
mvn clean package -
Deploy the app using the management console at http://localhost:9990
-
Access the app on both nodes (http://localhost:8330/infinispan-jboss-as7/home.jsf and http://localhost:8430/infinispan-jboss-as7/home.jsf) and put entries into the cache
- To deploy the Infinispan subsystem use the following commands
mvn -Pstandalone-local jboss-as:add-resourcefor a local cachemvn -Pdomain-distributed jboss-as:add-resourcefor a distributed cache
- To deploy the application use
mvn clean package jboss-as:deploy
This quick start ships a .cli script in the root folder that automatically applies the AS7 container changes required to get the domain part of the quick start running. To run this script:
- Start the domain in admin-only mode: [JBOSS_HOME]/bin/domain.sh --admin-only
- From the quickstart root folder, execute: [JBOSS_HOME]/bin/jboss-cli.sh --file=infinispan-as7.cli
- Restart the domain