Selenium Grid2 - 远程节点未连接到集线器

发布于 2024-12-24 02:14:39 字数 2278 浏览 1 评论 0原文

我当前的设置是我有一个 selenium RC 作为 Windows 机器上的集线器运行(假设机器名称是 machine.name.com)。 我使用以下命令来启动它,

java -jar selenium-server2.15.jar -role hub -port 5555

我有一个selenium节点在注册到上述节点的同一台机器上运行。 我已使用以下命令启动节点

java -jar selenium-server2.15.jar -role node -port 5554 -hub http://machine.name.com:5555/grid/register

该节点已成功注册,并且我也可以运行该节点的测试。

现在我有另一台机器(一台 LINUX 机器 - 假设这台机器的 IP 地址是 10.123.123.123),我希望在端口 5555 处运行注册到 Windows (machine.name.com) 机器上的集线器的另一个节点。 我使用以下命令来启动节点。

java -jar selenium-server2.15.jar -role node -port 5572 -hub http://machine.name.com:5555/grid/register -browser browserName=chrome,platform=LINUX,maxInstances=5

问题是该节点没有被 HUB 注册。

我确实知道当我点击时集线器和节点已经检测到对方 http://machine.name.com:5555/console 在浏览器上两个节点都会显示。 但 Linux 计算机旁边有一条错误消息“正在监听 http://10.123.123.123:5572 (目前无法到达)

并且无法在该节点上运行任何硒测试。

我在 seleniumgroups 上阅读 HERE 远程节点必须定义 -hubHost 键值对 还。 所以我也尝试了以下命令,但没有成功

java -jar selenium-server2.15.jar -role node -port 5572 -hub http://machine.name.com:5555/grid/register -browser browserName=chrome,platform=LINUX, maxInstances=5 -hubHost "machine.name.com"

但这也没有注册节点。

请注意,Linux 机器上的控制台上不会抛出任何错误。 显示的只是 -

13:20:55.891 INFO - starting auto register thread. Will try to register every 5000ms
13:20:55.891 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:23:06.860 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:25:17.678 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:27:28.496 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:29:39.311 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register

在 Windows 计算机上运行 Hub 的控制台上没有抛出任何错误。

防火墙被适当地刺破,并通过远程登录进行检查。

有了这一切,我确信我做了一些根本性错误的事情,有人可以帮助我吗!!!!!!

My current setup is I have a selenium RC running as a hub on a windows machine(lets assume machine name is machine.name.com).
I have used the following command to start it

java -jar selenium-server2.15.jar -role hub -port 5555

I have a selenium node running on the same machine which is registered to the above node.
I have used the following command to start the node

java -jar selenium-server2.15.jar -role node -port 5554 -hub http://machine.name.com:5555/grid/register

This node gets registered successfully, and I am able to run tests of this node as well.

Now I have another machine (a LINUX one - lets assume the ip address of this machine is 10.123.123.123), form where I wish to run another node registered to the hub on the windows (machine.name.com) machine at port 5555.
I have used the following command to start the node.

java -jar selenium-server2.15.jar -role node -port 5572 -hub http://machine.name.com:5555/grid/register -browser browserName=chrome,platform=LINUX,maxInstances=5

The problem is that this node does not get registered by the HUB.

I do know for a fact that the Hub and Node have detected each other as when i hit
http://machine.name.com:5555/console on the browser both the nodes are displayed.
But the Linux machine has an error message alongside it "listening on http://10.123.123.123:5572 (cannot be reached at the moment)"

and no selenium tests can be run off that node.

I read on seleniumgroups HERE that the remote node must define the -hubHost key value pair also.
So I have tried the following command as well, with no success

java -jar selenium-server2.15.jar -role node -port 5572 -hub http://machine.name.com:5555/grid/register -browser browserName=chrome,platform=LINUX, maxInstances=5 -hubHost "machine.name.com"

But this does not register the node as well.

