首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >docker-selenium节点不连接到集线器-没有主机路由。

docker-selenium节点不连接到集线器-没有主机路由。
EN

Stack Overflow用户
提问于 2020-06-12 20:38:33
回答 1查看 1.7K关注 0票数 1

最近,我将网格从旧的RHEL7服务器迁移到了新的RHEL8服务器。当我在新机器上运行对接-组合时,节点不会连接到集线器。

docker-compose.yml

代码语言:javascript
复制
version: "3"
services:
  selenium-hub:
    image: selenium/hub:3.141.59-20200525
    container_name: selenium-hub
    ports:
      - "4444:4444"
  chrome:
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
    image: selenium/node-chrome-debug:3.141.59-20200525
    volumes:
      - "/dev/shm:/dev/shm"
  firefox:
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
    image: selenium/node-firefox-debug:3.141.59-20200525
    volumes:
      - "/dev/shm:/dev/shm"

测试命令

代码语言:javascript
复制
$ docker-compose up --scale chrome=1 --scale firefox=0

终端出

代码语言:javascript
复制
selenium-hub    | 18:25:12.271 INFO [Hub.start] - Selenium Grid hub is up and running
selenium-hub    | 18:25:12.272 INFO [Hub.start] - Nodes should register to http://172.18.0.2:4444/grid/register/
selenium-hub    | 18:25:12.272 INFO [Hub.start] - Clients should connect to http://172.18.0.2:4444/wd/hub
chrome_1        | 2020-07-29 18:25:12,302 INFO success: fluxbox entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
chrome_1        | 18:25:12.472 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
chrome_1        | 18:25:12.564 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Launching a Selenium Grid node on port 5555
chrome_1        | 2020-07-29 18:25:12.632:INFO::main: Logging initialized @345ms to org.seleniumhq.jetty9.util.log.StdErrLog
chrome_1        | 18:25:12.789 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
chrome_1        | 18:25:12.850 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 5555
chrome_1        | 18:25:12.850 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Selenium Grid node is up and ready to register to the hub
chrome_1        | 18:25:12.895 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
chrome_1        | 18:25:14.130 WARN [SelfRegisteringRemote.registerToHub] - Error getting the parameters from the hub. The node may end up with wrong timeouts.No route to host (Host unreachable)
chrome_1        | 18:25:14.130 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://selenium-hub:4444/grid/register
chrome_1        | 18:25:15.153 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: Error sending the registration request: No route to host (Host unreachable)
chrome_1        | 18:25:21.169 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: The hub is down or not responding: No route to host (Host unreachable)

注意: RHEL8使用podman,但是它被删除了,所以我们可以继续使用docker-RHEL8。

EN

回答 1

Stack Overflow用户

发布于 2020-07-29 20:06:10

这需要一些时间,但我们已经发现了一个修复方法,并在第二台机器上验证了这些步骤。

安装

  1. IpTables

代码语言:javascript
复制
$ yum install iptables-services
$ systemctl start iptables
$ systemctl enable iptables

  1. 配置IpTables以允许集线器的端口

代码语言:javascript
复制
$ sudo iptables -A INPUT -p tcp --dport 4444 -j ACCEPT

  1. 关闭了防火墙守护进程

代码语言:javascript
复制
$ systemctl stop firewalld

  1. Start/Restart码头守护进程

代码语言:javascript
复制
$ systemctl restart docker
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62352128

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档