Selenium Grid2 - 远程节点未连接到集线器
我当前的设置是我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
感谢大家的帮助,但问题是因为我的节点服务器的 IP 地址不可路由。
所以我为节点服务器创建了一个主机条目(还有 DNS 条目)。
并添加了另一个参数
-host
所以该命令现在看起来像
再次感谢大家。
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
thanks once again everyone.
对我来说,你的做法似乎是正确的。您在启动节点时尝试过 -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
当我使用 VPN 时,在本地计算机上托管节点和集线器时,我遇到了类似的问题。我能够通过使用参数 -host 和 -port 启动集线器和节点来解决这个问题
对于启动集线器,命令看起来像这样
对于启动节点,命令看起来像这样
在我的情况下, 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
For Launching the node the command looks something like this
In my case both hubipaddress and nodeipaddress are the same and they are the ip address assigned to me over the VPN
如果您使用虚拟机,您需要检查您的熵。 Selenium 使用 urandom,如果没有足够的熵,节点将需要 1 小时以上(如果有的话)才能启动。
在 CentOS(和其他发行版)上安装:
重新启动两个服务,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:
Restart both services and Selenium should boot properly.