1

我最近将我们的网格从旧的 RHEL7 服务器迁移到了新的 RHEL8 服务器。当我在新机器上运行 docker-compose 时,节点没有连接到集线器。

码头工人-compose.yml

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"

测试命令

$ docker-compose up --scale chrome=1 --scale firefox=0

终端输出

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-ce,因此我们可以继续使用 docker-compose。

4

1 回答 1

0

这花了一些时间,但我们发现了一个修复程序并在第二台机器上验证了这些步骤。

  1. 安装 IpTables
$ yum install iptables-services
$ systemctl start iptables
$ systemctl enable iptables
  1. 配置 IpTables 以允许集线器的端口
$ sudo iptables -A INPUT -p tcp --dport 4444 -j ACCEPT
  1. 关闭防火墙守护程序
$ systemctl stop firewalld
  1. 启动/重启 docker 守护进程
$ systemctl restart docker
于 2020-07-29T20:06:10.093 回答