Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Using as-agent : Overview of as-agent

Overview of as-agent
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:
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.
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.
Starting as-agent
To start as-agent:
1.
Windows:
Default location: C:\tibco\as\2.0\bin
UNIX/Linux:
Default location: /opt/tibco/as/2.0/bin
2.
Enter as-agent.
You can specify a number of optional parameters. Each parameter specifies a parameter name and a value.
The syntax for launching as-agent with parameters is as follows:
as-agent -metaspace <metaspace_name> -discovery <discovery_url>  -listen <listen_url> -name <member_name> -remote_listen   <remote_listen_url> -log <log_file> -debug <log_level> -name   <member_name> -admin -data_store <directory path>
 
*I
If you start as-agent with the -member parameter; for example as-agent -name agent1, then when you run the Admin CLI you can issue the show member command and specify the member name of the agent to display the attributes of the member; for example, show member -name "agent1"
3.
The output of the help command is shown here. It includes the default values used if no parameter is provided by the user:
 
Usage:
-metaspace <metaspace_name> default ms
-discovery <url> / <url_list> default tibpgm://
-listen <url> default tcp://
-remote_listen <url>
-log <log_file>
-debug <log_level> default 3 (INFO)
-name <membername>
-admin
-security_token <token_filename>
-data_store <directory path>
 
Discovery url format:
  tcp://interface:port;interface2:port2;interface3:port3
  tibpgm://dport/interface;multicast/key1=value1;key2=value2;
  key3=value3
  tibrv://service/network/daemon
Listen url format: tcp://interface/listen_port
Remote listen url format: tcp://interface/remote_listen_port
 
The member name that you specify with the -name parameter can specify simply the member name; or, if you are implementing host-aware replication, can specify a membername in the form a.b, where a specifies the name of a region, for example region1, and b specifies the name of a seeder running in that region, in effect, on the same host.

For information on deploying host-aware replication, see Host-Aware Replication.
 
There is also a Java version of as-agent available in the lib directory that can be launched using java -jar as-agent, and which takes the same argument as the C version of the agent described above. The Java version of the as-agent behaves exactly as the C version, but will be able to service requests to remotely invoke methods as triggered by other applications using the space (obviously as long as it has the classes being invoked present in it's CLASSPATH).
For more details about discovery and listen URLs, see Chapter 3, “Performing Basic ActiveSpaces Tasks,” in the TIBCO ActiveSpaces Developer’s Guide.
Starting as-agent with Security Enabled
If you are using as-agent to start a requestor node that is authorized using a security domain controller that uses a security token file, the command to start as-agent must include the -security_token parameter. This parameter specifies the name of the security token file that has been placed on the controller node.
The following example shows how to start as-agent to start a requestor node with security enabled:
java -jar as-agent.jar -metaspace ms -security_token "exdomain_token.txt"
Command Parameters
This section gives examples of the as-agent command with additional parameters specified.
Running as-agent to Include a Command Console
To run as-agent and display an as-admin console that allows you to enter 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, which allows you to enter Admin CLI commands.
Log File Example
If you include the parameter -log <log_file>, then the log filename will be log_file-<processid>.log. For example, if you enter -log as, then the log filename is as-<processid>.log.
Using the -debug Parameter
To specify a log level, specify:
-debug <log_level>
The log levels are as follows:
1 = ERROR_LEVEL
2 = WARNING_LEVEL
3 = INFO_LEVEL
 
The default is 3 (INFO). The log information displayed on the console is minimal and cannot be controlled through this parameter. This parameter is only for log files. If a log file is not specified, then the debug (log level) value is ignored.
Using the -data_store Parameter
The -data_store parameter specifies the directory path where shared-nothing persistence files are stored.
If you are using shared-nothing persistence, specify the -data_store parameter when you run as-agent; for example:
as-agent -data_store <directory_path>
where directory_path specifies the directory path for the shared nothing persistence data store.
Remote Invocation
To provide necessary class files to support remote invocation, start your Java as-agent as follows:
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.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved