Skip to content

Instantly share code, notes, and snippets.

@kyrnelia
Created October 3, 2017 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyrnelia/4fae2b913f06c782c25e6617ef67fed7 to your computer and use it in GitHub Desktop.
Save kyrnelia/4fae2b913f06c782c25e6617ef67fed7 to your computer and use it in GitHub Desktop.
version: "3.1"
services:
master:
image: jmeter:master
tty: true
ports:
- "60000"
networks:
- jm-network
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
window: 120s
placement:
constraints: [node.role == manager]
slave:
image: jmeter:slave
tty: true
networks:
- jm-network
ports:
- "50000"
- "1099"
deploy:
mode: global
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
window: 120s
placement:
constraints: [node.role == worker]
networks:
jm-network:
#Base image dockerfile
FROM ubuntu:17.04
LABEL Description="This image is for creating Ubuntu base with JRE & JMeter"
# Installig Pre-requisite Packages like wget, apt-utils & JRE
RUN apt-get clean && \
apt-get update && \
apt-get -qy install \
apt-utils \
wget \
default-jre-headless \
telnet \
iputils-ping \
unzip
# Installing jmeter
RUN mkdir /jmeter \
&& cd /jmeter/ \
&& wget http://www-us.apache.org/dist//jmeter/binaries/apache-jmeter-3.3.tgz \
&& tar -xzf apache-jmeter-3.3.tgz \
&& rm apache-jmeter-3.3.tgz \
&& mkdir /jmeter-plugins \
&& cd /jmeter-plugins/ \
&& wget https://jmeter-plugins.org/downloads/file/JMeterPlugins-ExtrasLibs-1.4.0.zip \
&& unzip -o JMeterPlugins-ExtrasLibs-1.4.0.zip -d /jmeter/apache-jmeter-3.3//lib/ext
# Setting Jmeter Home
ENV JMETER_HOME /jmeter/apache-jmeter-3.3/
# Adding Jmeter to the Path
ENV PATH $JMETER_HOME/bin:$PATH
#This Dockerfile builds JMeter Master Executable based on base
FROM jmeter:base
LABEL Description="This image is for starting JMeter Master Executable"
#Port 60000 required for JMeter Master
EXPOSE 60000
#This Dockerfile builds Apache JMeter Master Executable based on base
FROM jmeter:base
LABEL Description="This image is for starting JMeter Server Executable"
# Ports required for JMeter Slaves/Server
EXPOSE 1099 50000
# Application to be executed to start the JMeter container
ENTRYPOINT $JMETER_HOME/bin/jmeter-server \
-Dserver.rmi.localport=50000 \
-Dserver_port=1099
@kyrnelia
Copy link
Author

kyrnelia commented Oct 3, 2017

I'm trying to run this from my local machine.

  1. Swarm init - successful
  2. Build base image from the dockerfile above - successful
  3. Build Master image from dockerfile above - successful
  4. Build Server/Slave image from dockerfile above - successful
  5. All of the images are stored locally
  6. When i run docker service ls i see:
    image
  7. Running docker service ps gtajmeter_master i see:
    image
  8. Running the above for the server/slave i see no records
    image
    not sure what i'm getting wrong - maybe it's because i haven't done this:
    Setting up Swarm Mode Cluster:

On Master Node:

      $docker swarm init --listen-addr <master-ip>:2377 --advertise-addr <master-ip>:2377

On Slave Node:

      $docker swarm join --token <TOKEN> master-ip  <-- Run this command on all the slave nodes

but i don't know what values to put for IP and TOKEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment