Selenium Grid2 - Remote Node not connecting to HUB
Asked Answered
S

4

7

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!!!!!

Shock answered 30/12, 2011 at 18:35 Comment(1)
Did you ever try running the same command used in windows? Without browser or platformAdessive
S
12

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.

Shock answered 4/1, 2012 at 19:24 Comment(3)
I was facing same issue with Mac machine but -host parameter resolved my issue. Thanks buddyCowans
Hi Amey, can I use ip address instead of machine.name.com? if yes, what will be the value for -hubHost and -host. I don know my machine name.Subacute
I am guessing you can start the node by ignoring those two options completely.Shock
D
0

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

Demonic answered 31/12, 2011 at 11:5 Comment(2)
Thanks I figured it out, it because of the Local Area Network I am encapsulated in. I have provided the host command i typed to make it workShock
why do you say that about the browserName? Everything I've read says it should be chromeLabourer
R
0

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

Romaic answered 21/5, 2013 at 5:8 Comment(0)
R
0

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.

Reichel answered 28/1, 2016 at 16:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.