sjethvani
sjethvani

Reputation: 530

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

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

Upvotes: 1

Views: 2976

Answers (1)

sjethvani
sjethvani

Reputation: 530

I achieved above thing using this https://stackoverflow.com/a/36929518/3789189

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

Upvotes: 1

Related Questions