##1. Setup docker
#Mac
https://docs.docker.com/installation/mac/
#Linux
https://docs.docker.com/installation/ubuntulinux/
##2. Setup docker-machine
#Mac
curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
#Linux
curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine
chmod +x /usr/local/bin/docker-machine
##3. Create Client and Servers
docker-machine create --driver digitalocean --digitalocean-region ams2 --digitalocean-access-token {YOUR_SECRET_TOKEN_HERE} jmeter-server{JMETER_SERVER_ID}
docker-machine create --driver digitalocean --digitalocean-region ams2 --digitalocean-access-token {YOUR_SECRET_TOKEN_HERE} jmeter-client
##4. Setup docker container on each server
Run these commands for all server instances
#This activates your wanted server for docker on your master
docker-machine active jmeter-server{JMETER_SERVER_ID}
eval "$(docker-machine env jmeter-server{JMETER_SERVER_ID})"
#This starts a docker container with the right listening ports
docker run -d -p 0.0.0.0:1099:1099 -p 0.0.0.0:60000:60000 -p 0.0.0.0:4445:4445 -v /root:/logs santosharakere/jmeter-server -Djava.rmi.server.hostname={YOUR_SERVER_IP} -Dmode=Standard
##5. Setup docker container for client
#This activates your wanted client for docker on your master
docker-machine active jmeter-client
eval "$(docker-machine env jmeter-client)"
#This created an ssh connection to your client where you clone the driver setup
docker-machine ssh jmeter-client
git clone https://github.com/smarigowda/jmeter-driver.git
#Close connection made before so you're back on your master
exit
##6. Run your tests
#Start docker container on your client with the test_google scenario
docker run -p 0.0.0.0:1099:1099 -p 0.0.0.0:60000:60000 -p 0.0.0.0:4445:4445 -v /root/jmeter-driver:/jmeter-driver santosharakere/jmeter -n -t /jmeter-driver/test_google.jmx -Djava.rmi.server.hostname={YOUR_CLIENT_IP} -l /jmeter-driver/results.jtl -LDEBUG -R{YOUR_SERVER_IP}
##7. View results
#Connect to client and open results
docker-machine ssh jmeter-client
vim jmeter-driver/results.jtl
Any reason why you didn't
brew install docker-machine
? Thanks for the gist! 👍