Closed ginonott closed 5 years ago
In case anyone else is also having this issue, the current work-around is to create a custom network and fix the locust_master ip address and set the slave's to use that fixed ipv4 address. Here is an example:
version: '2.1'
services:
locust_master:
build: .
command:
'locust'
networks:
locust_net:
ipv4_address: 172.16.238.10
locust_workers:
build: .
command:
'locust --slave --master-host=172.16.238.10'
depends_on:
- locust_master
networks:
- locust_net
networks:
locust_net:
driver: bridge
ipam:
driver: default
config:
-
subnet: 172.16.238.0/24
it crashes with a ZMQError
please post the stacktrace with error
Sorry for the delay. Here's the dump:
[2018-07-16 14:28:48,270] 68bb9eb87895/ERROR/stderr: Traceback (most recent call last):
[2018-07-16 14:28:48,271] 68bb9eb87895/ERROR/stderr: File "/opt/bb/bin/locust", line 11, in <module>
[2018-07-16 14:28:48,271] 68bb9eb87895/ERROR/stderr:
[2018-07-16 14:28:48,272] 68bb9eb87895/ERROR/stderr: load_entry_point('locust==0.8', 'console_scripts', 'locust')()
[2018-07-16 14:28:48,272] 68bb9eb87895/ERROR/stderr: File "/opt/bb/lib/python2.7/site-packages/locust/main.py", line 473, in main
[2018-07-16 14:28:48,278] 68bb9eb87895/ERROR/stderr:
[2018-07-16 14:28:48,279] 68bb9eb87895/ERROR/stderr: runners.locust_runner = SlaveLocustRunner(locust_classes, options)
[2018-07-16 14:28:48,279] 68bb9eb87895/ERROR/stderr: File "/opt/bb/lib/python2.7/site-packages/locust/runners.py", line 357, in __init__
[2018-07-16 14:28:48,281] 68bb9eb87895/ERROR/stderr:
[2018-07-16 14:28:48,281] 68bb9eb87895/ERROR/stderr: self.client = rpc.Client(self.master_host, self.master_port)
[2018-07-16 14:28:48,282] 68bb9eb87895/ERROR/stderr: File "/opt/bb/lib/python2.7/site-packages/locust/rpc/zmqrpc.py", line 30, in __init__
[2018-07-16 14:28:48,283] 68bb9eb87895/ERROR/stderr:
[2018-07-16 14:28:48,284] 68bb9eb87895/ERROR/stderr: self.receiver.connect("tcp://%s:%i" % (host, port+1))
[2018-07-16 14:28:48,284] 68bb9eb87895/ERROR/stderr: File "zmq/backend/cython/socket.pyx", line 580, in zmq.backend.cython.socket.Socket.connect
[2018-07-16 14:28:48,285] 68bb9eb87895/ERROR/stderr: File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
[2018-07-16 14:28:48,285] 68bb9eb87895/ERROR/stderr: zmq.error
[2018-07-16 14:28:48,285] 68bb9eb87895/ERROR/stderr: .
[2018-07-16 14:28:48,286] 68bb9eb87895/ERROR/stderr: ZMQError
[2018-07-16 14:28:48,286] 68bb9eb87895/ERROR/stderr: :
[2018-07-16 14:28:48,286] 68bb9eb87895/ERROR/stderr: Invalid argument
[2018-07-16 14:28:48,286] 68bb9eb87895/ERROR/stderr:
Here's the command used to run it: locust -f /src/locustfile.py ${LOCUSTS} --logfile /src/output/workers.out --slave --master-host=locust_master'
where locust_master is the service name in docker-compose. I also confirmed that I can curl http://locust_master:8081
and see the HTML that the master serves from the worker
docker container, so they are properly networked together.
@cgoldberg @aldenpeterson-wf Is there no other way than hardcoding an ipaddress to get this working ? When we deploy this in kubernetes, hardcoding ipadress will be a pain.
I think this was a zeromq bug.. try upgrading that.
Closing this, if it was not a zeromq bug please reopen with a more descriptive title.
Description of issue / feature request
When setting up a distributed setup via docker-compose, I'd like to set the
master-host
to the locust_master service name. However, it seems that non-ipv4 formatted strings cause an error and crashes the slave. This is an example of what I would like to do (but causes the slave to crash with a ZMQError):Expected behavior
It connects to the host via it's alias'ed hostname.
Actual behavior
It crashes with a ZMQError
Environment settings (for bug reports)
Steps to reproduce (for bug reports)
Create a dockerfile with locust and then try to bring up a master / slave where
--master-host
is set tolocust_master