I'm trying to implement Jmeter distributed framework with Docker. Master and slaves are running on different hosts in ec2. Ports have been opened to allow communication.

Master is stuck with the below message

```
Starting distributed test with remote engines: [slaveIP:1099] @ Sun Nov 21 04:50:29 GMT 2021 (1637470229447)
Remote engines have been started:[slaveIP:1099]

```

On the slave side, it is throwing me connection refused errors.

```
java.rmi.ConnectException: Connection refused to host: 172.17.0.2; nested exception is:

```

Command to start slave machine:

```
docker run \
        -dit \
        -p 6000:6000 \
        -p 1099:1099 \
        -v "${volume_path}":${jmeter_path} \
        --rm \
        jmeter \
        -n -s \
        -Jclient.rmi.localport=3000 \
        -Jserver.rmi.localport=6000 \
        -Dserver_port=1099 \
        -Djava.rmi.server.hostname=<HostIP> \
        -Dserver.rmi.ssl.disable=true \
        -j ${jmeter_path}/server/slave_${timestamp}_${IP_ADD}.log

```

Command to start master

```
docker run \
  -v "${volume_path}":${jmeter_path} \
  -p 3000:3000 \
  --rm \
  jmeternew \
  -n -X \
   -t ${jmeter_path}/$1 \
  -Dserver.rmi.ssl.disable=true \
  -Dclient.rmi.localport=3000 \
  -R slaveIP:1099 \
  -l ${jmeter_path}/client/result_${timestamp}.jtl \
  -j ${jmeter_path}/client/jmeter_${timestamp}.log

```

The same commands are working if I'm running master and slave on the same machine.
I tried changing the java.rmi.server.hostname=0.0.0.0.
It's also throwing me connection refused error