Skip to content

Physical Machines for Load Generation

Sayantam Dey edited this page Aug 9, 2020 · 5 revisions

Introduction

This guide will walk you through the steps for setting up multiple physical machines, most likely in your data center, for load generation. Your data center machines need not to be necessarily available on the same network, but all machines should be accessible from your Hailstorm host machine. Only Linux has been tested as the load generation OS, though any POSIX based OS should work.

Docker

The most consistent way to set up the physical nodes for load generation is to build and run Docker containers on a multi-node overlay network. This will enable Hailstorm to connect with SSH on each container and use them as load agents. However, this uses an insecure way for communication because the private key file is public. This should not be a concern as long as the physical nodes are inaccessible from the world.

Run the container

docker run --rm -d --name hailstorm-load-agent hailstorm3/hailstorm-agent

Hailstorm Configuration

Download or clone the Hailstorm Site repository.

Copy the private key hailstorm-site/setup/data-center/insecure to the project config directory.

cp hailstorm-site/setup/data-center/insecure \
   /path/to/project/config/insecure_key.pem

The :data_center symbol denotes a cluster of physical machines that are intended for load generation.

Hailstorm.application.config do |config|
  # Data Center Configuration
  config.clusters(:data_center) do |cluster|
    # comma separated IP addresses of docker containers
    cluster.machines      = ['172.20.2.31', '172.20.2.17', '172.20.2.18']
    cluster.user_name     = 'root'
    # Key file from hailstorm-gem/resources, copy this to <project>/config
    cluster.ssh_identity  = 'insecure_key'
    # cluster.title is optional, used for reporting
    cluster.title         = 'Itou'
  end
end

Native Operating System

If you want to build your own physical or virtual machines, then follow along.

Public Key Authentication

All machines in the data center must be accessible via public-key authentication and must use the same user.

  • Generate a SSH key pair ssh-keygen -f hailstorm. Leave the passphrase empty. Two files will be generated, 'hailstorm' and 'hailstorm.pub'. Rename 'hailstorm' to 'hailstorm.pem' and move it to the project config directory.

  • Copy hailstorm.pub to each machine you'd like to use for load generation, and append it to the file ~/.ssh/authorized_keys (create the file if needed).

mkdir ~/.ssh
chmod 700 ~/.ssh
cat ~/hailstorm.pub >> ~/.ssh/authorized_keys
chmod 400 ~/.ssh/authorized_keys

⭐ You might want to check with at least one machine the credentials are setup correctly.

ssh -vT -i config/hailstorm.pem <user>@<machine>

Java

Oracle Java 8 is needed for latest JMeter 5.2.1 (default version for Hailstorm). If you intend to use an older JMeter version, check the JRE version requirement. This should be successful on each machine: java -version

JMeter

Untar your JMeter tarball and create a symbolic link jmeter in the home directory of the user. For example -

$ ls -l
total 4
drwxrwxr-x 7 ubuntu ubuntu 4096 May 22 19:52 apache-jmeter-5.2.1
lrwxrwxrwx 1 ubuntu ubuntu   17 May 22 19:57 jmeter -> apache-jmeter-5.2.1

Important Configuration Changes for JMeter

Add the following lines to ~/jmeter/bin/user.properties:

#---------------------------------------------------------------------------
# Hailstorm
#---------------------------------------------------------------------------
#
jmeter.save.saveservice.hostname=true
jmeter.save.saveservice.thread_counts=true

Hailstorm configuration

The :data_center symbol denotes a cluster of physical machines that are intended for load generation.

Hailstorm.application.config do |config|
  # Data Center Configuration
  config.clusters(:data_center) do |cluster|
    # comma separated IP addresses of data center machines
    cluster.machines      = ['172.20.2.31', '172.20.2.17', '172.20.2.18']
    cluster.user_name     = 'titi'
    # SSH key file name you placed in config directory or absolute path to key file
    cluster.ssh_identity  = 'hailstorm.pem'
    # cluster.title is optional, used for reporting
    cluster.title         = 'Manu'
    # Optional, specify non-standard SSH port. Should be the same for all machines.
    # cluster.ssh_port = 8022
  end
end