-
Notifications
You must be signed in to change notification settings - Fork 6
Building DMASON from source
The following tutorial will guide you through the download and setup of the D-MASON project into Eclipse. Of course you can use any IDE of your choice, or no one at all.
- Eclipse "Mars" or newer
- Subversion plug-in for Eclipse (it should already be included in Eclipse)
- Apache Maven (it should already be included in Eclipse)
- Open menu "File" > "Import" and select "Projects from Git" under "Git" folder
- Select "Clone URI" and press the "Next" button
- In the "URI" field insert "/~https://github.com/isislab-unisa/dmason.git"
- Fill all fields in "Authentication" with your GitHub credentials. Than press the "Next" button
- In "Branch Selection" view, select the branch on which you want work (master is the main branch), alternatively you can select all of them. Than press the "Next" button.
- Press the "Next" button in the "Local Destination" view.
- Wait until the download ends, than select "Import as general project" in "Wizard for project import" and press the "Next" button
- Fille the "Project name" field in "Import Project" section and press "Fisish" button
- Right-click on project > "Configure" > "Convert to Maven Project"
Now you can use DMASON.
To install DMASON you need download Apache Maven and the DMASON project from git repository. Now you have to run the following command in the main directory of DMason project
$ path_to_apache-maven/bin/mvn -Dmaven.test.skip=true clean package
This command builds project and creates a folder called target in which you can find the executable jar for DMASON
Note: To generate build without runs test suite:
$ mvn -Dmaven.test.skip=true clean package
DMASON is built upon Three components: an ActiveMQ server, one or more Workers and a Master which include a Web Server.
In this tutorial, we’ll setup a DMASON simulation using two workers. Also, we will run all of the component on a single machine, but in a real simulation environment you may want to run the server and every worker on different hosts.
Using the jar file DMASON-X.X.jar available under the target folder it's possible to run Master and Worker(s).
For launching the Master use the follow command:
java -jar DMASON-X.X.jar -m master
In this way, it's available the ActiveMQ server and the Web System Management.
Using the jar file DMASON-X.X.jar available under the target folder run the follow command:
$ java -jar DMASON-X.X.jar -m worker -ip <ipactivemq> -p <portactivemq> -h ipslave1 ipslave2 ... ipslaveN -ns <M>
- M is the max number of available LPs that the slave nodes can execute
- ipslave{1-N} is the ip of the machines on which runs DMASON as Worker (Optional)
It's possible to run each component from Eclipse for a local test
We include the ActiveMQ library using the maven repository (see pom.xml file). The actual version is the 5.13.3.
From Eclipse run the class ActiveMQStarter.java under it/isislab/dmason/experimentals/systemmanagement/utils/activemq/ package for running the ActiveMQ.
From Eclipse run as Java application the class MasterServerMain.java under it/isislab/dmason/experimentals/systemmanagement/master/ package for running the Master component.
From Eclipse run as Java application the class WorkerMain.java under it/isislab/dmason/experimentals/systemmanagement/master/ package for running the Master component.
Note: the class requires some arguments, them are the following:
- masterIP (default 127.0.0.1)
- ActiveMQ listening port (default 61616)
- number of LPs to simulate (default 1)
To run DMASON on cluster, you can follow these steps
Download Java SE Development Kit 8 from oracle site. You can follow this instructions /~https://github.com/serfla/jdk-cluster-installer to set JDK 8 as default. Repeat this operation for all nodes of clusters.
Run maven install of DMASON project. Under target folder you can find the following files:
- DMASON-X.X.jar
- resources folder
You can create a folder called DMASON with these files. Now you copy this folder on all nodes of cluster.
On master node editing Apache ActivemQ configuration file 'resources/systemmanagement/master/conf/config.properties' in order to set ip and port of Apache ActivemQ:
- set ip (default is 127.0.0.1), the same ip of master node
- set port (default is 61616)
On master node open a terminal e launch this command to start the master node
$ java -jar DMASON-X.X.jar -m master
In your web browser enter the address http://127.0.0.1:8080 to start a Web UI of system management, if master node is on 127.0.0.1. You have to use latest version of Google Chrome or Firefox as web browser.
Now, to start the slaves node you can open a new terminal on the master node and launch this command
#M is the max number of available cells that the slave nodes can execute
$ java -jar DMASON-X.X.jar -m worker -ip <ipactivemq> -p <portactivemq> -h <ipslave1 ipslave2 ... ipslaveN> -ns <M>
or you can launch this command on each slave node
#M is the max number of available cells that the slave node can execute
$ java -jar DMASON-X.X.jar -m worker -ip <ipactivemQ> -p <portActivemq> -ns M
where M is the max number of available LPs that the slave nodes can execute.
To export your simulation:
- "Right-click" > "Export" on simulation package
- Select "Jar File" under "Java" folder in "Export" view, than press the "Next" button
- Select the export destination and press the "Finish" button
- For how to run own simulation from System Management, read here