docker selenium hub not accessible from different machine (in same network) [docker selenium grid not working]
Asked Answered
B

1

1

I have set up selenium docker hub on my local host and it is up and running (however through Kitematic it shows 2 IP addresses for docker selenium-hub) (see this) enter image description here I have checked that docker selenium-hub is up and running fine on my local machine enter image description here

Main Problem start appearing when I try to register chrome-node from another machine

Now I want to run selenium docker chrome node on another machine so I fired following command on another machine (Node machine's IP Address is '192.168.80.135' & I want node-chrome docker to run on port '5555') . Command I fired for that is

docker run -d -p 5555:5555 -e REMOTE_HOST="http://192.168.80.135:5555" -e    
HUB_PORT_4444_TCP_ADDR="192.168.99.101" -e HUB_PORT_4444_TCP_PORT="4444" --  
name chrome-node selenium/node-chrome-debug:2.53.1

However firing above command shows this kinda errors in node-chrome-debug's console

06:10:03.690 INFO - I/O exception (java.net.NoRouteToHostException) caught     
when processing request to {}->http://192.168.99.101:4444: No route to host
06:10:03.690 INFO - Retrying request to {}->http://192.168.99.101:4444
08:25:15.809 INFO - Retrying request to {}->http://192.168.99.101:4444
08:25:18.809 INFO - I/O exception (java.net.NoRouteToHostException) caught     
when processing request to {}->http://192.168.99.101:4444: No route to host
08:25:18.809 INFO - Retrying request to {}->http://192.168.99.101:4444
08:25:21.809 INFO - Couldn't register this node: The hub is down or not     
responding: No route to host
08:25:29.809 INFO - I/O exception (java.net.NoRouteToHostException) caught     
when processing request to {}->http://192.168.99.101:4444: No route to host
08:25:29.810 INFO - Retrying request to {}->http://192.168.99.101:4444

Moreover I am not able to open selenium-hub url in node machine (http://192.168.99.101:4444/grid/console) is not working ..

Any kinda help would be appreciated .. Thanks in advance

Docker-Vm created in my local machine enter image description here

Barcot answered 14/11, 2016 at 16:48 Comment(2)
Your machines can't talk to each other. What's your networking topology?Bucharest
So @Bucharest we are trying out this docker stuff in our office, where in all machines are in same network . I have docker vm on my machine & have selenium hub image under docker vm . Now if i install selenium-chrome/ff-node in my docker vm , then it works . However when I try to make another machine (from my office network) as node , it is not able to connect to my docker vm (which is in my machine) . I doubt my docker vm (created under my local machine) is not able to see my office network . Moreover this is what network type of docker created vm is (attaching it in question)Barcot
B
1

I achieved above thing using this https://mcmap.net/q/1186684/-how-to-connect-to-a-docker-container-from-outside-the-host-same-network-osx-10-11

Overall I did following things 1) Port forwarding as described above on 'default' vm of my local host computer A enter image description here

2) registering node from another computer (lets say 'Machine B') [Note : This command is fired in another machine B , It will create chrome-node docker container (staying under machine B's default vm) & register it to selenium-hub docker container (staying under 'default' vm of machine A) ]

    docker run -d -p 5555:5555 -p 5900:5900 -e 
    REMOTE_HOST="http://192.168.80.135:5555" -e 
    HUB_PORT_4444_TCP_ADDR="192.168.80.62" -e HUB_PORT_4444_TCP_PORT="4444" 
    --name chrome-node selenium/node-chrome-debug:2.53.1

3) port forwarding on 'default' vm of machine B also ... enter image description here

3rd step is the important one , if you don't do this then selenium hub will not be able to communicate with selenium-node docker image, which stays under machine B

Barcot answered 15/11, 2016 at 9:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.