Coordinator
From XtremWebCH Wiki
Contents |
Description
It is a three-tier architecture which adds a middle tier between client and workers. There is no direct submission/result transfer between clients and workers. The coordinator accepts execution requests coming from clients, assigns the tasks to the workers according to a scheduling policy and the availability of data, transfers binary codes to workers (if necessary), supervises task execution on workers, detects worker crash/disconnection, re-launches tasks on any other available worker, and controls the transfer traffic on the network to ensure the balancing of bandwidth load.
The coordinator is composed of four services: the workers’ manager, the tasks’ manager, the scheduler and the communication manager.
The Workers’ Manager
The workers’ manager maintains a list of connected workers. It receives four types of common requests/signals from the workers: Register Request (RR), Work Request (WR), Work Alife signal (WA) and Work Result signal (WRS). The Register Request allows a worker to subscribe nearby the coordinator. When the Workers’ Manager receives a Work Request, it searches for the most appropriate task to be assigned to the concerned worker. During the execution of the task, the workers send WA signals to the coordinator to inform about their status. WA signals are considered, by the coordinator, as the “proof” that the workers are still “alive” (connected). When a worker finishes its execution, it sends a Work Result Signal to inform the coordinator about the location of the data it has produced.
The Tasks’ Manager
In XWCH, a parallel and distributed application is composed of a set of communicating tasks. A task is considered to be “ready” for execution if its input data are available (given by the user or produced by a previous task). A task is in “blocked” status if its input data are not yet available. Two lists are maintained by the Tasks’ Manager: blocked tasks and ready tasks. When receiving a Work Result Signal, the Tasks’ Manager checks whether the new available data correspond to input data awaited by one or several blocked tasks; it updates the lists of blocked and ready tasks accordingly.
The Scheduler
A Work Request transmits, as input parameter, the performance that can be delivered by the concerned worker. When receiving this request, the coordinator launches a scheduler module which selects the “most appropriate” ready task to allocate to that worker.
The Communication Manager
XWCH is supposed to be a Public Large Scale Distributed Platform. It is assumed to be deployed on a “public” network. In this context, the system should insure that the bandwidth provided by the network is not completely consumed by the traffic generated by XWCH: common requests, data transfers, etc. The data transmitted between two XWCH nodes (coordinators, workers, warehouses) are split into fixed size packets. A sleep time separates the transmission of two successive packets. This time depends on the load of the network as sensed by the coordinator: the higher the load the bigger the sleep time. Similarly, the number of competing WR and LS processed by the coordinator is fixed by the communication manager according to the workload of the network as sensed by the coordinator.
Installation of the XWCH coordinator
This section details the installation of the XtremWeb-CH Coordinator.
Only RedHat X and Fedora Core X distributions are supported.
For security reasons, We recommended to create a special account for the installation and execution of the Coordinator.
Installation of linux Fedora Core 5
When installing Fedora Core 5, you have to install the following packages:
- PHP
- MySQL
- PHP_MySQL
The following services must ne diabled:
- Firewall
- SELinux
httpd and mysqld services must be enabled. To check if these services are actived, type: system-config-services
Installation of JDK
Download the latest JDK form Sun Java site and install it. In Fedora/RedHat, the files should be installed in the following directory « /usr/java/jdk-1_5_0_X ».
Configuration of the xwch user’s environment
Please use the Sun Java VM and not the GnuJ VM.
Add these lines at the end of the .bashrc file or make a source file:
export JAVA_HOME=/usr/java/jdk1.5.0_07 export PATH=$JAVA_HOME/bin:$PATH export JDK_HOME=$JAVA_HOME/bin
You should change JAVA_HOME with your own Java JDK folder installation.
Installation of the Database
Download phpMyAdmin from « http://www.phpmyadmin.net » to manage easily the database via a web interface(facultative but recommended).
Create a new database (example : xwchdatabase).
Create a new user for the base and grant him all the privileges for this base.
Import the tables from the « xtremwebch.sql » file which is contained in the XtremWebCH installation directory (Installation SQL Scripts subfolder).
Installation and configuration of XtremWebCh
Download the installation file of the coordinator from « http://www.xtremwebch.net/ ». and copy it in your “/home” directory. It is recommended to create and use a new sub-directory. Example: /home/xwch.
Updating the configuration files
You should update the two files « config2.xml » and « xw.conf » located in the « /bin » sub-directory.
« config2.xml » file
<?xml version="1.0" encoding="UTF-8"?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="configfile.xsd">
<Basededonnee>
<Driver>org.gjt.mm.mysql.Driver</Driver>
<Location>jdbc:mysql:///</Location>
<Username>adminxwch</Username> //Name of the DB user previously created
<Password>pwadmin</Password> // Password of the DB user previously created
<Port>3306</Port>
<Table>xwchdatabase</Table> //Name of the DBpreviously created
</Basededonnee>
<XtremWeb>
<RepRoot>/home/xwch/xwch3/bindata/</RepRoot> //Need to be created in full r/w access
<TableWebDirIn>/tmp/fromweb/</TableWebDirIn> //Need to be created in full r/w access
<ModClientRepRoot>/tmp/modord/</ModClientRepRoot> //Need to be created in full r/w access
</XtremWeb>
<Loging>/home/eig/ordonancing/ch/log.properties</Loging>
<TimeSleep>800</TimeSleep>
<TempDir>/tmp/tmp/</TempDir> //Need to be created in full r/w access
<Rmi>
<HostIp>X.X.X.X</HostIp> // Dispatcher IP
<RmiName>rmiworkdata</RmiName>
<RmiPort>1099</RmiPort>
<RmiStubPort>1100</RmiStubPort>
</Rmi>
<PoolSize>40</PoolSize>
<FileRepositoryPort>8888</FileRepositoryPort> // same as XWFilePort in xw.conf below
</Configuration>
Folder Configurations
XtremWeb/RepRoot: Used to store pre-installed users binaries
XtremWeb/TableWebDirIn: Used to store temporarly binaries and data submitted via the web service utility
XtremWeb/ModClientRepRoot Used to store all data tasks to dispatch to workers
TempDir Temporary folder
Server Performance attributes
TimeSleep is the main Sleep Intervall Loop(in ms).
PoolSize is the pool size of new tasks to be inserted of each main loop.
« xw.conf » file
# Configuration file for the server # Configuring the database access XWdbVendor=mysql XWdbHost=localhost XWdbName=xwchdatabase //Name of the DB XWdbUser=adminxwch //Name of the DB user XWdbPass=pwadmin //Password of the DB user HomeDir=/home/xwch/xwch3/bindata/ //Path of the « /bindata/ » directory XWPort=xxxx // port used by the coordinator to receive RR, WR and WRS requests from workers XWServerName=A.B.C.D // IP address of the "coordinator" XWNBConnexionMax=5 // Maximum number of RR, WR and WRS accepted by the coordinator at the same time XWAlivePort=yyyy // port used by the coordinator to receive WA signals from workers XWAliveConnectionMax=5 // Maximum number of WA signals accepted by the coordinator at the same time TimeSecSleep=30 XWFilePort=zzzz // port used by the coordinator to send binary and data files to workers XWFileConnectionMax=8 XWFileFolder=/tmp/modord #XW Current Version XWVersion=1.3.12-head-2006 #THread Upload Limit UploadLimitThreadSleep=5
HomeDir has the same value as XtremWeb/RepRoot in config2.xml
XWPort is the main port of XtremWebCH coordinateor. This port is specified in the XW Worker configuration file: xwrc
XWServerName is the IP address of the XtremWebCH Coordinator. It should be specified in the XW Worker configuration file: xwrc
XWFileFolder has the same value as XtremWeb/ModClientRepRoot in the "config2.xml" file
Starting the coordinator
To start the XWCH coordinator, type the line below under the « /bin » directory:
sh go.sh
We recommand to use the "screen" package in order to launch and detach the coordinator.
