5. Usage¶
This chapter explains how to run Cloud Discovery Service either from the distributed command-line executable or as a library within your application.
5.1. Command-Line Executable¶
Cloud Discovery Service runs as a separate application. The script to run the executable is in
<NDDSHOME>/bin
.
rticlouddiscoveryservice [options]
This section explains how to run Cloud Discovery Service from a command-line tool. In particular, it describes:
Starting Cloud Discovery Service (Section 5.1.1).
Stopping Cloud Discovery Service (Section 5.1.2).
Command-line Options (Section 5.1.3).
5.1.1. Starting Cloud Discovery Service¶
Cloud Discovery Service runs as a separate application. The script to run the
executable is in <NDDSHOME>/bin
.
rticlouddiscoveryservice [options]
To start Cloud Discovery Service with a default configuration, enter:
$NDDSHOME/bin/rticlouddiscoveryservice
This command will run Cloud Discovery Service indefinitely until you stop it. See Section 5.1.2.
Note
Cloud Discovery Service is pre-loaded with a builtin configuration that has default settings. See Section 6.3.
Table 5.1 describes the command-line parameters.
5.1.2. Stopping Cloud Discovery Service¶
To stop Cloud Discovery Service, press Ctrl-c. Cloud Discovery Service will perform a clean shutdown.
5.1.3. Command-Line Options¶
The following table describes all the command-line parameters available in
Cloud Discovery Service. To list the available commands, run
rticlouddiscoveryservice -h
.
Parameter |
Description |
---|---|
|
Subset of domain IDs where Cloud Discovery Service operates. |
|
Assigns a name to the execution of the Cloud Discovery Service. |
|
Path to the configuration file. |
|
Name of the Cloud Discovery Service configuration to be loaded. |
|
Subset of domain IDs ignored by Cloud Discovery Service. |
|
Output directory where the heap monitoring snapshots are dumped. |
|
Period at which heap monitoring snapshots are dumped.
Enables heap monitoring if > 0. |
|
Prints this help and exits. |
|
Loads the configuration even if the XSD validation fails. |
|
Prints the available configurations and exits. |
|
A mask to configure the format of the log messages for both the service and DDS. It allows the following values:
Default: DEFAULT |
|
Maximum number of thread-specific objects that can be created. |
|
Enables remote administration and sets the domain ID for communication. |
|
Enables remote monitoring and sets the domain ID for status publication. |
|
Number of seconds the Cloud Discovery Service runs before it
stops. |
|
A comma separated list of transport resources, where each resource is
specified in the form: |
|
Specifies the license file path to be used. See How to use a License File with RTI Services. Default: Empty string |
|
Controls what type of messages are logged.
Default: |
|
Prints the Cloud Discovery Service version and exits. |
All the command-line options are optional; if specified, they override the values of their corresponding settings in the loaded XML configuration. See Section 6 for the set of XML elements that can be overriden with command-line options.
5.2. Cloud Discovery Service as a Library¶
Cloud Discovery Service can be deployed as a library linked into your application on selected architectures (see Section 14). This allows you to create, configure, and start Cloud Discovery Service instances from your application.
To build your application, add the dependency with the Cloud Discovery Service library under
<NDDSHOME>/lib/<ARCHITECTURE>
, where <ARCHITECTURE>
is a valid and
installed target architecture.
Here is an example of using Cloud Discovery Service as a library with the Service API:
struct RTI_CDS_Property property =
RTI_CDS_Property_INITIALIZER;
struct RTI_CDS_Service *service = NULL;
/* Initialize property */
property.cfg_file = "my_cds_service_cfg.xml";
property.service_name = "my_cds_service";
...
service = RTI_CDS_Service_new(&property);
if(service == NULL) {
/* Log error */
...
}
if(!RTI_CDS_Service_start(service)) {
/* Log error */
...
}
while(keep_running) {
sleep();
...
}
...
RTI_CDS_Service_delete(service);
using namespace rti::cds;
CloudDiscoveryService service(
ServiceProperty()
.cfg_file("my_cds_service_cfg.xml")
.service_name("my_cds_service"));
service.start();
5.3. Operating System Daemon¶
See generic instructions in How to Run as an Operating System Daemon.