0

I have locust setup in docker. I have a master and worker nodes setup. I was using a pre-1.0 version and have now upgraded to 1.0.2 and now my workers can't connect to the master. I read through the release notes and changed the environmental variables. Here's what they look like on my workers.

LOCUST_MASTER_NODE_HOST 10.200.202.13 LOCUST_MODE worker

and on the master LOCUST_MODE master

Edit: Something interesting. When i change LOCUST_MODE:worker to LOCUST_MODE_WORKER=true. In the logs it says "starting in standalone mode" but it still connects to the master.

How should I be setting this up?

2 Answers2

0

This guide demonstrates how to connect workers to master nodes: https://docs.locust.io/en/stable/running-locust-distributed.html

To start locust in master mode:

locust -f my_locustfile.py --master 

And then on each worker (replace 192.168.0.14 with IP of the master machine, or leave out the parameter altogether if your workers are on the same machine as the master):

locust -f my_locustfile.py --worker --master-host=192.168.0.14 
Tyler
  • 1,313
  • 12
  • 23
0

In my case the port 5557 must be mapped on docker and open on server's firewall.

Here is my master/worker docker-compose configurations on locust.

master node on server 1

version: '3'

services:
  master:
    image: locustio/locust
    ports:
     - "8089:8089"
     - "5557:5557"
    volumes:
      - ./:/mnt/locust
    command: -f /mnt/locust/locustfile.py --master --expect-workers 2 -H http://xxx.xxx.xxx.xxx:8089 -u 100 -r 200 -t 100s --headless --print-stats --host=https://my-server-2-load-test.com -L DEBUG --html /mnt/locust/app.html

worker nodes on server 2 and 3

version: '3'

services:
  worker:
    image: locustio/locust
    volumes:
      - ./:/mnt/locust
    command: -f /mnt/locust/locustfile.py --worker --master-host xxx.xxx.xxx.xxx

remember to save report you should touch app.html file and chmod 666 app.html along docker-compose.yml.

mehdiMj
  • 101
  • 8