Skip to content

Fix problems with running node and hub on one system under Debian - #58

Open
bitte-ein-bit wants to merge 1 commit into
jhoblitt:masterfrom
bitte-ein-bit:master
Open

bitte-ein-bit wants to merge 1 commit into
jhoblitt:masterfrom
bitte-ein-bit:master

Conversation

@bitte-ein-bit

Copy link
Copy Markdown

Under Debian the provided sample for grid in a box does not work due to both init scripts checking for port 4444 in use. With a started hub a node will not start even though a node does not use port 4444.

I removed the check and some (obsolete?) variables

@marcgascon

Copy link
Copy Markdown
Contributor

+1 and @jhoblitt can you please check this and merge? It's a very important improvement if you want to run the server, hub and node in the same running server.

It's important to fix it please.

@jhoblitt

jhoblitt commented Feb 2, 2016

Copy link
Copy Markdown
Owner

@marcgascon Why would you want to run the server and hub on the same node? They generally should use the same port.

@bitte-ein-bit

Copy link
Copy Markdown
Author

@jhoblitt this fix is necessary to run a hub and a node on the same box i.e. grid in a box. The removed check is simply superfluous as the node does not use port 4444. So the check for a port which the hub uses will block the node from (re-)starting.

@marcgascon

Copy link
Copy Markdown
Contributor

@jhoblitt I want to run everything on the same server because it is expected to use as test environment. We are in AWS and it's not necessary to pay for 2 instances. Also I think that it's better not to limit the possibilities of something like that. What do you think?

@marcgascon

Copy link
Copy Markdown
Contributor

@bitte-ein-bit maybe the HTTP port can be passed as an argument to the template or defaults 4444. This way you don't need to remove code, you should partametrize it, and you can continue checking if the port you want to start the server, hub or node it's free or not.

@bitte-ein-bit

Copy link
Copy Markdown
Author

Well let's look at the redhat init.d script. There is no check for the port.

Let's look at the default ports. I have the following processes running:

# ps aux | grep selenium | grep java
selenium   701  0.0  0.0  19816   392 ?        S     2015   0:00 /usr/bin/daemon --name=seleniumnode --inherit --output=/opt/selenium/log/node_stdout.log --pidfile=/var/run/seleniumnode/seleniumnode.pid --env=DISPLAY=:0 -- java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -Dwebdriver.enable.native.events=1 -role node -hub http://sel.dev.fqdn:4444/grid/register
selenium   702  0.1  3.9 1147752 82260 ?       Sl    2015 181:20 java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -Dwebdriver.enable.native.events=1 -role node -hub http://sel.dev.fqdn:4444/grid/register
selenium  2799  0.0  0.0  19816   388 ?        S     2015   0:00 /usr/bin/daemon --name=seleniumhub --inherit --output=/opt/selenium/log/hub_stdout.log --pidfile=/var/run/seleniumhub/seleniumhub.pid --env=DISPLAY=:0 -- java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -role hub
selenium  2800  0.1  4.0 1152116 83216 ?       Sl    2015 145:26 java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -role hub

they use those default ports:

# netstat -anpt | grep LISTEN | grep java
tcp6       0      0 :::5555                 :::*                    LISTEN      702/java
tcp6       0      0 :::4444                 :::*                    LISTEN      2800/java

So why should the node check for a used port 4444? There is no command line argument in use to make a node listen to a specific port. Either someone has to extend the manifests to use a port variable and enforce that option. Or this merge has to be accepted with the knowledge that this is not the best solution but fixes the issue of running a hub and a node on the same box.

@jhoblitt

Copy link
Copy Markdown
Owner

@bitte-ein-bit Could you rebase on current master?

@dejo1307

dejo1307 commented Oct 6, 2016

Copy link
Copy Markdown

Hi,

Any plan to continue on this? This is basically preventing usage of of both node and hub class on the same server.

Asking just to avoid sending another pull request tackling the same issue (in this case I would just add a port as a parameter).

Thanks

@bitte-ein-bit

Copy link
Copy Markdown
Author

not using puppet currently. Someone else feel free to pick this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants