Service Registry (Registrar) QuickStart
The Service Registry allows you to register running Mobius services with it, so that services can discover each other. For example, it is possible to use a Service Registry from inside the Mako and GME viewers to populate their lists of running collections and model exchange services. This ability is key to Grid computing. The Service Registry is a very basic service at present, however. It will be extended and improved in the future and we will be publishing guides to integrating Mobius with more robust service registry systems, such as The Globus Toolkit. Still, for basic discovery of Mobius services, the Service Registry is a viable tool.
There are two ways to use the Service Registry. You can either use the command line tools within the Service Registry to add running Mobius services to its repository. Or you can instantiate other Mobius services, such as the GME or Mako, so that they automatically register themselves with a running Service Registry. The latter procedure would be the one most commonly used in practice, but the former might be useful in cases in which a user wanted a means for aggregating a number already running, unregistered remote Mobius services for convenient discovery.
Minimal Configuration and Starting the Service Registry
If you have not already done so, install the Mobius software and its prerequisites.
As with other Mobius services, change to the /conf directory. Edit the
<MobiusNetworkServiceDescriptor ...> and change the "hostname" as appropriate.
Also assign the registry a "serviceId" in the <serviceIdentifier ... /> tag,
for example, REGISTRAR://localhost, and
put in the appropriate password for your MySQL database in the <password> tag pair.
From the /scripts directory:
./startRegistrar.bat ../conf/localhost-registrar-config.xml
Registering a Service Using Service Registry Command Line Utilities
Start a GME and a Mako. For this example, we have started them on the local machine.
Now let's register the GME and Mako:
./registerService.bat -ports TCP,3940 -host MAKO://localhost -registry REGISTRAR://localhost -type MAKO ./registerService.bat -ports TCP,1111 -host GME://localhost -registry REGISTRAR://localhost -type GME
If the Mako and GME were successfully registered. You'll see output like the following on the consoles where those services were started.
INFO - Nov 2, 2004 3:19:33 PM -- 1 Received a connection from REGISTRAR://localhost:2055 INFO - Nov 2, 2004 3:20:03 PM -- 2 Received a connection from REGISTRAR://localhost:2065 INFO - Nov 2, 2004 3:20:33 PM -- 3 Received a connection from REGISTRAR://localhost:2157
The Service Registry attempts to connect to its registered Mobius services every
30 seconds (by default, you can change the interval in the
config file's pingInterval element).
If it fails to contact a service after a number of attempts, the service's entry is dropped from
its database. You can see a list of registered services by executing the following command
from inside of the Service Registry /scripts directory:
./getServiceList.bat -registry REGISTRAR://localhost
will display information about the services added to the Service Registry and will show the automatically
generated valid service ids which can be used to contact the services through the Service Registry.
Registering a Service Automatically When Starting a Mako or GME
In this example, we will start a Mako so that it registers itself with a running GME and Service Registry.
Start a Service Registry and a GME on any hosts.
In the Mako /conf directory, edit the
localhost-mako-gme-registrar-config.xml file.
For the Mako, you will need to edit
the
<MobiusNetworkServiceDescriptor... > and
<serviceIdentifier... > tags, changing
the "hostname" and "serviceId" values, as appropriate.
For the Service Registry,
in the <xmlDataServiceFactory> element, edit
the "serviceId" value in the <serviceRegistry... > tag and the
"value" value in the <param name="registryServiceId"... /> parameter tag.
For the GME, in the
<dataModelServiceFactory> element edit the "value" value
in the <param name="registryServiceId"... /> parameter tag
and in the <gme-client-configuration> element, edit the
<gme serviceId=... /> value.
<password> for your MySQL database.
Start your Mako with:
./startMako.bat ../conf/localhost-mako-gme-registrar-config.xml
If everything went well, you will see output like the following:
INFO - Nov 4, 2004 3:13:07 PM -- Server started on MAKO://localhost at Thu Nov 04 15:13:07 EST 2004 INFO - Nov 4, 2004 3:13:07 PM -- Listening using the protocol TCP on the host 0.0.0.0, port 3940 INFO - Nov 4, 2004 3:13:07 PM -- Setting Service Identifier to MAKO://localhost INFO - Nov 4, 2004 3:13:22 PM -- 1 Received a connection from REGISTRAR://localhost:1059 INFO - Nov 4, 2004 3:13:52 PM -- 2 Received a connection from REGISTRAR://localhost:1074Notice the two lines showing a connection to the Mako from the Service Registry, confirming that that Mako registered itself upon instantiation.
The section immediately below describes contacting running Mobius services through the Service Registry.