Locust docker installed and working, but when executed there is no users ??

no users running for test
users should be not 0 (zero)
version: '3.7'
networks:
bridge:
external: true
services:
master:
image: locustio/locust:latest
deploy:
replicas: 1
# service restart policy
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "8089:8089"
networks:
- bridge
volumes:
- /home/core/locust:/mnt/locust
command: -f /mnt/locust/locustfile.py --master -H http://192.168.33.231:8089
worker:
image: locustio/locust:latest
networks:
- bridge
deploy:
replicas: 3
# service restart policy
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
volumes:
- /home/core/locust:/mnt/locust
command: -f /mnt/locust/locustfile.py --worker --master-host 192.168.33.231:8089
I copy all files from https://github.com/locustio/locust/tree/master/examples to the docker yaml volume path,
and change ip 127.0.0.1 to 192.68.33.231

Why locust is not running ??
Have you checked the log (command line output) for master and workers?
I think you're making this too complicated. Here's my docker-compose.yml:
version: '3'
services:
master:
image: locustio/locust:1.2
ports:
- "8089:8089"
volumes:
- ./:/mnt/locust
- ./locust:/usr/local/lib/python3.8/site-packages/locust
command: -f /mnt/locust/locustfile.py --master -H http://target
# command: -f /mnt/locust/locustfile.py --master -H http://target --step-load
worker:
image: locustio/locust:1.2
volumes:
- ./:/mnt/locust
# - ./locust:/usr/local/lib/python3.8/site-packages/locust
command: -f /mnt/locust/locustfile.py --worker --master-host master --loglevel DEBUG
target:
image: nginx:latest
volumes:
- ./nginx:/etc/nginx/conf.d/
Then to start with with 3 workers: docker-compose up --scale worker=3
@max-rocket-internet ,
Whats is the value of http://target ??
is it locust master node ip and port or it is the target domain which is going to be stresstest with locust ??
Whats is the value of http://target ??
That's the container named target, it's in the YAML. You can use container names as hostnames in docker-compose. This container is the target of the load test.
I also encountered this problem in version 1.2.2, but the same code works fine in version 1.1.1
users should be not 0 (zero)
Your user count is 0 because your worker is not connected. You can see it Workers 0 in the screen shot. You should debug network communication between your workers and master.
@cyberw ,
Here are the master and worker logs from portainer,


@max-rocket-internet ,
yes i think you are right
version: '3.7'
networks:
bridge:
external: true
services:
master:
image: locustio/locust:latest
deploy:
replicas: 1
# service restart policy
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "8089:8089"
networks:
- bridge
volumes:
- /home/core/locust:/mnt/locust
command: -f /mnt/locust/locustfile.py --master -H http://www.google.com
worker:
image: locustio/locust:latest
networks:
- bridge
deploy:
replicas: 3
# service restart policy
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
volumes:
- /home/core/locust:/mnt/locust
command: -f /mnt/locust/locustfile.py --worker --master-host master
it should be connected between master and worker, i will check again. Thank you
Guys, thank you very much. locust is running properly now


version: '3.7'
networks:
bridge:
external: true
services:
master:
image: locustio/locust:latest
deploy:
replicas: 1
# service restart policy
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "8089:8089"
- "5557:5557"
networks:
- bridge
volumes:
- /home/core/locust:/mnt/locust
command: -f /mnt/locust/locustfile.py --master -H http://www.google.com
worker:
image: locustio/locust:latest
networks:
- bridge
ports:
- "5558:5558"
deploy:
replicas: 3
# service restart policy
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
depends_on:
- master
volumes:
- /home/core/locust:/mnt/locust
command: -f /mnt/locust/locustfile.py --worker --master-host=192.168.33.230
Most helpful comment
Guys, thank you very much. locust is running properly now