Deployment and run modes
From JPPF 3.3 Documentation
|
Main Page > Deployment and run modes |
1 JPPF Driver
First you will need to obtain the driver package from the JPPF download page : JPPF-x.y.z-driver.zip.
Unzip the file JPPF-x.y.z-driver.zip in a location where you intend to run the JPPF server from.
This zip file contains all the binaries for running the server only.
To run the driver: go to the JPPF-x.y.z-driver folder and type “ant run”.
1.1 JPPF Driver as a Windows Service
A JPPF driver can be run as Windows Service using the Java Service Wrapper available at Tanuki Software.
The JPPF-x.y.z-driver.zip distribution and above are prepared for this installation.
To install:
- download the Java Service Wrapper for your platform and copy the files wrapper.exe, wrapper.dll and wrapper.jar to the JPPF driver install directory
- edit config/wrapper-driver.conf file, check that the setting for wrapper.java.command is valid (either the PATH environment must contain a Java 5 JRE, or the installation directory must be entered here)
- run the InstallDriverService.bat file to install the JPPF node service
- run the UninstallDriverService.bat file to uninstall the JPPF node service
1.2 JPPF Driver as a Linux/Unix daemon
The JPPF driver can be run as a Linux/Unix daemon using the Java Service Wrapper available at Tanuki Software.
The JPPF-x.y.z-driver.zip distribution and above are prepared for this installation.
To install:
- download the Java Service Wrapper for your platform and copy the files wrapper, libwrapper.so and wrapper.jar to the JPPF node install directory
- don't forget to set the executable bit for the JPPFDriver and wrapper script/executable
- edit config/wrapper-driver.conf file, check that the setting for wrapper.java.command is valid (either the PATH environment must contain a Java 5 JRE, or the installation directory must be entered here)
- open a terminal in the JPPF driver root install directory
- to run the driver as a daemon: ./JPPFDriver start
- to stop the driver: ./JPPFDriver stop
- to restart the driver: ./JPPFDriver restart
2 JPPF Node
First you will need to obtain the node package from the JPPF download page : JPPF-x.y.z-node.zip.
Unzip the file JPPF-x.y.z-node.zip in a location where you intend to run a JPPF node on.
This zip file contains all the binaries for running a node only.
To run the node: go to the JPPF-x.y.z-node folder and type “ant run”.
2.1 JPPF Node as a Windows Service
The JPPF node can be run as Windows Service using the Java Service Wrapper available at http://wrapper.tanukisoftware.org/. The JPPF-x.y.z-node.zip distribution and above are prepared for this installation.
To install:
- download the Java Service Wrapper for your platform and copy the files wrapper.exe, wrapper.dll and wrapper.jar to the JPPF node install directory
- edit config/wrapper-node.conf file, check that the setting for wrapper.java.command is valid (either the PATH environment must contain a Java 5 JRE, or the installation directory must be entered here)
- run the InstallNodeService.bat file to install the JPPF node service
- run the UninstallNodeService.bat file to uninstall the JPPF node service
2.2 JPPF Node as a Linux/Unix daemon
The JPPF node can be run as a Linux/Unix daemon using the Java Service Wrapper available at Tanuki Software.
The JPPF-x.y.z-node.zip distribution and above are prepared for this installation.
To install:
- download the Java Service Wrapper for your platform and copy the files wrapper, libwrapper.so and wrapper.jar to the JPPF node install directory
- don't forget to set the executable bit for the JPPFNode and wrapper script/executable
- edit the config/wrapper-node.conf file, check that the setting for wrapper.java.command is valid (either the PATH environment must contain a Java 5 JRE, or the installation directory must be entered here)
- open a terminal in the JPPF node root install directory
- to run the node as a daemon: ./JPPFNode start
- to stop the node: ./JPPFNode stop
- to restart the node: ./JPPFNode restart
2.3 JPPF Node in “Idle Host” mode
A node can be configured to run only when its host is considered idle, i.e. when no keyboard or mouse activity has occurred for a specified time. This requires additional libraries that must be downloaded separately due to licensing compatibility concerns, and used to compile and build a node add-on. Fortunately, we have automated the download and build process, to lae it as easy as possible.
To install and configure a node in idle mode:
- download the JPPF samples pack
- unzip the JPPF-x.y.z-samples-pack.zip anywhere on your file system
- open a command prompt or shell console in JPPF-x.y.z-samples-pack/IdleSystem
- run the build script: “ant jar”, or simply “ant”. This will download 2 jar files “jna.jar” and “platform.jar” and create a third one “IdleSystem.jar”, into the IdleSystem/lib directory.
- when this is done, copy the 3 jar files IdleSystem/lib into your node's library directory “JPPF-x.y.z-node/lib”
- to configure the node to run in idle mode, open the file “JPPF-x.y.z-node/config/jppf-node.properties” in a text editor and create or edit the following properties:
- jppf.idle.mode.enabled = true to enable the idle mode
- jppf.idle.timeout = 6000 to configure the time of keyboard and mouse inactivity before considering the node idle, expressed in milliseconds
- jppf.idle.poll.interval = 1000 to configure how often the node will check for inactivity, in milliseconds
- jppf.idle.detector.factory = org.jppf.example.idlesystem.IdleTimeDetectorFactoryImpl please do not change this!
- when this is all done, you can start the node and it will only run when the system has been idle for the configured time, and will stop as soon as any keyboard or mouse input occurs
3 Running JPPF on Amazon's EC2
3.1 Server discovery
EC2 does not allow multicast network communication, so JPPF nodes must know which server to use ahead of time instead of using the auto-discovery feature. So the server property file must set:
jppf.discovery.enabled = false jppf.peer.discovery.enabled = false
And the node property file must set:
jppf.discovery.enabled = false jppf.server.host = IP_or_DNS_hostname
Similarly the client must set:
jppf.discovery.enabled = false jppf.drivers = driverA driverA.jppf.server.host = IP_or_DNS_hostname driverA.jppf.server.port = 11111
Amazon charges for network access to a public IP, so you'll want the node to communicate with the internal 10.x.x.x address and not a public IP. More on this detail below...
3.2 Firewall configuration
EC2 puts all nodes into “security groups” that define allowed network access. Make sure to start JPPF servers with a special security group that allows access to the standard port 11111 and if you use the management tools remotely, 11198. You may also want to limit these to internal IPs 10.0.0.0/8 if your clients, servers and nodes are all within EC2.
3.3 Instance type
EC2 nodes vary the number of available cores, so you may want a different node property file for each instance type you start, with an appropriate number of threads. For instance, on a c1.xlarge instance with 8 cores, you might want to have one additional thread so the CPU would be busy if any one thread was waiting on I/O:
processing.threads = 9
If your tasks require more I/O, you may need to experiment to find the best completion rate.
3.4 IP Addresses
All EC2 instances will have both a public IP address (chosen randomly or your selected elastic IP), and a private internal IP 10.x.x.x. You are charged for traffic between availability zones regardless of address, and even within the same zone if you use the external IP. So you'll want to try to have the systems connect using the 10.x.x.x addresses.
Unfortunately, this complicates things a bit. Ideally you probably want to set up a pre-configured node image (AMI) and launch instances from that image as needed for your JPPF tasks. But you may not know the internal IP of the driver at the time. And you don't want to spend time creating a new AMI each time you launch a new task with a new driver.
One solution is to use a static elastic IP that you will always associate with the JPPF driver and eat the cost of EC2 traffic. It isn't that much really...
Or you can use DNS to publish your 10.x.x.x IP address for the driver before launching nodes, and configure the node AMI to use a fixed DNS hostname.
Or you can do a little programming with the EC2 API to pass the information around. This is the recommended approach. To this effect, JPPF provides a configuration hook, which will allow a node to read its configuration from a source other than a static and local configuration file. The node configuration plugin can read a properties file from S3 instead of a file already on the node. A matching startup task on the driver instance would publish an appropriate properties file to S3. There are lots of other approaches that will give you the same results – just have the server publish its location to some known location and have the node read this and dynamically create its properties instead of having a fixed file.
4 Runtime dependencies
4.1 Node and Common dependencies
These libraries are those used by the JPPF nodes as well as by all other JPPF components. For greater clarity, they are not shown in the next sections, however they should always be added to the JPPF components' classpath.
Library name | Jar Files | Comments |
SLF4J | slf4j-api-1.6.1.jar slf4j-log4j12-1.6.1.jar |
Logging wrapper API with Log4j bindings |
Log4j | log4j-1.2.15.jar | Logging implementation |
JMXMP | jmxremote_optional.jar | JMX remote connector |
JPPF node | jppf-common-node.jar | Node bootstraping API and common JPPF APIs |
4.2 Driver dependencies
Library name | Jar Files | Comments |
JPPF common | jppf-common.jar | Common JPPF APIs not needed to bootstrap a node |
JPPF server | jppf-server.jar | Driver-specific code |
4.3 Client dependencies
Library name | Jar Files | Comments |
JPPF common | jppf-common.jar | Common JPPF APIs not needed to bootstrap a node |
JPPF client | jppf-client.jar | Client-specific code |
4.4 Administration console dependencies
Library name | Jar Files | Comments |
JPPF common | jppf-common.jar | Common JPPF APIs not needed to bootstrap a node |
JPPF client | jppf-client.jar | Client-specific code |
JPPF admin | jppf-admin.jar | Administration console-specific code |
Rhino | js.jar | Mozilla's JavaScript APIs and engine |
Groovy | groovy-all-1.6.5.jar | Groovy scripting engine and APIs |
MigLayout | miglayout-3.7-swing.jar | Swing layout library |
JFreeChart | jfreechart-1.0.12.jar jcommon-1.0.15.jar |
Charting components for Swing GUIs |
JGoodies Looks | looks-2.2.2.jar | Swing look and feel |
JUNG | jung-algorithms-2.0.1.jar jung-api-2.0.1.jar jung-graph-impl-2.0.1.jar jung-visualization-2.0.1.jar collections-generic-4.01.jar colt-1.2.0.jar concurrent-1.3.4.jar |
Graph library |
Main Page > Deployment and run modes |