The as-agent Utility

ActiveSpaces provides an agent process called as-agent. The main purpose of as-agent is to join all distributed spaces in the specified metaspace as a seeder. You can run as-agent on any host.

You can also use as-agent to:

  • Ensure that the desired degree of replication specified for a space is achieved.

    Because the amount of data that can be stored in a space depends on the number of seeding members of the space, you might need to add seeders to a space to scale it up. Although any process using the ActiveSpaces API can become a seeder on a space, there are situations where applications may not always be running and joined to the space, or where not enough applications have joined the space.

  • Ensure data integrity.

    Because the data contained in the space disappears along with the last seeder in the space, this can be a problem. You can use the as-agent process to ensure that there are always one or more seeders for each space in the metaspace.

    Agents remain connected to the metaspace, and always seed the system spaces, keeping the metaspace’s space definitions alive, even when all other applications have quit the metaspace.

Running as-agent to Include a Command Console

You can use as-agent to run Admin CLI commands when as-agent starts up. To run as-agent and display a command prompt which accepts Admin CLI commands, specify the -admin parameter as follows:

java -jar as-agent.jar -admin

When as-agent starts, an as-agent command prompt appears, where you can enter the Admin CLI commands.

Remote Invocation

The use of remote invocation is possible when using the Java as-agent. Use the following command to start your Java as-agent so that it can find the class files it should use for remote invocation:

java -Djava.ext.dirs=$LOCATION_OF_JARS$ -jar as-agent.jar
		

Otherwise, running java as-agent in a cluster that includes remote members will cause invoke methods to fail with a “ClassNotFound” exception.