Enabling Grids for Escienc E Configuration service instrumentation
Enabling Grids for E-scienc. E Configuration, service instrumentation & service management Joachim Flammer on behalf of the JRA 1 Integration team Joachim Flammer Service Management
Overview Enabling Grids for E-scienc. E • • Comments Requirements Service interactions Common issues Implementation scenarios DM JMX example Discussion points Joachim Flammer Service Management 2
A few comments to start … Enabling Grids for E-scienc. E • Timeline – Discussion in the area of configuration an service management is going on for several months already – If we want to have something in g. Lite 1. x we don’t have much time left • Framework – So far discussion concentrated much on configuration, dynamic configuration, … – … however the scope is much wider and is about proper service management and instrumentation • Priorities – In our opinion a proper working service management is a key corner stone of g. Lite – It will up to the project to decide for the priorities – Discussion started in PTF … – … but we need to have a proposal ready Joachim Flammer Service Management 3
Requirements Enabling Grids for E-scienc. E • Do we need service instrumentation ? • There has been a lot of discussion … … clear project made statement about the requirement – – JRA 1 / SA 1 presentation in Athens Discussions with SA 1 Discussions with user community PTF Requirements Database Joachim Flammer Service Management 4
PTF Requirements Database Enabling Grids for E-scienc. E • Many entries related to configuration / management / logging & error handling • Entries are coming from different sides (SA 1, applications, …) • Some examples: – 100724 Grid services should have an administrative interface for: • monitoring • creating alarms • taking out sites/services by grid operation center etc. . . They should have common, extensible, set of APIs – 100727 All grid services must be able to use standardized interface for error and log messages and files. Log level has to be adaptable for e. g. different level of debugging. Minimal level has to guarantee audit trails. – 100726 Grid services must enable the measurement of quantities relevant to the verification of service level agreements (SLA) Joachim Flammer Service Management 5
Service interactions types Enabling Grids for E-scienc. E Two types of interactions: • Service interacts with system – Configuration – Logging • Manager/Information system interacts with – service getting service information (version number, uptime, …) operations on service (start, stop, clear, …) event notification (errors, full disks, …. ) – container – system Joachim Flammer Service Management 6
Service interaction with System Enabling Grids for E-scienc. E • Configuration – reading/writing of configuration • Logging – common logging format – logging to different destinations • Saving of system state – recovery after shutdown Joachim Flammer Service Management 7
Service Information Enabling Grids for E-scienc. E • State – deployed, started, stopped – Status: running/not running • Relationships – Dependencies (e. g. needs service A, B, C) – Replacement services (is duplicate of service D, E) • Generic information – Name – Version – Package signature – Interface version • Configuration – Values – Last updates Joachim Flammer • Timing – uptime – present time • Service performance metrics – Last processing time – Longest processing time • Logging – Log information – Number of errors • Service specific internal information – Number of used DB connections – Number of requests • Available services in container / node Service Management 8
Service operation Enabling Grids for E-scienc. E • Status operation – start, stop, pause • Internal operations – pinging – Different kind of service specific operations cleanup connections reset redirect log information add user …. Joachim Flammer Service Management 9
Service events Enabling Grids for E-scienc. E • Service wants to inform about special events – Service started, stopped, …. – Fatal error occurred – Internal problems disk running full performance low need more coffee …. Joachim Flammer Service Management 10
The challenge … Enabling Grids for E-scienc. E • Heterogeneous system • Several information sources – service – Web services – container C++ – node Java • Standard outside communication – Daemons – standard outside SOAP interface: CIM, WBEM, WSDM, …. • Common service management – self descriptive interfaces – basic common set for all services • Separate management from business logic – can be extended by an individual – service users are interested in service • Reuse existing capabilities – minimize impact on services – e. g. start/stop Joachim Flammer service API – management application are interested in management API – separate WSDL interfaces Service Management 11
Implementation scenario Enabling Grids for E-scienc. E • We foresee a two-fold structure – one global management service per node gateway to the outside management collects information from different sources • Service(s) • Container(s) • System directs commands to different destinations • Service(s) • Container(s) • System – service specific parts in each service Provides common functionality • Loading of configuration • Interface to management service Joachim Flammer Service Management 12
Implementation scenario Enabling Grids for E-scienc. E g. Lite management application Information system WBEM/CIM/WSDM via SOAP Service A service logic Service B g. Lite Service Manager JMX g. Lite Service service logic container logic Tomcat SOAP g. Lite Service ? SOAP ? configuration log files Node system logic Joachim Flammer Service Management 13
Implementation scenario Enabling Grids for E-scienc. E • Implementation scenarios – Central g. Lite Service Manager Java web service Implemented in Tomcat JMX for internal management Combining different sources/destinations Outside connectors: WBEM / CIM / WSDM via SOAP … – g. Lite service Java web service • inside tomcat • Use JMX for communication central g. Lite Service Manager C++ web service • (extended) Service. Configurator for communication with central g. Lite Service Manager, e. g. via SOAP Daemons • Remote/Local calls for communication with central g. Lite Service Manager Joachim Flammer Service Management 14
g. Lite. Service - configuration Enabling Grids for E-scienc. E • Example for g. Lite. Service – Managing configuration Load from central place Handling of complex data type Enable querying of configuration from outside – Example service: Datamanagement Fireman My. SQL catalog (org. glite. data. catalog-service-fr-mysql) Java webservice inside tomcat Uses JDBC pool connection to My. SQL Sets up the JDBC connection via JNDI Uses two classes • Service class org. glite. data. catalog. service. composite. Fireman. Catalog. Soap. Binding. Impl • DB connection class org. glite. data. common. helpers. DBManager Joachim Flammer Service Management 15
Implementation scenario Enabling Grids for E-scienc. E Web browser HTTP adapter JMX g. Lite Manager Configuration g. Lite MBean Service service logic SOAP JMX server Fireman Service Tomcat configuration log files Joachim Flammer Service Management 16
Example configuration file Enabling Grids for E-scienc. E <config> <parameters> <test. value description=“This is a test value. ” value=“Hello. World” type=“string”/> … </parameters> <container name=“egee_db” description=“EGEE Metadata Database JNDI Data. Source” type=“org. apache. commons. dbcp. Basic. Data. Source ” jndi. reference. name=“jdbc”> <parameters> <username description=“The connection username. ” jmx. readable=“true” jmx. writeable=“false” type=“string” value=“egee”/> <driver. Class. Name description=“The fully qualified Java class name of the JDBC driver. ” jmx. readable=“true” jmx. writeable=“false” type=“string” value=“org. gjt. mm. mysql. Driver”/> … </parameters> </container> </config> Joachim Flammer Service Management 17
Turning on the central configuration Enabling Grids for E-scienc. E Step 1: Turn on the central configuration Implement the Glite. Service class specifying your service name to – loads configuration from central location here: /opt/glite/etc/config/glite-SERVICENAME. cfg. xml – makes configuration information available to central JMX server Data Management service Joachim Flammer Service Management 18
Turning on the central configuration Enabling Grids for E-scienc. E . . . public class Fireman. Catalog. Soap. Binding. Impl extends Service. Impl implements Fireman. Catalog { private DBManager fireman. DBmanager = null; . . . public Fireman. Catalog. Soap. Binding. Impl(){ super(); try{ fireman. DBmanager = new DBManager(“jdbc/egee_db”); } } catch (DBException e){. . . } }. . . } Joachim Flammer Service Management 19
Turning on the central configuration Enabling Grids for E-scienc. E import org. glite. management. service. Glite. Service; . . . public class Fireman. Catalog. Soap. Binding. Impl extends Service. Impl implements Fireman. Catalog { private DBManager fireman. DBmanager = null; private Glite. Service g. Lite. Service; private String service. Name = “catalog-service-fr-mysql”; . . . public Fireman. Catalog. Soap. Binding. Impl(){ super(); g. Lite. Service = Glite. Service. instance(service. Name); try{ fireman. DBmanager = new DBManager(“jdbc/egee_db”); // fireman. DBmanager = new DBManager(“egee_db”, service. Name); // fireman. DBmanager = new DBManager(“egee_db”, g. Lite. Service); } } catch (DBException e){. . . } }. . . } Joachim Flammer Service Management 20
Getting the configuration Enabling Grids for E-scienc. E Step 2: Getting the configuration information There are three possibilities 1. via JNDI 2. via JMX 3. via Glite. Service Joachim Flammer Service Management 21
Getting the configuration: via JNDI Enabling Grids for E-scienc. E public class DBManager { protected final String m_db_pool_name; protected final Data. Source m_data. Source; public DBManager(String pool) throws DBException { try { m_db_pool_name = pool; Context init. Ctx = new Initial. Context(); Context env. Ctx = (Context) init. Ctx. lookup("java: comp/env"); m_data. Source = (Data. Source) env. Ctx. lookup(m_db_pool_name); } catch (Naming. Exception e) {. . . } } Joachim Flammer Service Management 22
Getting the configuration: via JNDI Enabling Grids for E-scienc. E public class DBManager { protected final String m_db_pool_name; protected final Data. Source m_data. Source; public DBManager(String pool) throws DBException { try { m_db_pool_name = pool; Context init. Ctx = new Initial. Context(); // Context env. Ctx = (Context) init. Ctx. lookup("java: comp/env"); Context env. Ctx = (Context) init. Ctx. lookup("glite"); m_data. Source = (Data. Source) env. Ctx. lookup(m_db_pool_name); } catch (Naming. Exception e) {. . . } } Joachim Flammer Service Management 23
Getting the configuration: via JNDI Enabling Grids for E-scienc. E • Necessary adoptions: – Change of JNDI path • Advantages – – – • Only need to change JNDI path Easy to change in between g. Lite & non-g. Lite system Can use JNDI features: notification, … Dynamic configuration possible if supported by application Independent of central JMX server Disadvantages – Duplication of efforts JMX for central & remote management JNDI for application Joachim Flammer Service Management 24
Getting the configuration: via Glite. Service Enabling Grids for E-scienc. E public class DBManager { protected final String m_db_pool_name; protected final Data. Source m_data. Source; public DBManager(String pool) throws DBException { try { m_db_pool_name = pool; Context init. Ctx = new Initial. Context(); Context env. Ctx = (Context) init. Ctx. lookup("java: comp/env"); m_data. Source = (Data. Source) env. Ctx. lookup(m_db_pool_name); } catch (Exception e) {. . . } } Joachim Flammer Service Management 25
Getting the configuration: via Glite. Service Enabling Grids for E-scienc. E import org. glite. management. service. Glite. Service; public class DBManager { protected final String m_db_pool_name; protected final Data. Source m_data. Source; //public DBManager(String pool) throws DBException { public DBManager(String pool, Glite. Service glite. Service) throws DBException { try { m_db_pool_name = pool; // Context init. Ctx = new Initial. Context(); // Context env. Ctx = (Context) init. Ctx. lookup("java: comp/env"); // m_data. Source = (Data. Source) env. Ctx. lookup(m_db_pool_name); m_data. Source = (Data. Source) glite. Service. get. Configuration. Parameter(m_db_pool_name); } catch (Exception e) {. . . } } Joachim Flammer Service Management 26
Getting the configuration: via Glite. Service Enabling Grids for E-scienc. E • Necessary adoptions: – Change JNDI lookup by Glite. Service function call – Pass Glite. Service to classes that use configuration • Advantages – Easy retrieval of values – Dynamic configuration possible if supported by application – Independent of central JMX server • Disadvantages – Extra features (e. g. notification) need to be implemented by hand – Duplication of efforts (JMX for central, JNDI for application) Joachim Flammer Service Management 27
Getting the configuration: via JMX Enabling Grids for E-scienc. E import javax. management. *; public class DBManager { private MBean. Server mbs; public DBManager(String pool, String service. Name) throws DBException { m_db_pool_name = pool; try{ List srv. List = MBean. Server. Factory. find. MBean. Server(null); List. Iterator srv. List. Itr = srv. List. list. Iterator(); while(srv. List. Itr. has. Next()) { MBean. Server local. Mbs = (MBean. Server) srv. List. Itr. next(); if (local. Mbs. get. Default. Domain(). compare. To("glite") == 0) mbs = local. Mbs; } Object. Name object. Name = new Object. Name(service. Name + configuration. Sub. MBean. Path); m_data. Source = (Data. Source) mbs. get. Attribute(object. Name, m_db_pool_name); } catch (Exception e){ Joachim Flammer Service Management 28
Getting the configuration: via JMX Enabling Grids for E-scienc. E • Changes: – Lookup of central MBean server – Lookup of MBean instead of JNDI Object • Advantages – Fully integrated solution central management and local configuration coupled – Standard management solution – Dynamic configuration possible – Can use all JMX features (notification, old/new value. . ) • Disadvantages – Depends on central JMX server Joachim Flammer Service Management 29
Discussions points Enabling Grids for E-scienc. E • • • Feedback – Comments – Ideas Requirements from your side – What do you want to see in the management interface? – What requirements do you have? – Priorities? What do you want to see first? Discussion on implementation possibilities – Architecture – Implement Glite. Service as Parent class Add-on class • • – JNDI / Glite. Service / JMX C++ configurator – News – Feedback (Eli, …) JMX studies – News – Feedback (Paolo, …) Joachim Flammer Service Management 30
- Slides: 30