SenseiGMNS usage
SenseiGMNS, as explained on its own section, specifies the functionality to create or extend subgroups.
It includes two parts: a utility where the client must supply the reference of other group member to join its group,
and a directory service. With the directory service, clients just specify the name of a group, and the server takes
care of finding other member to perform the join.
To use the utility, it is not needed to execute the GMNS server: the scripts gmns.sh
or gmns.bat are used to start the directory server.
The directory server is a replicated application: it should be running on every host where a group is to be
existing, although this is not required. As a matter of fact, it is enough to run the directory server on one host,
but should this host fall down, no members would be able to join or create new groups!!!
To execute the GMNS server on several hosts, it is important to specify right configuration values;
the important values, (all the GMNS configuration values are explained below) are those that specify the references
to other GMNSs.
Each GMNS must publish itself; it can use a URL, or a TCP/IP port. In the first case, it must supply a valid file
on the configuration value GMNS.referenceFile. In the second case, the port to be used
(is always published on the host where it is executed), must be specified on the configuration value
GMNS.referencePort.
For example, a GMNS running on the host 201.23.23.1 which wants to be accessed on the port 12500,
should specify
GMNS.referencePort=12500
Other GMNS's configuration file must now be able to give the localization of the previous GMNS. To do it,
it must first specify, using the configuration value GMNS.hosts, the number of available
GMNS servers. For each of these GMNSs, it must be specified, or their TCP/IP socket, or their URL.
Following the same example, it could give the values shown below:
GMNS.hosts=1
GMNS.hostSocket.1=201.23.23.1:12500
If a server is reachable via a URL, instead of using GMNS.hostSocket.xxx, the
configuration property is GMNS.hostURL.xxx, like, for example:
GMNS.hostURL.4=http://grasia.fdi.ucm.es/sensei/example/gmns.1
Sensei's configuration values
Sensei is configured on a single properties file, which contains values for all the subsystems
(GMS, GMNS, also logging values for debugging purposes). The table of properties, together with the default values, is
explained below. Note that all the distributions come with a configuration file with default values, located in the
scripts (or scripts.win) directory.
Important: Sensei tries by default to open a file called Sensei.properties, which can
be located in any of the following places:
- Current directory: directory where the program using sensei is started.
- User's home directory.
- Java's home directory.
If no configuration file is found, Sensei will use default values.
Nevertheless, any application can force Sensei to use a different file. For example, most of the
examples (and GMNS itself) support this configuration file through an argument on the command line, usually called
conf or config, that must be used like:
gmns.sh -conf=/local/specificGMNSconf.sensei
Value |
Meaning |
Default value |
verboseMode |
If true, configuration values are logged. |
true |
logging |
If true, logging is enabled |
false |
remoteLoggingPort |
If logging is true, this value specifies wether the logging is done locally or remotely.
If it is 0, it is done locally; otherwise, it specifies the port where the logging server is
listening (must be executed on the same host)
|
0 |
debugMode |
It specifies wether assertions are enabled or not. This value has no sense if the optimized
libraries are used |
true |
GMS.channelLivenes |
Period, in milliseconds, after which a channel is considered faulty. |
10000 |
GMS.maxProcessMessageDelay |
Timeout, in milliseconds, for an application to process a message. Otherwise, the application is considered slow and
excluded from the group |
5000 |
GMS.tokenStoppedPeriod |
Period, in milliseconds, that a group member holds the token when there are no group communications. |
50 |
GMS.tokenLostTimeout |
Timeout, in milliseconds, to receive a token; if not received in this time, it is considered lost, and
the member will start the recovery protocol. |
6000 |
GMS.weakConsensus |
Specifies when to use weak consensus. In this case, it is enough that half of the members of a group
keep communicating to be considered healthy. Otherwise, it is needed a majority of members. |
false |
GMS.trace |
Set to true to log GMS traces. This value has no sense with the optimized libraries. |
false |
GMS.traceCode |
Set to true to log GMS code (every executed method is logged). This value has no sense with
the optimized libraries. |
false |
GMS.traceExceptions |
Set to true to log GMS exceptions. This value has no sense with the optimized libraries.
Note that Sensei handles most of the exceptions (those unrecoverable are shown anyway). This value
is still useful to track problems with some specific member. |
false |
GMS.traceExceptionsDetailed |
Set to true to log GMS exceptions with the full trace. This value has no sense with the
optimized libraries. |
false |
GMNS.referenceFile |
The file to store the reference for the current GMNS instance.
Only this ot the referencePort are needed.
If the referenceFile is present, the referencePort is not used. If both are unspecified,
the default port is used
|
N/A |
GMNS.referencePort |
The port to export the reference for the current GMNS instance. |
1212 |
GMNS.backupFile |
The file to store the backup information for the current GMNS instance |
GMNS.backup |
GMNS.backupPeriod |
Periodic time (in milleseconds) to store the GMNS information on the backup file. |
300 |
GMNS.checkPeriod |
Period (in milleconds) to check the members registered in the GMNS server. |
10 |
GMNS.hosts |
Number of other GMNS hosts, whose reference must be then specified using their TCP/IP
addresses or URL files. |
0 |
GMNS.hostURL. |
Each host must specify its URL or TCP/IP. If there is just other GMNS host published
on the URL http://grasia.fdi.ucm.es/sensei/GMNS.ref, it would be needed to specify
(with GMNS.hosts=1):
GMNS.hostURL.1=http://grasia.fdi.ucm.es/sensei/GMNS.ref
|
N/A |
GMNS.hostSocket. |
Each host must specify its URL or TCP/IP. If there is just other GMNS host published
on the host 192.23.34.1 and port 15450, it would be needed to specify
(with GMNS.hosts=1):
GMNS.hostSocket.1=192.23.34.1:15450
|
N/A |
GMNS.collisionTimeout |
Defines the period (in milliseconds) to wait when 2 GMNS starting at the same time, discover
themselves mutually. In this case, one must wait this period while the another one completes its initialitation. |
2500 |
GMNS.trace |
Set to true to log GMNS traces. This value has no sense with the optimized libraries. |
false |
GMNS.traceCode |
Set to true to log GMNS code (every executed method is logged). This value has no sense with
the optimized libraries. |
false |
GMNS.traceExceptions |
Set to true to log GMNS exceptions. This value has no sense with the optimized libraries.
Note that Sensei handles most of the exceptions (those unrecoverable are shown anyway). This value
is still useful to track problems with some specific member. |
false |
GMNS.traceExceptionsDetailed |
Set to true to log GMNS exceptions with the full trace. This value has no sense with the
optimized libraries. |
false |
DOMAINS.trace |
Set to true to log DOMAINS traces. This value has no sense with the optimized libraries. |
false |
DOMAINS.traceCode |
Set to true to log DOMAINS code (every executed method is logged). This value has no sense with
the optimized libraries. |
false |
DOMAINS.traceExceptions |
Set to true to log DOMAINS exceptions. This value has no sense with the optimized libraries.
Note that Sensei handles most of the exceptions (those unrecoverable are shown anyway). This value
is still useful to track problems with some specific member. |
false |
DOMAINS.traceExceptionsDetailed |
Set to true to log DOMAINS exceptions with the full trace. This value has no sense with the
optimized libraries. |
false |
Showing the configuration (GUI)
Sensei is distributed with a GUI to show the configuration values, although is not possible to
edit them with this program. The class to be invoked is sensei.util.SenseiConf,
which admits as argument the file to show; if no arguments are specified, it shows the sensei properties
file found (by default, the file called Sensei.properties in the current directory, or in the user's home
directory or in Java's home directory), or, if not found, just the default values.
There is as well a script that can be invoked (it just calls the previous class):
Linux: senseiConf.sh [file]
Windows:senseiConf [file]
The GUI has an appearance like:
Logging (includes tracing)
To develop Sensei without debugging utilities would have been plain impossible. It is a distributed application
where the parts are in continuous communication. The better approach to debug errors, some times difficult to
reproduce, has been the logging of the code. With this purpose, every method contains at its beginning a line of
code to trace its execution. Obviosly, this approach imposes a big performance penalty, and this tracing is
removed on the optimized libraries.
In addition to this automatic code tracing, Sensei includes some tracing associated to the algorithm used, to
highlight in an easier way some important events.
Sensei is a project started in 2000, when the JDK 1.4 and its new logging functionality was still not ready.
It includes therefore some classes, located in the package sensei.util.logging to cover
this functionality.
These classes support two type of logging:
The logging server creates a different file for each Sensei process, with names senseiNNNNN.log. (this name can
be changed by the application been logged). All the files keep the same time origin, to be able to analyze them as a whole.
|