Configuration

The cluster configuration is done through the Loadcoder configuration file. Loadcoder will by default look for loadcoder.conf. This can be changed using the jvm argument loadcoder.configuration:

-Dloadcoder.configuration=myconfig.conf

In some situation (depending on how the infrastructure and network looks like), it may be needed two have more than one configuration file. One to use from your workstation, and one that will be used from inside the Loadcoder conainer in the cluster. In this case you set the loadcoder.configuration argument in the test.sh file where the test execution command is executed.

Below configuration file contains examples for all parameters that will be needed to configure a distributed cluster

loadcoder.conf

################## CONTAINERS #########################
# Ports:
# .server.port is the port that the running application inside the container listens at.
#    This setting should only be used if the actual applications port is changed.
#
# .exposed.server.port is the port that the container will expose to the outside mapped
#    to the server port. 
#
# .port is the port that connecting clients will use.
#    The port configurations will default to each others values in the order they are
#    stated above from bottom and up. If the .port is not present it will default
#    to .exposed.server.port and so on. If .server.port is not present, the last default option
#    will be the port specified in class com.loadcoder.cluster.clients.docker.MasterContainers
#
# .host be host or ip value where the container can be reached. 
#    If not present it will default value master. master can be mapped to the IP where
#    the containers can be reached. See hostip in the INFRASTRUCTURE section.
#    This host variable is only used for clients. The container will still
#    be setup at the Master node.

influxdb.image=influxdb:1.7.10
influxdb.exposed.port=4000

grafana.image=grafana/grafana:5.4.3
grafana.host=grafanahost

loadship.image=loadcoderhub/loadship:1.0.0
loadship.port=5000

loadcoder.image=loadcoderhub/loadship:1.0.0


################ INFRASTRUCTURE ################
# Node with id = 1 will be the Master
cluster.masternode=1

# The Master node with id: 1
node.1.host=masterhost
node.1.dockerapi.port=2375

# Worker node with id: 2
node.2.host=workerhost
node.2.dockerapi.port=2375

# hostip entries will turn upp in /etc/hosts as host IP mappings
# If the master hostname can't be found in DNS, it is a good
# idea to state that hostname here.
# You can add as many hosts as you like.
hostip.masterhost=192.168.1.104
hostip.webapptotest=192.168.1.105

Additional configuration

The configuration below will only be needed is certain cases

All nodes (including the Master) will default act as Workers. You can configure to inactivate them as Workers by setting the use-as-worker parameter to false. This will be recommended for the Master node if you have other nodes to use, as the Master already executes the Master Containers (Grafana, InfluxDB and Loadship)

node.1.use-as-worker=false

If you for some reason need to change the name of the Loadcoder container (from default value loadcoder) you can do this with:

cluster.id=alternative_id

Loadcoder can also setup the package repository Jfrog Artifactory at the Master Node. If you want to break up your testcode into different projects and packages, you will need a repository to deploy to and download from. If you already have repository where all packages are managed, you will probably not need this.

artifactory.image=docker.bintray.io/jfrog/artifactory-oss:latest