Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

COSMOS UG Running the Example

Revision as of 11:51, 10 April 2008 by Sleeloy.ca.ibm.com (Talk | contribs) (Configurations)

COSMOS Wiki > COSMOS Document Plan > COSMOS Manual Guide

COSMOS User's Guide Running the Example section

Category: User's Guide

Owner Hubert Leung
Bug # 219120
Due dates Schedule

Outline

Objective of the Demo

Installation

Download COSMOS Demo and Prerequisites

This section provides instructions for installing and running the demo program that is provided in the COSMOS i9 build.

  1. Install Tomcat 5.5.25. The directory where the Tomcat server is installed will be referred to as the <tomcat_install_dir> in this document.
  2. From the COSMOS download page, click on the link of the release candidate build for version 1.0. Download the zip file under the "COSMOS Demo" section.
  3. Unzip the demo zip file to a directory. You will see a directory called "cosmos-demo". This directory will be referred to as <cosmos-demo> in this document.
  4. Copy all directories under <cosmos-demo>\webapps to <tomcat_install_dir>\webapps.

Configurations

  • At a Windows command prompt, enter <cosmos-demo>\bin.
  • Run configDemo.bat to update some configuration files according to your system environment.
  • The configDemo program assumes:
    • You have copied the cosmos directory to the webapps directory in Tomcat by following the instructions in the previous section.
    • Your <cosmos-demo> directory and the tomcat installation are on the same host.
  • The program will prompt you for some input. You will see something like the following in a successful execution of the config program.
This program will configure some environment variables for the COSMOS demo to run. 
We assume that the Tomcat server and the directory where you unzipped the demo program are on the same computer.
Apache Tomcat install directory: D:\Program Files\apache-tomcat-5.5.25
Hostname of the Tomcat server (e.g. www.eclipse.org): mydomain.com
Tomcat port number: 8080
COSMOS Demo install directory: D:\cosmos\i9\cosmos-demo
Set management domain EPR for broker successfully.
Set management domain EPR for Example MDR successfully.
Set management domain EPR for SML MDR successfully.
Set management domain EPR for logging data manager successfully.
Set CBEData.dir for logging data manager successfully.
Set management domain EPR for stat data manager successfully.
Set derby.system.home for statistical data manager successfully.
Updated SML MDR config file successfully.

Configurations Web Console

Running the Program

Starting COSMOS components

After you have configured the program by following instructions in the previous section, start Tomcat by running <tomcat_install_dir>/bin/startup.bat. By starting the web server, the management domain, broker, data managers, reporting and user interface will be started. The broker and data managers will be registered with the management domain and the broker respectively automatically on start up. This activity may take a few seconds and you can monitor it by viewing the tomcat console.

Note: You need to set JRE_HOME or JAVA_HOME before running startup.bat.

After the COSMOS components have successfully started, you can use the COSMOS command line demo application and/or the COSMOS UI to interact with the COSMOS components.

Query for Brokers Registered at the Management Domain

  • Execute <cosmos-demo>\bin\domainEPR.bat. This program will ask you for your hostname and port number of the Tomcat server, and prints out the EPR (Endpoint Reference) of the management domain; this reference is expressed in XML format. Copy the EPR of the management domain to a scratch editor window, such as in Notepad. You will use it later.
  • If COSMOS command line client has not started, execute <cosmos-demo>\cosmos-client\cosmosClient.bat.
  • Get a list of brokers at the management domain with the "domain getBrokers" command:
COSMOS> domain getBrokers 
Management Domain EPR (terminate by an empty line): 
<?xml version="1.0" encoding="UTF-8"?> 
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing"> 
    <wsa:Address>http://localhost:8080/cosmos/services/domain</wsa:Address> 
</wsa:EndpointReference> 

EPR of brokers: 
Broker 1: 
<?xml version="1.0" encoding="UTF-8"?> 
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing"> 
    <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing"/> 
    <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:8080/cosmos/services/broker</wsa:Address> 
</wsa:EndpointReference> 

