CMW Directory Server

This section presets the Directory Server and shows how to build, configure and run it.

Overview

The CMW Directory Server is required to set up the CMW Framework. Its main function is to keep and provide relations between particular device names and technical addresses where they are running on. As known from other sections, actual CMW version is based on CORBA, i.e. to communicate with each other one of the parties require so called CORBA IOR, which basically is an URL-Based description of the service location. The Directory Server also keeps track on all CMW services and the according IORs. To accomplish this task the CMW Components are required to register (bind) themselves at the Server during the initialization and startup. This procedure is done in the constructor of the rdaDeviceServerBase class, and requires some correctly set environment variables (see section Run).

Directory Server also keeps track which devices are deployed on particular CWM Servers. JAPC framework in particular uses this information to set/get property values of a provided device. However, at the actual state this information is not propagated automatically, so in order to access device properties the name of the device must be registered in the database manually (see the script in the attachment). Note that FESA framework allows multiple devices running in a single Deploy Unit, i.e. CMW Server.

In absense of the database the Directory Service stores the IOR and the Service information on the local drive. However in this case no information about the runnig devices is available, so the JAPC framework will not run properly.

Directory Server Overview

Build

The Directory Server itself is currently written in Ada language. Compiling Ada may be done with the GNAT compiler provided with gcc. Following dependencies should also be considered in order to build the Directory Server:
  • SOCI library (incl. oracle binding)
  • Oracle drivers

How to build the Server:
  1. Download the SOCI library (tested with 3.1.0 version)
  2. Build the SOCI library
    • Modify the core/Makefile.basic: add -fPIC to CXXFLAGS
    • Compile using "make -f Makefile.basic [shared]"
  3. Build the SOCI Oracle backend
    • Modify the backends/oracle/Makefile.basic: adjust ORACLEINCLUDEDIR to your environment
    • Compile using "make -f Makefile.basic shared"
  4. Download the Directory Server from CERN Repository
  5. Modify the Makefile
    • Adjust MAKE_CONF and include .../Make.generic to your environment (both can also be downloaded from CERN Repository)
    • Add dependencies and include directories for oracle libraries (clntsh, nnzll), soci_core and soci_oracle
  6. Build the Directory Server
NOTE: In some cases (e.g. RadHat5) it is essential to modify the code of the server bevore compiling. Otherwise server crashes with a segfault after start. More information can be found in the attached file (Building DS).

Configure

The CWM Directory Server requires a plenty of configuration, backup and log files to operate. Although those files are created automatically, the folders for them must be present. Therefore the folder must be manually by the user before running the server. Here is the required structure (the path to files is hard coded):
  • ../conf
  • ../local-backup/pending-bindings
  • ../log
The conf folder must also contain a configuration file cmw-directory.dbaccess.properties containing the Database access configuration:
oracle://service=<servicename> user=<user> password=<password>

Run

To start the server simply execute (port number may differ).
cd <binary location>
./cmw-directory-server 5021

It may also be required to setup the LD_LIBRARY_PATH variable to point to the soci libraries.

Database

As known from above the CMW Directory Server requires a Database to locate CMW Services by the device name, but also to persist the IORs of the services. Currently GSI uses a snapshot of the FESA2 Database. The snapshot contain tables used by the Directory service (SERVICE_DIRECTORY and CMW_DEVICES) and FESA insert-script as well as their direct dependencies. The following figure shows the tables and their relations.

Database Tables

Additionaly the tables depend on different other database components like triggers and sequiences. The overview of those componets is presentet in the following figure.

DB Components

All the components can be created using the attached sql script (create-all.sql).
I Attachment Action Size Date Who Comment
5_Directory-Service.pptppt 5_Directory-Service.ppt manage 236 K 03 May 2013 - 15:08 VitaliyRapp Directory Service Presentation from CERN
BuildingDSEXT BuildingDS manage 2 K 03 May 2013 - 14:49 VitaliyRapp Building DS Manual
DB-Components.pngpng DB-Components.png manage 75 K 31 May 2013 - 11:40 VitaliyRapp Database Components
DB-Tables.pngpng DB-Tables.png manage 61 K 03 May 2013 - 14:50 VitaliyRapp Database Tables
DB.deliver.scriptscript DB.deliver.script manage 2 K 03 May 2013 - 10:11 VitaliyRapp Script to register a DeployUnit in the DB
DirServerComponents.pngpng DirServerComponents.png manage 76 K 03 May 2013 - 12:33 VitaliyRapp Communication Path of Directory Server
create-all.sqlsql create-all.sql manage 19 K 11 Jul 2013 - 09:44 VitaliyRapp DB script to create all necessary tables
Topic revision: r7 - 11 Jul 2013, VitaliyRapp
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback