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.
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:
- Download the SOCI library (tested with 3.1.0 version)
- Build the SOCI library
- Modify the core/Makefile.basic: add -fPIC to CXXFLAGS
- Compile using "make -f Makefile.basic [shared]"
- Build the SOCI Oracle backend
- Modify the backends/oracle/Makefile.basic: adjust ORACLEINCLUDEDIR to your environment
- Compile using "make -f Makefile.basic shared"
- Download the Directory Server from CERN Repository
- 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
- 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).
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.
Additionaly the tables depend on different other database components like triggers and sequiences. The overview of those componets is presentet in the following figure.
All the components can be created using the attached sql script (create-all.sql).