Please note no error is thrown on the console on the linux machine.
all that is displayed is -

13:20:55.891 INFO - starting auto register thread. Will try to register every 5000ms
13:20:55.891 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:23:06.860 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:25:17.678 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:27:28.496 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register
13:29:39.311 INFO - Registering the node to hub :http://machine.name.com:5555/grid/register

No error are thrown on the console running the Hub on the windows machine.

Firewalls are appropriately punctured, as well checked by telneting.

With all of this, I am sure i have done something fundamentally wrong, can someone please HELP ME!!!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

卖梦商人 2024-12-31 02:14:39

感谢大家的帮助,但问题是因为我的节点服务器的 IP 地址不可路由。
所以我为节点服务器创建了一个主机条目(还有 DNS 条目)。
并添加了另一个参数 -host

所以该命令现在看起来像

java -jar selenium-server2.15.jar -role node -port 5572 -hub http://machine.name.com:5555/grid/register -browser browserName=chrome,platform=LINUX, maxInstances=5 -hubHost "machine.name.com" -host "nodemachine.name.com"

再次感谢大家。

Thanks guys for helping out, but the problem was because the IP address of my node server was not routable.
So i created a host entry (DNS entry as well) for the node server.
and added another parameter -host

so the command now looks like

java -jar selenium-server2.15.jar -role node -port 5572 -hub http://machine.name.com:5555/grid/register -browser browserName=chrome,platform=LINUX, maxInstances=5 -hubHost "machine.name.com" -host "nodemachine.name.com"

thanks once again everyone.

陌伤ぢ 2024-12-31 02:14:39

对我来说,你的做法似乎是正确的。您在启动节点时尝试过 -debug 标志吗?也许你会在那里找到一些东西。

你可能想要 browserName=googlechrome 而不是 browserName=chrome

To me it seems like you're doing it correctly. Have you tried the -debug flag when launching the node? Maybe you'll find something there.

And you probably want browserName=googlechrome instead of browserName=chrome

晒暮凉 2024-12-31 02:14:39

当我使用 VPN 时,在本地计算机上托管节点和集线器时,我遇到了类似的问题。我能够通过使用参数 -host 和 -port 启动集线器和节点来解决这个问题

对于启动集线器,命令看起来像这样

java -jar selenium-server-standalone-2.32.0.jar -role hub -host <hubipaddress> -port 4444

对于启动节点,命令看起来像这样

java -jar selenium-server-standalone-2.32.0.jar -role node -host <nodeipaddress> -port 5555 -hub http://<hubipaddress>:4444/grid/register

在我的情况下, hubipaddress 和nodeipaddress 相同,它们是通过 VPN 分配给我的 IP 地址

I faced a similar problem when hosting both node and hub on the local machine while I was on the VPN. I was able to get around this problem by launching both the hub and the node with the parameters -host and -port

For launching the hub the command looks something like this

java -jar selenium-server-standalone-2.32.0.jar -role hub -host <hubipaddress> -port 4444

For Launching the node the command looks something like this

java -jar selenium-server-standalone-2.32.0.jar -role node -host <nodeipaddress> -port 5555 -hub http://<hubipaddress>:4444/grid/register

In my case both hubipaddress and nodeipaddress are the same and they are the ip address assigned to me over the VPN

兮颜 2024-12-31 02:14:39

如果您使用虚拟机,您需要检查您的熵。 Selenium 使用 urandom,如果没有足够的熵,节点将需要 1 小时以上(如果有的话)才能启动。

在 CentOS(和其他发行版)上安装:

yum install haveged
chkconfig haveged on
systemctl start haveged

重新启动两个服务,Selenium 应该可以正常启动。

IF you are using a virtual machine you need to check your entropy. Selenium used urandom and if you don't have enough entropy it will take 1hour+ (if at all) for the node to come up.

On CentOS (and other distros) install:

yum install haveged
chkconfig haveged on
systemctl start haveged

Restart both services and Selenium should boot properly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文