Page tree
Skip to end of metadata
Go to start of metadata
After reading this doc, you will know...

... how to run MoSKito-Central in Remote Mode

On this page

Why Remote Mode?

There are 2 modes for MoSKito-Central deployment:

  1. Remote (Standalone app).
  2. Embedded.

In Remote mode, MoSKito-Central is working as a separate application and uses:

  • DistributeMe and REST EndPoints for receiving data from other applications.
  • Dedicated machine's filesystem for processing and storing the received performance data.

The Remote (Standalone) Mode is useful when you need to monitor multiple application instances (multiple JVM's) and consolidate the obtained performance data in one place.

The Embedded mode cannot be used here, since we gather info from multiple servers (not a single JVM), and MoSKito-Central needs to have a separate space for data storage.

How Remote Mode Works

The flowchart below shows how the process is set up, step by step.

The workflow stages are the following:

  1. MoSKito-Central is instantiated on a remote (dedicated) machine.
  2. MoSKito plug-in, initiated on a app server (like Tomcat), fetches performance data from MoSKito-Essential, which resides in the target (monitored) web application.
  3. The collected data is transferred to MoSKito-Central in one of the following ways:
    1. directly, through EmbeddedConnector,
    2. via RMI, through DistributeMeConnector, or 
    3. via HTTP, through RESTConnector.
  4. The data is processed and stored in application memory, file system (json, xml or csv files) or database. 

How to Set It Up

To set up MoSKito-Central in Remote mode, you'll need to:

  1. Declare dependencies.

  2. Enable MoSKito-Central.
  3. Configure storages.

Declare Dependencies 

Make a reference to MoSKito-Central in pom.xml of your project:

Please refer to maven for the latest version: http://search.maven.org/#search%7Cga%7C1%7Cmoskito-central

If you use another build tool, you will need to put moskito-central.jar and other libs in your project.

Enable MoSKito-Central

Transferring data via HTTP with REST Connector

Setting up remote HTTP server:

Clone our MoSKiTo-Central repository and build moskito-central-rest-webapp module. Now moskito-central-rest-webapp-${version}.war from target directory can be deployed.

You may want to configure your moskito-central instance storages. To do this follow this article.

Setting up HTTP client:

Declaring dependencies:

First add following in your project pom file:

pom.xml
<dependency>
    <groupId>org.moskito</groupId>
    <artifactId>moskito-central-rest-connector</artifactId>
    <version>1.1.4</version>
</dependency>
Configuring connector:

To enable MoSKito-Central HTTP connector, add the corresponding plug-in to moskito.json configuration file.

RESTConnector
"@pluginsConfig": {
	"@plugins": [
    	{
        	"name": "RESTRemoteCentralConnector",
            "configurationName": "rest-connector",
            "className": "org.moskito.central.connectors.rest.RESTConnector"
        }
	]
},

Next create configuration json file named as it set in plugin incude config property configurationName (file name should be rest-connector.json assuming example above):

rest-connector.json
{
  "host": "localhost",
  "port": 8080,
  "resourcePath": "/central/addSnapshot",
  "basicAuthEnabled" : true,
  "login" : "moskito",
  "password" : "central"
}

Configuration contains following properties:

  • host - required. Host of MoSKiTo-Central remote instance;
  • port - required. Port of remote instance;
  • resourcePath - required. Url path to snapshot receiving method. Should be /central/addSnapshot if remote Central container deployed as ROOT;
  • basicAuthEnabled - boolean. Enables HTTP Basic authentication if set to true; 
  • login - authentication login;
  • password - authentication password;
  • hostVerificationEnabled - boolean. Enables host verification by certificate.
  • trustSefSigned - boolean. All self-signed certificates are trusted if set to true (even if they not from TrustStore);
  • trustStoreFilePath - path to TrustStore file;
  • trustStorePassword -  TrustStore password;

Visit this page to learn more about HTTP Connector authentication mechanism

Transferring data via RMI with DistributeMe Connector:

Setting up DistributeMe MoSKiTo-Central server:

Clone our MoSKiTo-Central repository and build moskito-central-dime-server module. Now moskito-central-dime-server-${version}-jar-with-dependencies.jar is available in your target  directory.

Now you can run server by following command:

DiMe server run command
java -jar moskito-central-dime-server-${version}-jar-with-dependencies.jar -DlocalRmiRegistryPort=9255

Where localRmiRegistryPort is port of RMI connector. Also server supports other DistributeMe configuration options

You may want to configure your moskito-central instance storages. To do this follow this article.

Setting up DistributeMe MoSKiTo-Central client:

Declaring dependencies:

First add dependencies to your project pom file:

pom.xml
<dependency>
    <groupId>org.moskito</groupId>
    <artifactId>moskito-central-distributeme-connector</artifactId>
    <version>1.1.4</version>
</dependency>
Configuring connector:

To enable MoSKito-Central RMI connector, add the corresponding plug-in to moskito.json configuration file.

DistributeMeConnector
"@pluginsConfig": {
	"@plugins": [
    	{
        	"name": "DiMeRemoteCentralConnector",
            "configurationName": "dime-connector",
            "className": "org.moskito.central.connectors.dime.DiMeCentralConnector"
        }
	]
},

Next create configuration file for plugin. Name should be same as property configurationName of plugin include config with .json file extension (Be dime-connector.json applying config above).

dime-connector.json
{
  "connectorHost" : "localhost",
  "connectorPort" : 9249
}

This config contains host and port of remote Moskito-Central storage with RMI connector.

Storage Configuration

Storage configuration is the same for both Embedded and Remote Modes.

That is why it is fully described in Configure MoSKito-Central Storage section.