码头硒机不能从不同的机器(在同一网络中)进行接收[docker硒网格不工作] [英] docker selenium hub not accessible from different machine (in same network) [docker selenium grid not working]

查看:434
本文介绍了码头硒机不能从不同的机器(在同一网络中)进行接收[docker硒网格不工作]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的本地主机上设置了硒码头坞站,它已经启动并运行(但是通过



主要问题开始出现当我尝试从另一台机器注册chrome-node时



现在我要在另一台机器上运行selenium docker chrome节点,所以我在另一台机器上启动了以下命令
(节点机器的IP地址是192.168.80.135,我想点头e-chrome码头服务器可在端口5555上运行)。我开始的命令是

  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 -
名称chrome-node selenium / node-chrome-debug:2.53.1

但是,上面的命令显示了这个节点chrome-debug的控制台中的这种错误

  06:10:03.690 INFO  -  I / O异常(java.net.NoRouteToHostException)在处理请求到{}  - > http://192.168时捕获
.99.101:4444:没有路由主机
06:10:03.690 INFO - 重试请求到{} - > http://192.168.99.101:4444
08:25:15.809 INFO - 重试请求到{} - > http://192.168.99.101:4444
08:25:18.809 INFO - I / O异常(java.net.NoRouteToHostException)在处理请求到{} - > ; http://192.168.99.101:4444:没有路由到主机
08:25:18.809 INFO - 重试请求到{} - > http://192.168.99.101:4444
08:25 :21.809 INFO - 无法注册此节点:集线器已关闭或不正常
响应:没有路由到主机
08:25:29.809 INFO - I / O异常(java.net.NoRouteToHostException)捕获
当处理请求到{} - > http://192.168.99.101:4444:没有路由主机
08:25:29.810 INFO - 重试请求到{} - > http:// 192.168.99.101:4444

此外,我无法在节点机器中打开selenium-hub url(< a href =http://192.168.99.101:4444/grid/console =nofollow noreferrer> http://192.168.99.101:4444/grid/console )不工作..



任何有帮助将不胜感激...感谢提前



Docker-Vm在我的本地机器中创建

解决方案

我使用这个



2)从另一台计算机注册节点(让我们说机器B)
[注意:此命令在另一台计算机B中触发,它将创建chrome-node docker容器(保持在机器B的默认vm)&注册到selenium-hub码头容器(停留在机器A的'default'vm下)]

  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)端口转发机器B的'默认'vm也$ ...



第三步是重要的一步如果不这样做,那么硒集线器将无法与硒机节点泊坞窗图像进行通信,该图像位于机器B


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

解决方案

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

这篇关于码头硒机不能从不同的机器(在同一网络中)进行接收[docker硒网格不工作]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