-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 (or more) chrome containers in the same server connected to the same hub #140
Comments
You just do it again with a different container name (or leave off the name flag for a random container name). If you want port 5555 exposed on the containers, just map it to a different port on the host like so: -p 5554:5555 |
@SpencerMalone don't you also have to tell the Hub that you are listening on 5554 instead of 5555? |
Hi folks, I've been playing around with running nodes on and off the same container host as the hub. When running a node on the same Docker host, and specifying the Hub machine and port via -e HUB_PORT_4444_TCP_ADDR= -e HUB_PORT_4444_TCP_PORT= everything works, as the node can find the Hub and then tells the hub the IP address and port it is using INTERNALLY to the VM, which is of course accessible on the Hub host as it is running on the same machine, so mapping port 5555 on the host to the Docker image with a -p 5555:5555 is not necessary. However when running the host remotely, you not only have to expose the port on the Docker host via -p, you also need to tell the node to pass the Docker host's address and the port you are exposing via the REMOTE_HOST variable, a la: -e REMOTE_HOST=http://<node's Docker host address>:5555 This way the hub knows where to look for the Node when calling it back; by default the hub will tell the hub the IP address of the VM it is running in and the port (which will be 5555) but this is not accessible from the Hub machine, which is exactly why you have to map a port on the Docker host to forward to the VM. So, for example, assuming the Docker host for the nodes was 10.1.1.2, and the Hub was on 10.1.1.1 port 80, you would run the nodes as: docker run -d -e HUB_PORT_4444_TCP_ADDR=10.1.1.1 -e HUB_PORT_4444_TCP_PORT=80 -e REMOTE_HOST=http://10.1.1.2:5555 -p 5555:5555 selenium/node-firefox I found this by searching through the code base here (the entry_point.sh Docker autolaunch file) but don't see it in the README documentation. |
You have just made my day after a 4 hour trawl online Thank you! |
Thanks all for the great info! |
Hi All,
There is no clear docs about how to connect 2 (or more) containers to the same hub in the same server.
What i'm doning is:
HUB: docker run -d --name hub -p 4444:4444 -e GRID_BROWSER_TIMEOUT=360000 selenium/hub
NODE #1: docker run -d --link hub:hub -P --name node555 -p 5555:5555-v /dev/shm:/dev/shm selenium/node-chrome
NODE #2:???
I'm missing the command for NODE #2..
If anyone can help it will great...
Thanks,
The text was updated successfully, but these errors were encountered: