This demo shows how to deploy compute tasks to Gridgain Nebula cluster and run them right from the client`s application.
- Go to https://portal.gridgain.com/.
- Click "Create Nebula Cluster". A provisioning wizard will appear.
- Create a Small Instance with 1 node:
- Specify user credentials. These credentials will be used for clients that work with the cluster.
- Accept terms and conditions, and start provisioning the cluster.
- Wait for the cluster to be successfully provisioned.
- Make sure the cluster is selected in the Cluster Management screen.
- Switch to the Deployment menu and create a new deployment.
- Click "Add artifact" to open a menu with types of artifacts, that you can choose:
- Create the following artifacts:
- Direct Link artifact with url
https://code-deployment-demo.s3.amazonaws.com/compute-task-sample-1.0.jar
. - Maven artifact with coordinate
com.google.guava:guava-collections:r03
, which is a transitive dependency of the compute task.
- Switch to the Clusters screen, click the
⋮
on the right of the cluster and select "Connect" from the drop-down menu. Copy the connection url: - Use the ThinClientApp class ( if you want to run a thin client ) or ThickClientApp class ( if you want to run a thick client) and fill copied connection url to
ADDRESSES
field. - Run the application. It executes a job on the cluster, and you should see
its output on the client node:
and the following output on the server node:
>> Execute org.gridgain.demo.CityFilterTask job >> Job result: [Barcelona, Bilbao, Córdoba, Gijón, Madrid, Mallorca, Murcia, Málaga, Sevilla, Valencia, Valladolid, Vigo, Zaragoza] >> Compute task is executed, check for output on the server nodes.
>> Executing the compute task >> Found 13 cities with code SPA
- [Optional] Go to the compute task class CityFilterTask.java
and invert comments in rows 26-27:
CityComputeJob job = new CityComputeJob(CountryCode.SPA); // CityComputeJob job = new CityComputeJob(CountryCode.FRA);
- [Optional] Perform points 5, 6, 7 again and you should get the following output:
and on the server node side:
>> Execute org.gridgain.demo.CityFilterTask job >> Job result: [Angers, Bordeaux, Brest, Dijon, Grenoble, Lille, Lyon, Marseille, Montpellier, Nantes, Nice, Paris, Reims, Rennes, Strasbourg, Toulon, Toulouse] >> Compute task is executed, check for output on the server nodes.
>> Executing the compute task >> Found 17 cities with code FRA