Query for Data Managers Registered at the Broker

  • At the COSMOS prompt, type "broker getDataManagers". When prompted for the broker EPR, paste in the broker EPR that you got from the previous step. You will get a list of EPRs of data managers registered at the broker.
COSMOS> broker getDataManagers
Broker EPR (terminate by an empty line):
<?xml version="1.0" encoding="UTF-8"?>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing"/>
    <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://___:8080/cosmos/services/broker</wsa:Address>
</wsa:EndpointReference>

EPR of data mangers:
Data Manager 1:
<?xml version="1.0" encoding="UTF-8"?>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://____:8080/stat/services/org.eclipse.cosmos.dc.stat.datamgr.StatisticalDataManager</wsa:Address>
    <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">StatDataManager</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>
Data Manager 2:
<?xml version="1.0" encoding="UTF-8"?>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://____:8080/smlmdr/services/org.eclipse.cosmos.rm.sml.mdr.impl.SmlRepositoryMdr</wsa:Address>
    <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">SML_REPO_ID</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>
Data Manager 3:
<?xml version="1.0" encoding="UTF-8"?>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://____:8080/examplemdr/services/org.eclipse.cosmos.example.mdr.ExampleMdr</wsa:Address>
    <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>
Data Manager 4:
<?xml version="1.0" encoding="UTF-8"?>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://____:8080/logging/services/org.eclipse.cosmos.dc.logging.datamgr.LoggingDataManager</wsa:Address>
    <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">LoggingDataManager</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>

Executing CMDBf Queries

Using a command line client

  • We can execute CMDBf queries using the command line client.
  • At the COSMOS prompt, type "smlmdr query" followed by the path to the query file to run a query against the SML MDR. If you are querying the Example MDR, the command is instead "examplemdr".
  • The query files for the SML MDR are located in <cosmos-demo>\cosmos-client\cmdbf-queries\SMLMDR.
  • The query files for the Example MDR are located in <cosmos-demo>\cosmos-client\cmdbf-queries\ExampleMDR.
  • When prompted for the EPR for the SML MDR or the Example MDR, you can copy the EPR from the output of the "broker getDataManagers" command you did in the previous section.
COSMOS> smlmdr query _______\cosmos-demo\cosmos-client\cmdbf-queries\SMLMDR\testInstanceIdQuery.txt
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://____:8080/cosmos/services/org.eclipse.cosmos.rm.sml.mdr.impl.SmlRepositoryMdr</wsa:Address>
    <wsa:ReferenceParameters>
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">SML_REPO_ID</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>

Query response:
<?xml version="1.0" encoding="UTF-8"?><dyn:queryResponseType xmlns:dyn="http://www.eclipse.org/cosmos/mdrquery">
        <dyn:queryResponseType xmlns="http://cmdbf.org/schema/1-0-0/datamodel">
                <nodes templateId="cableTemplate">
........ Content omitted .........
                </nodes>
            </dyn:queryResponseType>
        </dyn:queryResponseType>
  • You can invoke queries on the Example MDR using the command line client.
COSMOS> examplemdr query _______\cosmos-demo\cosmos-client\cmdbf-queries\ExampleMDR\all-students.txt
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://_____:8080/examplemdr/services/org.eclipse.cosmos.example.mdr.ExampleMdr</wsa:Address>
    <wsa:ReferenceParameters>
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>

Query response:
<?xml version="1.0" encoding="UTF-8"?><dyn:queryResponseType xmlns:dyn="http://www.eclipse.org/cosmos/mdrquery">
            <dyn:queryResponseType xmlns="http://cmdbf.org/schema/1-0-0/datamodel">
                <nodes templateId="items">
........ Content omitted .........
                </nodes>
            </dyn:queryResponseType>
        </dyn:queryResponseType>

Using the COSMOS Web User Interface

Register Configuration Items with a Federating CMDB

Querying the Federating CMDB

Collect Log Events from the Logging Data Manager

Using a command line client

Using the COSMOS Web User Interface

Collect webserver performance data from the statistical data manager

Using a command line client

Using the COSMOS Web User Interface

Back to the top