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

独自空忆成欢 提交于 2019-12-11 04:19:23

问题


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) I have checked that docker selenium-hub is up and running fine on my local machine

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


回答1:


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

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 ...

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



来源:https://stackoverflow.com/questions/40593802/docker-selenium-hub-not-accessible-from-different-machine-in-same-network-doc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!